Vadim Petrochenkov
8d5109aa6e
compiletest: Support matching on diagnostics without a span
2025-03-25 17:33:09 +03:00
Michael Goulet
279377f87a
Fix pretty printing of parsed attrs in hir_pretty
2025-03-10 02:04:26 +00:00
Jana Dönszelmann
8391c08b03
Revert #138019 after further discussion about adding this exception in hir-pretty
2025-03-05 16:19:03 +01:00
Predrag Gruevski
55f8d3f628
Pretty-print #[deprecated] attribute in HIR.
2025-03-05 01:51:07 +00:00
Jacob Pratt
4bed9eca0e
Rollup merge of #137423 - Urgau:imprv-pretty-hir, r=compiler-errors
...
Improve a bit HIR pretty printer
This PR improve (a bit) the HIR pretty printer.
It does so by:
- Not printing elided lifetimes (those are not expressible in surface Rust anyway)
- And by rendering implicit self with the shorthand syntax
I also tried fixing some indentation and other things but gave up for now.
Best reviewed commit by commit.
2025-02-23 02:44:19 -05:00
Urgau
d0e7bfd205
Render implicit self with their shorthand syntax in HIR pretty printing
2025-02-22 17:12:19 +01:00
Urgau
46154c9b09
Filter elided lifetimes in HIR pretty printing
2025-02-22 17:12:19 +01:00
Urgau
56a850250b
Pre-commit unpretty HIR test
2025-02-18 21:34:35 +01:00
Chris Denton
8ae3ca98e5
Fix test that relies on error language
2025-02-16 09:08:24 +00:00
Oli Scherer
6d7ce4e893
Add a TyPat in the AST to reuse the generic arg lowering logic
2025-02-11 08:51:05 +00:00
Esteban Küber
57dd42d613
Point at invalid utf-8 span on user's source code
...
```
error: couldn't read `$DIR/not-utf8-bin-file.rs`: stream did not contain valid UTF-8
--> $DIR/not-utf8-2.rs:6:5
|
LL | include!("not-utf8-bin-file.rs");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: `[193]` is not valid utf-8
--> $DIR/not-utf8-bin-file.rs:2:14
|
LL | let _ = "�|�␂!5�cc␕␂��";
| ^
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
```
When we attempt to load a Rust source code file, if there is a OS file failure we try reading the file as bytes. If that succeeds we try to turn it into UTF-8. If *that* fails, we provide additional context about *where* the file has the first invalid UTF-8 character.
Fix #76869 .
2025-01-22 00:52:27 +00:00
Jacob Pratt
285df03257
Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril
...
Make missing_abi lint warn-by-default.
This makes the missing_abi lint warn-by-default, as suggested here: https://github.com/rust-lang/rfcs/pull/3722#issuecomment-2447719047
This needs a lang FCP.
2025-01-15 04:08:10 -05:00
Oli Scherer
4a8773a3af
Rename PatKind::Lit to Expr
2025-01-08 07:34:59 +00:00
Oli Scherer
c9365dd09f
Exhaustively handle expressions in patterns
2025-01-08 07:33:46 +00:00
Mara Bos
585c9765a2
Update tests.
2025-01-07 16:04:14 +01:00
Ralf Jung
ac9cb908ac
turn rustc_box into an intrinsic
2025-01-03 12:01:31 +01:00
Zalathar
835fbcbcab
Remove the -test suffix from normalize directives
2024-12-27 19:58:16 +11:00
David Tolnay
23a250738b
Relocate dyn* test out of parenthesis insertion test
2024-12-20 21:31:21 -08:00
Michael Goulet
c605c84be8
Stabilize async closures
2024-12-13 00:04:56 +00:00
Oli Scherer
f613636ae8
Rename core_pattern_type and core_pattern_types lib feature gates to pattern_type_macro
...
That's what the gates are actually gating, and the single char difference in naming was not helpful either
2024-12-04 16:16:24 +00:00
Eric Huss
31c9222639
Stabilize the 2024 edition
2024-11-22 11:12:15 -08:00
Urgau
f5b6f938ce
Print unsafety of attribute in AST unpretty
2024-10-26 13:33:36 +02:00
Urgau
f249fdd962
Add AST unpretty test for unsafe attribute
2024-10-26 13:31:24 +02:00
Michael Goulet
4e1b3ab0e7
Print safety correctly in extern static items
2024-10-24 00:41:27 +00:00
Michael Goulet
6628bba060
Remove crashes and fix tests
2024-10-01 13:55:46 -04:00
Michael Goulet
e3a0da1863
Remove unnamed field feature
2024-10-01 13:55:46 -04:00
Ralf Jung
79503dd742
stabilize raw_ref_op
2024-08-18 19:46:53 +02:00
Santiago Pastorino
8366c7fe9c
Stabilize unsafe extern blocks (RFC 3484)
2024-07-23 00:29:39 -03:00
Zalathar
9aaa0c5867
Always use a colon in //@ normalize-*: headers
2024-07-11 12:23:44 +10:00
David Tolnay
06982239a6
Parenthesize break values containing leading label
2024-07-01 17:19:58 -07:00
David Tolnay
5f37433b6c
Add test of parenthesizing break value by AST pretty-printer
2024-06-23 17:17:30 -07:00
Oli Scherer
cbee17d502
Revert "Create const block DefIds in typeck instead of ast lowering"
...
This reverts commit ddc5f9b6c1 .
2024-06-07 08:33:58 +00:00
Santiago Pastorino
0380321e78
Add unsafe_extern_blocks feature flag
2024-06-05 09:35:57 -03:00
Santiago Pastorino
3ba8de0b60
Make extern blocks without unsafe warn in edition 2024
2024-06-04 14:19:42 -03:00
Oli Scherer
ddc5f9b6c1
Create const block DefIds in typeck instead of ast lowering
2024-05-28 13:38:43 +00:00
Matthias Krüger
4b26045b92
Rollup merge of #125158 - Nilstrieb:block-indent, r=compiler-errors
...
hir pretty: fix block indent
before:
```rust
fn main() {
{
{
::std::io::_print(format_arguments::new_const(&["Hello, world!\n"]));
};
}
}
```
after:
```rust
fn main() {
{
{
::std::io::_print(format_arguments::new_const(&["Hello, world!\n"]));
};
}
}
```
AST pretty does the same.
2024-05-21 00:47:02 +02:00
Nilstrieb
7b1527ff5f
hir pretty: fix block indent
2024-05-20 20:30:44 +02:00
David Tolnay
3e05be5466
Add tests for -Zunpretty=expanded ported from stringify's tests
2024-05-18 10:36:02 -07:00
David Tolnay
94cc82c088
Pretty-print let-else with added parenthesization when needed
2024-05-12 13:42:37 -07:00
David Tolnay
68854b798e
Add AST pretty-printer tests for let-else
2024-05-12 13:37:00 -07:00
Matthias Krüger
a15996c9f1
try to fix tests on windows where the "file not found" error is different from linux
2024-04-28 11:07:00 +02:00
Matthias Krüger
c968b8b777
add test for ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path with staged_ap
...
Fixes https://github.com/rust-lang/rust/issues/108697
2024-04-28 10:23:10 +02:00
Yaodong Yang
2575b8e79c
move hir-tree test from run-make to ui test
2024-04-04 18:43:26 +08:00
Alex Macleod
47192937d4
Fix unpretty UI test when /tmp does not exist
2024-03-24 14:00:45 +00:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives
2024-02-16 20:02:50 +00:00
Michael Goulet
7e00e9736d
Make some non-diagnostic-affecting QPath::LangItem into regular qpaths
2023-12-26 04:07:38 +00:00
Nilstrieb
41e8d152dc
Show number in error message even for one error
...
Co-authored-by: Adrian <adrian.iosdev@gmail.com >
2023-11-24 19:15:52 +01:00
David Tolnay
f2e3d3fc63
Move OutFileName writing into rustc_session
2023-07-20 11:04:31 -07:00
jyn
01b75e20f2
Move some UI tests into subdirectories
...
to avoid going over the existing limit now that the ui-fulldeps tests have
been moved to ui.
2023-04-02 19:42:30 -04:00
Mara Bos
4d840223b0
Add test for -Zflatten-format-args=yes.
2023-03-16 12:16:27 +01:00