Skip to content

Commit

Permalink
Add feature gate test for pattern_complexity attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 3, 2024
1 parent 0fd22f2 commit 0216123
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ui/feature-gates/feature-gate-pattern-complexity.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// check that `pattern_complexity` is feature-gated

#![pattern_complexity = "42"]
//~^ ERROR: the `#[pattern_complexity]` attribute is just used for rustc unit tests

fn main() {}
12 changes: 12 additions & 0 deletions tests/ui/feature-gates/feature-gate-pattern-complexity.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0658]: the `#[pattern_complexity]` attribute is just used for rustc unit tests and will never be stable
--> $DIR/feature-gate-pattern_complexity.rs:3:1
|
LL | #![pattern_complexity = "42"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: aborting due to 1 previous error

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

0 comments on commit 0216123

Please sign in to comment.