-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Expand: nix all fatal errors #70074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+584
−274
Merged
Expand: nix all fatal errors #70074
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0f2d968
rustc_expand::base: nix panictry! uses
Centril 0a8db69
nix panictry! in ParserAnyMacro::make
Centril b7909b2
nix remaining rustc_expand::panictry! uses.
Centril b0537e2
generic_extension: defatalize Error case
Centril 35cca74
defatalize BangProcMacro::expand
Centril ce8880d
defatalize AttrProcMacro::expand
Centril c1ef1b3
defatalize ProcMacroDerive::expand
Centril ad26401
remove ExtCxt::struct_span_warn
Centril df9cec2
mbe::transcribe: defatalize errors.
Centril 1bfa248
defatalize `compile_declarative_macro`
Centril 2868045
expand: nix unused method
Centril 0e0f931
defatalize get_test_runner
Centril 3979964
defatalize expand_test_or_bench
Centril 21944b3
expand: add recovery for parse_nt
Centril d8080d8
expand: address review comments
Centril d071035
fix rebase fallout
Centril c415f12
fix rebase fallout due to #69497.
Centril 470e163
pacify missing sysroot spans issue
Centril File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
// Regression test for issue #61033. | ||
|
||
macro_rules! test1 { | ||
($x:ident, $($tt:tt)*) => { $($tt)+ } //~ERROR this must repeat at least once | ||
($x:ident, $($tt:tt)*) => { $($tt)+ } //~ ERROR this must repeat at least once | ||
} | ||
|
||
fn main() { | ||
test1!(x,); | ||
let _recovery_witness: () = 0; //~ ERROR mismatched types | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/test/ui/macros/local-ambiguity-multiple-parsing-options.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn main() {} | ||
|
||
macro_rules! ambiguity { | ||
($($i:ident)* $j:ident) => {}; | ||
} | ||
|
||
ambiguity!(error); //~ ERROR local ambiguity | ||
ambiguity!(error); //~ ERROR local ambiguity |
14 changes: 14 additions & 0 deletions
14
src/test/ui/macros/local-ambiguity-multiple-parsing-options.stderr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: local ambiguity: multiple parsing options: built-in NTs ident ('i') or ident ('j'). | ||
--> $DIR/local-ambiguity-multiple-parsing-options.rs:7:12 | ||
| | ||
LL | ambiguity!(error); | ||
| ^^^^^ | ||
|
||
error: local ambiguity: multiple parsing options: built-in NTs ident ('i') or ident ('j'). | ||
--> $DIR/local-ambiguity-multiple-parsing-options.rs:8:12 | ||
| | ||
LL | ambiguity!(error); | ||
| ^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
error: missing fragment specifier | ||
--> $DIR/macro-match-nonterminal.rs:1:24 | ||
--> $DIR/macro-match-nonterminal.rs:2:8 | ||
| | ||
LL | macro_rules! test { ($a, $b) => (()); } | ||
| ^ | ||
LL | ($a, $b) => { | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
error: missing fragment specifier | ||
--> $DIR/macro-match-nonterminal.rs:2:10 | ||
| | ||
LL | ($a, $b) => { | ||
| ^^ | ||
| | ||
= note: `#[deny(missing_fragment_specifier)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ macro_rules! foo { | |
} | ||
|
||
foo!(); | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
macro_rules! mac { | ||
( $($v:tt)* ) => ( | ||
$v //~ ERROR still repeating at this depth | ||
) | ||
( $($v:tt)* ) => { | ||
$v | ||
//~^ ERROR still repeating at this depth | ||
//~| ERROR still repeating at this depth | ||
}; | ||
} | ||
|
||
fn main() { | ||
mac!(0); | ||
mac!(1); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
macro_rules! foo { | ||
($e:expr) => {} | ||
} | ||
|
||
foo!(1 + @); //~ ERROR expected expression, found `@` | ||
foo!(1 + @); //~ ERROR expected expression, found `@` | ||
|
||
fn main() { | ||
let _recovery_witness: () = 0; //~ ERROR mismatched types | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: expected expression, found `@` | ||
--> $DIR/nt-parsing-has-recovery.rs:5:10 | ||
| | ||
LL | ($e:expr) => {} | ||
| ------- while parsing argument for this `expr` macro fragment | ||
... | ||
LL | foo!(1 + @); | ||
| ^ expected expression | ||
|
||
error: expected expression, found `@` | ||
--> $DIR/nt-parsing-has-recovery.rs:6:10 | ||
| | ||
LL | ($e:expr) => {} | ||
| ------- while parsing argument for this `expr` macro fragment | ||
... | ||
LL | foo!(1 + @); | ||
| ^ expected expression | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/nt-parsing-has-recovery.rs:9:33 | ||
| | ||
LL | let _recovery_witness: () = 0; | ||
| -- ^ expected `()`, found integer | ||
| | | ||
| expected due to this | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
error: expected `:`, found `}` | ||
--> $DIR/derive-bad.rs:7:5 | ||
--> $DIR/derive-bad.rs:6:10 | ||
| | ||
LL | A | ||
| ^ expected `:` | ||
LL | #[derive(A)] | ||
| ^ expected `:` | ||
| | ||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: proc-macro derive produced unparseable tokens | ||
--> $DIR/derive-bad.rs:7:5 | ||
--> $DIR/derive-bad.rs:6:10 | ||
| | ||
LL | A | ||
| ^ | ||
LL | #[derive(A)] | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
error[E0428]: the name `A` is defined multiple times | ||
--> $DIR/derive-bad.rs:9:1 | ||
| | ||
LL | #[derive(A)] | ||
| - previous definition of the type `A` here | ||
... | ||
LL | struct A; | ||
| ^^^^^^^^^ `A` redefined here | ||
| | ||
= note: `A` must be defined only once in the type namespace of this module | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0428`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
extern crate invalid_punct_ident; | ||
|
||
invalid_punct!(); //~ ERROR proc macro panicked | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
extern crate invalid_punct_ident; | ||
|
||
invalid_ident!(); //~ ERROR proc macro panicked | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
extern crate invalid_punct_ident; | ||
|
||
invalid_raw_ident!(); //~ ERROR proc macro panicked | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ | |
extern crate transitive_dep_two; | ||
|
||
transitive_dep_two::parse_error!(); //~ ERROR expected one of | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
fn main() { | ||
let _ = Option:Some(vec![0, 1]); //~ ERROR expected type, found | ||
//~^ ERROR expected value, found enum `Option` | ||
//~| ERROR expected type, found variant `Some` | ||
} | ||
|
||
// This case isn't currently being handled gracefully due to the macro invocation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion is really weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open an issue: #70382