Skip to content

Commit 7a8c0fc

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 223c95f commit 7a8c0fc

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
@@ -1149,7 +1149,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
11491149
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
11501150
),
11511151
rustc_attr!(
1152-
TEST, pattern_complexity, CrateLevel, template!(NameValueStr: "N"),
1152+
TEST, pattern_complexity_limit, CrateLevel, template!(NameValueStr: "N"),
11531153
ErrorFollowing, EncodeCrossCrate::No,
11541154
),
11551155
];

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
@@ -36,7 +36,7 @@ pub(crate) fn provide(providers: &mut Providers) {
3636
pattern_complexity_limit: get_limit(
3737
tcx.hir().krate_attrs(),
3838
tcx.sess,
39-
sym::pattern_complexity,
39+
sym::pattern_complexity_limit,
4040
Limit::unlimited(),
4141
),
4242
}

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ symbols! {
15121512
path_main_separator,
15131513
path_to_pathbuf,
15141514
pathbuf_as_path,
1515-
pattern_complexity,
1515+
pattern_complexity_limit,
15161516
pattern_parentheses,
15171517
pattern_type,
15181518
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 renamed to 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)