-
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.
Make
missing_fragment_specifier
an unconditional error
This was attempted in [1] then reverted in [2] because of fallout. Recently, this was made an edition-dependent error in [3]. Make missing fragment specifiers an unconditional error again. [1]: #75516 [2]: #80210 [3]: #128006
- Loading branch information
Showing
19 changed files
with
63 additions
and
310 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
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,7 +1,7 @@ | ||
#![allow(unused)] | ||
|
||
macro_rules! m { ($i) => {} } | ||
//~^ ERROR missing fragment specifier | ||
//~| WARN previously accepted | ||
macro_rules! m { | ||
($i) => {}; //~ ERROR missing fragment specifier | ||
} | ||
|
||
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,23 +1,15 @@ | ||
error: missing fragment specifier | ||
--> $DIR/issue-39404.rs:3:19 | ||
--> $DIR/issue-39404.rs:4:6 | ||
| | ||
LL | macro_rules! m { ($i) => {} } | ||
| ^^ | ||
LL | ($i) => {}; | ||
| ^^ | ||
| | ||
= 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> | ||
= note: `#[deny(missing_fragment_specifier)]` on by default | ||
= note: fragment specifiers must be specified in the 2024 edition | ||
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` | ||
help: try adding a specifier here | ||
| | ||
LL | ($i:spec) => {}; | ||
| +++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: missing fragment specifier | ||
--> $DIR/issue-39404.rs:3:19 | ||
| | ||
LL | macro_rules! m { ($i) => {} } | ||
| ^^ | ||
| | ||
= 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> | ||
= note: `#[deny(missing_fragment_specifier)]` on by default | ||
|
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
26 changes: 9 additions & 17 deletions
26
tests/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 |
---|---|---|
@@ -1,29 +1,21 @@ | ||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6 | ||
| | ||
LL | ($name) => {} | ||
LL | ($name) => {}; | ||
| ^^^^^ | ||
|
||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6 | ||
| | ||
LL | ($name) => {} | ||
| ^^^^^ | ||
= note: fragment specifiers must be specified in the 2024 edition | ||
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` | ||
help: try adding a specifier here | ||
| | ||
= 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> | ||
= note: `#[deny(missing_fragment_specifier)]` on by default | ||
LL | ($name:spec) => {}; | ||
| +++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6 | ||
| | ||
LL | ($name) => {} | ||
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> | ||
= note: `#[deny(missing_fragment_specifier)]` on by default | ||
|
||
error: aborting due to 2 previous errors | ||
|
Oops, something went wrong.