Skip to content

Commit dd1c55b

Browse files
Add feature gate test for pattern_complexity attribute
1 parent bac034b commit dd1c55b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// check that `pattern_complexity` is feature-gated
2+
3+
#![pattern_complexity = "42"]
4+
//~^ ERROR: the `#[pattern_complexity]` attribute is just used for rustc unit tests
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0658]: the `#[pattern_complexity]` attribute is just used for rustc unit tests and will never be stable
2+
--> $DIR/feature-gate-pattern_complexity.rs:3:1
3+
|
4+
LL | #![pattern_complexity = "42"]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
8+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
9+
10+
error: aborting due to 1 previous error
11+
12+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)