Skip to content

Commit b9babad

Browse files
committed
Add feature gate test for cfg'd out super let.
1 parent 3e6cc76 commit b9babad

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

tests/ui/feature-gates/feature-gate-super-let.rs

+7
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@ fn main() {
22
super let a = 1;
33
//~^ ERROR `super let` is experimental
44
}
5+
6+
// Check that it also isn't accepted in cfg'd out code.
7+
#[cfg(any())]
8+
fn a() {
9+
super let a = 1;
10+
//~^ ERROR `super let` is experimental
11+
}

tests/ui/feature-gates/feature-gate-super-let.stderr

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ LL | super let a = 1;
88
= help: add `#![feature(super_let)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

11-
error: aborting due to 1 previous error
11+
error[E0658]: `super let` is experimental
12+
--> $DIR/feature-gate-super-let.rs:9:5
13+
|
14+
LL | super let a = 1;
15+
| ^^^^^
16+
|
17+
= note: see issue #139076 <https://github.com/rust-lang/rust/issues/139076> for more information
18+
= help: add `#![feature(super_let)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+
error: aborting due to 2 previous errors
1222

1323
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)