-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #109029 - compiler-errors:parse-gating, r=jackh726
Gate usages of `dyn*` and const closures in macros We silently accepted `dyn*` and const closures in macros as long as they didn't expand to anything containing these experimental features, unlike other gated features such as `for<'a>` binders on closures, etc. Let's not do that, to make sure nobody begins relying on this.
- Loading branch information
Showing
12 changed files
with
61 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
macro_rules! t { | ||
($t:ty) => {} | ||
} | ||
|
||
t!(dyn* Send); | ||
//~^ ERROR `dyn*` trait objects are experimental | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0658]: `dyn*` trait objects are experimental | ||
--> $DIR/gated-span.rs:5:4 | ||
| | ||
LL | t!(dyn* Send); | ||
| ^^^^ | ||
| | ||
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information | ||
= help: add `#![feature(dyn_star)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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,5 +1,13 @@ | ||
// gate-test-const_closures | ||
|
||
fn main() { | ||
(const || {})(); | ||
//~^ ERROR: const closures are experimental | ||
} | ||
|
||
macro_rules! e { | ||
($e:expr) => {} | ||
} | ||
|
||
e!((const || {})); | ||
//~^ ERROR const closures are experimental |
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,12 +1,21 @@ | ||
error[E0658]: const closures are experimental | ||
--> $DIR/gate.rs:3:6 | ||
--> $DIR/gate.rs:4:6 | ||
| | ||
LL | (const || {})(); | ||
| ^^^^^^^^^^^ | ||
| ^^^^^ | ||
| | ||
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information | ||
= help: add `#![feature(const_closures)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
error[E0658]: const closures are experimental | ||
--> $DIR/gate.rs:12:5 | ||
| | ||
LL | e!((const || {})); | ||
| ^^^^^ | ||
| | ||
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information | ||
= help: add `#![feature(const_closures)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |