-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn lint to allow by default and add future proofing warning
- Loading branch information
Showing
10 changed files
with
60 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,21 +1,8 @@ | ||
error: repetition matches empty token tree | ||
--> $DIR/issue-42755.rs:13:7 | ||
--> $DIR/issue-42755.rs:2:7 | ||
| | ||
LL | ($($p:vis)*) => {} | ||
| ^^^^^^^^ | ||
|
||
warning: `$p:vis` is followed (through repetition) by itself, which is not allowed for `vis` fragments | ||
--> $DIR/issue-42755.rs:13:8 | ||
| | ||
LL | ($($p:vis)*) => {} | ||
| ^^^^^^ this fragment is followed by itself without a valid separator | ||
| | ||
= note: #[warn(incorrect_macro_fragment_repetition)] on by default | ||
= note: allowed there are: `,`, an ident or a type | ||
help: add a valid separator for the repetition to be unambiguous, for example | ||
| | ||
LL | ($($p:vis),*) => {} | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains 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,4 +1,9 @@ | ||
#![deny(incorrect_macro_fragment_repetition)] | ||
|
||
macro_rules! foo { | ||
($($a:expr)*) => {}; | ||
//~^ WARN `$a:expr` is followed (through repetition) by itself, which is not allowed for | ||
//~^ ERROR `$a:expr` is followed (through repetition) by itself, which is not allowed for | ||
//~| WARN this was previously accepted by the compiler but is being phased out | ||
} | ||
|
||
fn main() {} |
This file contains 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,20 +1,21 @@ | ||
warning: `$a:expr` is followed (through repetition) by itself, which is not allowed for `expr` fragments | ||
--> $DIR/incorrrect-repetition-2.rs:2:8 | ||
error: `$a:expr` is followed (through repetition) by itself, which is not allowed for `expr` fragments | ||
--> $DIR/incorrrect-repetition-2.rs:4:8 | ||
| | ||
LL | ($($a:expr)*) => {}; | ||
| ^^^^^^^ this fragment is followed by itself without a valid separator | ||
| | ||
= note: #[warn(incorrect_macro_fragment_repetition)] on by default | ||
note: lint level defined here | ||
--> $DIR/incorrrect-repetition-2.rs:1:9 | ||
| | ||
LL | #![deny(incorrect_macro_fragment_repetition)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= 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 #56575 <https://github.com/rust-lang/rust/issues/56575> | ||
= note: allowed there are: `;`, `=>` or `,` | ||
help: add a valid separator for the repetition to be unambiguous, for example | ||
| | ||
LL | ($($a:expr);*) => {}; | ||
| ^ | ||
|
||
error[E0601]: `main` function not found in crate `incorrrect_repetition_2` | ||
| | ||
= note: consider adding a `main` function to `$DIR/incorrrect-repetition-2.rs` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0601`. |
This file contains 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,10 +1,11 @@ | ||
#![deny(incorrect_macro_fragment_repetition)] | ||
|
||
macro_rules! sneaky { | ||
($($i:ident $e:expr)*) => {} | ||
//~^ WARN `$e:expr` is followed (through repetition) by `$i:ident`, which is not allowed for | ||
//~^ ERROR `$e:expr` is followed (through repetition) by `$i:ident`, which is not allowed for | ||
//~| WARN this was previously accepted by the compiler but is being phased out | ||
} | ||
|
||
fn main() { | ||
sneaky!(a b c d); | ||
let x: () = 1; | ||
//~^ ERROR | ||
} |
This file contains 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,27 +1,23 @@ | ||
warning: `$e:expr` is followed (through repetition) by `$i:ident`, which is not allowed for `expr` fragments | ||
--> $DIR/incorrrect-repetition.rs:2:17 | ||
error: `$e:expr` is followed (through repetition) by `$i:ident`, which is not allowed for `expr` fragments | ||
--> $DIR/incorrrect-repetition.rs:4:17 | ||
| | ||
LL | ($($i:ident $e:expr)*) => {} | ||
| -------- ^^^^^^^ this fragment is followed by the first fragment in this repetition without a valid separator | ||
| | | ||
| this is the first fragment in the evaluated repetition | ||
| | ||
= note: #[warn(incorrect_macro_fragment_repetition)] on by default | ||
note: lint level defined here | ||
--> $DIR/incorrrect-repetition.rs:1:9 | ||
| | ||
LL | #![deny(incorrect_macro_fragment_repetition)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= 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 #56575 <https://github.com/rust-lang/rust/issues/56575> | ||
= note: allowed there are: `;`, `=>` or `,` | ||
help: add a valid separator for the repetition to be unambiguous, for example | ||
| | ||
LL | ($($i:ident $e:expr);*) => {} | ||
| ^ | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/incorrrect-repetition.rs:8:17 | ||
| | ||
LL | let x: () = 1; | ||
| ^ expected (), found integral variable | ||
| | ||
= note: expected type `()` | ||
found type `{integer}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains 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 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