-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expand: Remove
ParseSess::missing_fragment_specifiers
It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff.
- Loading branch information
1 parent
399dd80
commit 379ae12
Showing
13 changed files
with
137 additions
and
47 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
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
15 changes: 15 additions & 0 deletions
15
src/test/ui/macros/macro-missing-fragment-deduplication.rs
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// compile-flags: -Zdeduplicate-diagnostics=yes | ||
|
||
macro_rules! m { | ||
($name) => {} | ||
//~^ ERROR missing fragment | ||
//~| ERROR missing fragment | ||
//~| WARN this was previously accepted | ||
} | ||
|
||
fn main() { | ||
m!(); | ||
m!(); | ||
m!(); | ||
m!(); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/ui/macros/macro-missing-fragment-deduplication.stderr
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6 | ||
| | ||
LL | ($name) => {} | ||
| ^^^^^ | ||
|
||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6 | ||
| | ||
LL | ($name) => {} | ||
| ^^^^^ | ||
| | ||
= 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 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,7 +1,26 @@ | ||
macro_rules! m { | ||
( $( any_token $field_rust_type )* ) => {}; //~ ERROR missing fragment | ||
#![warn(missing_fragment_specifier)] | ||
|
||
macro_rules! used_arm { | ||
( $( any_token $field_rust_type )* ) => {}; | ||
//~^ ERROR missing fragment | ||
//~| WARN missing fragment | ||
//~| WARN this was previously accepted | ||
} | ||
|
||
macro_rules! used_macro_unused_arm { | ||
() => {}; | ||
( $name ) => {}; | ||
//~^ WARN missing fragment | ||
//~| WARN this was previously accepted | ||
} | ||
|
||
macro_rules! unused_macro { | ||
( $name ) => {}; | ||
//~^ WARN missing fragment | ||
//~| WARN this was previously accepted | ||
} | ||
|
||
fn main() { | ||
m!(); | ||
used_arm!(); | ||
used_macro_unused_arm!(); | ||
} |
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,8 +1,40 @@ | ||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:2:20 | ||
--> $DIR/macro-missing-fragment.rs:4:20 | ||
| | ||
LL | ( $( any_token $field_rust_type )* ) => {}; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
warning: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:4:20 | ||
| | ||
LL | ( $( any_token $field_rust_type )* ) => {}; | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/macro-missing-fragment.rs:1:9 | ||
| | ||
LL | #![warn(missing_fragment_specifier)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= 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> | ||
|
||
warning: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:12:7 | ||
| | ||
LL | ( $name ) => {}; | ||
| ^^^^^ | ||
| | ||
= 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> | ||
|
||
warning: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:18:7 | ||
| | ||
LL | ( $name ) => {}; | ||
| ^^^^^ | ||
| | ||
= 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 previous error; 3 warnings emitted | ||
|
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