Skip to content

Commit cbe77b1

Browse files
committed
Rename pattern_complexity attr as pattern_complexity_limit.
For consistency with `recursion_limit`, `move_size_limit`, and `type_length_limit`.
1 parent 8101d01 commit cbe77b1

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
11481148
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
11491149
),
11501150
rustc_attr!(
1151-
TEST, pattern_complexity, CrateLevel, template!(NameValueStr: "N"),
1151+
TEST, pattern_complexity_limit, CrateLevel, template!(NameValueStr: "N"),
11521152
ErrorFollowing, EncodeCrossCrate::No,
11531153
),
11541154
];

compiler/rustc_feature/src/unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ declare_features! (
227227
/// Allows using `#[omit_gdb_pretty_printer_section]`.
228228
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
229229
/// Set the maximum pattern complexity allowed (not limited by default).
230-
(internal, pattern_complexity, "1.78.0", None),
230+
(internal, pattern_complexity_limit, "1.78.0", None),
231231
/// Allows using pattern types.
232232
(internal, pattern_types, "1.79.0", Some(123646)),
233233
/// Allows using `#[prelude_import]` on glob `use` items.

compiler/rustc_interface/src/limits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub(crate) fn provide(providers: &mut Providers) {
3535
pattern_complexity_limit: get_limit(
3636
tcx.hir().krate_attrs(),
3737
tcx.sess,
38-
sym::pattern_complexity,
38+
sym::pattern_complexity_limit,
3939
Limit::unlimited(),
4040
),
4141
}

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ symbols! {
14951495
path_main_separator,
14961496
path_to_pathbuf,
14971497
pathbuf_as_path,
1498-
pattern_complexity,
1498+
pattern_complexity_limit,
14991499
pattern_parentheses,
15001500
pattern_type,
15011501
pattern_types,

src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9107,8 +9107,8 @@ The tracking issue for this feature is: [#27721]
91079107
deny_since: None,
91089108
},
91099109
Lint {
9110-
label: "pattern_complexity",
9111-
description: r##"# `pattern_complexity`
9110+
label: "pattern_complexity_limit",
9111+
description: r##"# `pattern_complexity_limit`
91129112

91139113
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
91149114

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// check that `pattern_complexity_limit` is feature-gated
2+
3+
#![pattern_complexity_limit = "42"]
4+
//~^ ERROR: the `#[pattern_complexity_limit]` attribute is just used for rustc unit tests
5+
6+
fn main() {}

tests/ui/feature-gates/feature-gate-pattern-complexity.stderr tests/ui/feature-gates/feature-gate-pattern-complexity-limit.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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
1+
error[E0658]: the `#[pattern_complexity_limit]` attribute is just used for rustc unit tests and will never be stable
2+
--> $DIR/feature-gate-pattern-complexity-limit.rs:3:1
33
|
4-
LL | #![pattern_complexity = "42"]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | #![pattern_complexity_limit = "42"]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
88
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

tests/ui/feature-gates/feature-gate-pattern-complexity.rs

-6
This file was deleted.

tests/ui/pattern/complexity_limit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(rustc_attrs)]
2-
#![pattern_complexity = "10000"]
2+
#![pattern_complexity_limit = "10000"]
33

44
#[derive(Default)]
55
struct BaseCommand {

tests/ui/pattern/usefulness/issue-118437-exponential-time-on-diagonal-match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(rustc_attrs)]
2-
#![pattern_complexity = "61"]
2+
#![pattern_complexity_limit = "61"]
33

44
//@ check-pass
55
struct BaseCommand {

0 commit comments

Comments
 (0)