Skip to content

Commit 06338ca

Browse files
authored
Rollup merge of rust-lang#133863 - oli-obk:push-pystoxvtvssx, r=lqd
Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro` That's what the gates are actually gating, and the single char difference in naming was not helpful either fixes rust-lang#128987
2 parents b58b28c + f613636 commit 06338ca

31 files changed

+53
-74
lines changed

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub mod net;
345345
pub mod option;
346346
pub mod panic;
347347
pub mod panicking;
348-
#[unstable(feature = "core_pattern_types", issue = "123646")]
348+
#[unstable(feature = "pattern_type_macro", issue = "123646")]
349349
pub mod pat;
350350
pub mod pin;
351351
#[unstable(feature = "random", issue = "130703")]

library/core/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// ```
77
#[macro_export]
88
#[rustc_builtin_macro(pattern_type)]
9-
#[unstable(feature = "core_pattern_type", issue = "123646")]
9+
#[unstable(feature = "pattern_type_macro", issue = "123646")]
1010
macro_rules! pattern_type {
1111
($($arg:tt)*) => {
1212
/* compiler built-in */

library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ pub mod net;
589589
pub mod num;
590590
pub mod os;
591591
pub mod panic;
592-
#[unstable(feature = "core_pattern_types", issue = "123646")]
592+
#[unstable(feature = "pattern_type_macro", issue = "123646")]
593593
pub mod pat;
594594
pub mod path;
595595
#[unstable(feature = "anonymous_pipe", issue = "127154")]

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

+2-11
Original file line numberDiff line numberDiff line change
@@ -3936,17 +3936,8 @@ The tracking issue for this feature is: [#117693]
39363936
"##,
39373937
},
39383938
Lint {
3939-
label: "core_pattern_type",
3940-
description: r##"# `core_pattern_type`
3941-
3942-
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3943-
3944-
------------------------
3945-
"##,
3946-
},
3947-
Lint {
3948-
label: "core_pattern_types",
3949-
description: r##"# `core_pattern_types`
3939+
label: "pattern_type_macro",
3940+
description: r##"# `pattern_type_macro`
39503941
39513942
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
39523943

tests/codegen/pattern_type_symbols.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
//@ compile-flags: -Csymbol-mangling-version=v0 -Copt-level=0 --crate-type=lib
55

66
#![feature(pattern_types)]
7-
#![feature(core_pattern_types)]
8-
#![feature(core_pattern_type)]
7+
#![feature(pattern_type_macro)]
98

109
use std::pat::pattern_type;
1110

tests/ui/type/pattern_types/bad_const_generics_args_on_const_param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(pattern_types, core_pattern_type)]
1+
#![feature(pattern_types, pattern_type_macro)]
22
#![allow(internal_features)]
33

44
type Pat<const START: u32, const END: u32> =

tests/ui/type/pattern_types/bad_pat.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types)]
2-
#![feature(core_pattern_types)]
3-
#![feature(core_pattern_type)]
2+
#![feature(pattern_type_macro)]
43

54
use std::pat::pattern_type;
65

tests/ui/type/pattern_types/bad_pat.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0586]: inclusive range with no end
2-
--> $DIR/bad_pat.rs:7:43
2+
--> $DIR/bad_pat.rs:6:43
33
|
44
LL | type NonNullU32_2 = pattern_type!(u32 is 1..=);
55
| ^^^
@@ -12,7 +12,7 @@ LL + type NonNullU32_2 = pattern_type!(u32 is 1..);
1212
|
1313

1414
error[E0586]: inclusive range with no end
15-
--> $DIR/bad_pat.rs:9:40
15+
--> $DIR/bad_pat.rs:8:40
1616
|
1717
LL | type Positive2 = pattern_type!(i32 is 0..=);
1818
| ^^^
@@ -25,7 +25,7 @@ LL + type Positive2 = pattern_type!(i32 is 0..);
2525
|
2626

2727
error: wildcard patterns are not permitted for pattern types
28-
--> $DIR/bad_pat.rs:11:33
28+
--> $DIR/bad_pat.rs:10:33
2929
|
3030
LL | type Wild = pattern_type!(() is _);
3131
| ^

tests/ui/type/pattern_types/const_generics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//@ check-pass
22

33
#![feature(pattern_types)]
4-
#![feature(core_pattern_types)]
5-
#![feature(core_pattern_type)]
4+
#![feature(pattern_type_macro)]
65

76
use std::pat::pattern_type;
87

tests/ui/type/pattern_types/derives.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! Check that pattern types don't implement traits of their base automatically
22
33
#![feature(pattern_types)]
4-
#![feature(core_pattern_types)]
5-
#![feature(core_pattern_type)]
4+
#![feature(pattern_type_macro)]
65

76
use std::pat::pattern_type;
87

tests/ui/type/pattern_types/derives.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0369]: binary operation `==` cannot be applied to type `(i32) is 0..=999999999`
2-
--> $DIR/derives.rs:11:20
2+
--> $DIR/derives.rs:10:20
33
|
44
LL | #[derive(Clone, Copy, PartialEq)]
55
| --------- in this derive macro expansion

tests/ui/type/pattern_types/feature-gate-pattern_types.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
use std::pat::pattern_type;
44

55
type NonNullU32 = pattern_type!(u32 is 1..);
6-
//~^ use of unstable library feature `core_pattern_type`
6+
//~^ use of unstable library feature `pattern_type_macro`
77
type Percent = pattern_type!(u32 is 0..=100);
8-
//~^ use of unstable library feature `core_pattern_type`
8+
//~^ use of unstable library feature `pattern_type_macro`
99
type Negative = pattern_type!(i32 is ..=0);
10-
//~^ use of unstable library feature `core_pattern_type`
10+
//~^ use of unstable library feature `pattern_type_macro`
1111
type Positive = pattern_type!(i32 is 0..);
12-
//~^ use of unstable library feature `core_pattern_type`
12+
//~^ use of unstable library feature `pattern_type_macro`
1313
type Always = pattern_type!(Option<u32> is Some(_));
14-
//~^ use of unstable library feature `core_pattern_type`
14+
//~^ use of unstable library feature `pattern_type_macro`

tests/ui/type/pattern_types/feature-gate-pattern_types.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
error[E0658]: use of unstable library feature `core_pattern_type`
1+
error[E0658]: use of unstable library feature `pattern_type_macro`
22
--> $DIR/feature-gate-pattern_types.rs:5:19
33
|
44
LL | type NonNullU32 = pattern_type!(u32 is 1..);
55
| ^^^^^^^^^^^^
66
|
77
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
8-
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
8+
= help: add `#![feature(pattern_type_macro)]` 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[E0658]: use of unstable library feature `core_pattern_type`
11+
error[E0658]: use of unstable library feature `pattern_type_macro`
1212
--> $DIR/feature-gate-pattern_types.rs:7:16
1313
|
1414
LL | type Percent = pattern_type!(u32 is 0..=100);
1515
| ^^^^^^^^^^^^
1616
|
1717
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
18-
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
18+
= help: add `#![feature(pattern_type_macro)]` to the crate attributes to enable
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

21-
error[E0658]: use of unstable library feature `core_pattern_type`
21+
error[E0658]: use of unstable library feature `pattern_type_macro`
2222
--> $DIR/feature-gate-pattern_types.rs:9:17
2323
|
2424
LL | type Negative = pattern_type!(i32 is ..=0);
2525
| ^^^^^^^^^^^^
2626
|
2727
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
28-
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
28+
= help: add `#![feature(pattern_type_macro)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

31-
error[E0658]: use of unstable library feature `core_pattern_type`
31+
error[E0658]: use of unstable library feature `pattern_type_macro`
3232
--> $DIR/feature-gate-pattern_types.rs:11:17
3333
|
3434
LL | type Positive = pattern_type!(i32 is 0..);
3535
| ^^^^^^^^^^^^
3636
|
3737
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
38-
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
38+
= help: add `#![feature(pattern_type_macro)]` to the crate attributes to enable
3939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4040

41-
error[E0658]: use of unstable library feature `core_pattern_type`
41+
error[E0658]: use of unstable library feature `pattern_type_macro`
4242
--> $DIR/feature-gate-pattern_types.rs:13:15
4343
|
4444
LL | type Always = pattern_type!(Option<u32> is Some(_));
4545
| ^^^^^^^^^^^^
4646
|
4747
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
48-
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
48+
= help: add `#![feature(pattern_type_macro)]` to the crate attributes to enable
4949
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5050

5151
error: aborting due to 5 previous errors

tests/ui/type/pattern_types/feature-gate-pattern_types2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ compile-flags: -Zno-analysis
22
//@ check-pass
33

4-
#![feature(core_pattern_type)]
4+
#![feature(pattern_type_macro)]
55

66
use std::pat::pattern_type;
77

tests/ui/type/pattern_types/missing-is.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(core_pattern_type, core_pattern_types)]
1+
#![feature(pattern_type_macro)]
22

33
use std::pat::pattern_type;
44

tests/ui/type/pattern_types/range_patterns.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"

tests/ui/type/pattern_types/range_patterns.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ error: layout_of(NonZero<u32>) = Layout {
3737
max_repr_align: None,
3838
unadjusted_abi_align: Align(4 bytes),
3939
}
40-
--> $DIR/range_patterns.rs:11:1
40+
--> $DIR/range_patterns.rs:10:1
4141
|
4242
LL | type X = std::num::NonZeroU32;
4343
| ^^^^^^
@@ -74,7 +74,7 @@ error: layout_of((u32) is 1..=) = Layout {
7474
max_repr_align: None,
7575
unadjusted_abi_align: Align(4 bytes),
7676
}
77-
--> $DIR/range_patterns.rs:13:1
77+
--> $DIR/range_patterns.rs:12:1
7878
|
7979
LL | type Y = pattern_type!(u32 is 1..);
8080
| ^^^^^^
@@ -182,7 +182,7 @@ error: layout_of(Option<(u32) is 1..=>) = Layout {
182182
max_repr_align: None,
183183
unadjusted_abi_align: Align(4 bytes),
184184
}
185-
--> $DIR/range_patterns.rs:15:1
185+
--> $DIR/range_patterns.rs:14:1
186186
|
187187
LL | type Z = Option<pattern_type!(u32 is 1..)>;
188188
| ^^^^^^
@@ -290,7 +290,7 @@ error: layout_of(Option<NonZero<u32>>) = Layout {
290290
max_repr_align: None,
291291
unadjusted_abi_align: Align(4 bytes),
292292
}
293-
--> $DIR/range_patterns.rs:17:1
293+
--> $DIR/range_patterns.rs:16:1
294294
|
295295
LL | type A = Option<std::num::NonZeroU32>;
296296
| ^^^^^^
@@ -334,7 +334,7 @@ error: layout_of(NonZeroU32New) = Layout {
334334
max_repr_align: None,
335335
unadjusted_abi_align: Align(4 bytes),
336336
}
337-
--> $DIR/range_patterns.rs:19:1
337+
--> $DIR/range_patterns.rs:18:1
338338
|
339339
LL | struct NonZeroU32New(pattern_type!(u32 is 1..));
340340
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/type/pattern_types/range_patterns_inherent_impls.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//! check that pattern types can have traits implemented for them if

tests/ui/type/pattern_types/range_patterns_inherent_impls.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0390]: cannot define inherent `impl` for primitive types outside of `core`
2-
--> $DIR/range_patterns_inherent_impls.rs:13:1
2+
--> $DIR/range_patterns_inherent_impls.rs:12:1
33
|
44
LL | impl Y {
55
| ^^^^^^
66
|
77
= help: consider moving this inherent impl into `core` if possible
88
help: alternatively add `#[rustc_allow_incoherent_impl]` to the relevant impl items
9-
--> $DIR/range_patterns_inherent_impls.rs:15:5
9+
--> $DIR/range_patterns_inherent_impls.rs:14:5
1010
|
1111
LL | fn foo() {}
1212
| ^^^^^^^^

tests/ui/type/pattern_types/range_patterns_trait_impls.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//! check that pattern types can have local traits

tests/ui/type/pattern_types/range_patterns_trait_impls2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//! check that pattern types can have local traits

tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
2-
--> $DIR/range_patterns_trait_impls2.rs:13:1
2+
--> $DIR/range_patterns_trait_impls2.rs:12:1
33
|
44
LL | impl Eq for Y {}
55
| ^^^^^^^^^^^^-

tests/ui/type/pattern_types/range_patterns_unusable.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//! Some practical niche checks.

tests/ui/type/pattern_types/range_patterns_unusable.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2-
--> $DIR/range_patterns_unusable.rs:14:35
2+
--> $DIR/range_patterns_unusable.rs:13:35
33
|
44
LL | let _: Option<u32> = unsafe { std::mem::transmute(z) };
55
| ^^^^^^^^^^^^^^^^^^^

tests/ui/type/pattern_types/range_patterns_unusable_math.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54

65
//! check that pattern types don't have an `Add` impl.

tests/ui/type/pattern_types/range_patterns_unusable_math.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0369]: cannot add `u32` to `(u32) is 1..=`
2-
--> $DIR/range_patterns_unusable_math.rs:15:15
2+
--> $DIR/range_patterns_unusable_math.rs:14:15
33
|
44
LL | let x = x + 1_u32;
55
| - ^ ----- u32

tests/ui/type/pattern_types/range_patterns_usage.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(pattern_types, rustc_attrs)]
2-
#![feature(core_pattern_type)]
3-
#![feature(core_pattern_types)]
2+
#![feature(pattern_type_macro)]
43
#![allow(incomplete_features)]
54
//@ check-pass
65

tests/ui/type/pattern_types/unimplemented_pat.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! This test ensures we do not ICE for unimplemented
22
//! patterns unless the feature gate is enabled.
33
4-
#![feature(core_pattern_type)]
5-
#![feature(core_pattern_types)]
4+
#![feature(pattern_type_macro)]
65

76
use std::pat::pattern_type;
87

tests/ui/type/pattern_types/unimplemented_pat.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: pattern types are unstable
2-
--> $DIR/unimplemented_pat.rs:9:15
2+
--> $DIR/unimplemented_pat.rs:8:15
33
|
44
LL | type Always = pattern_type!(Option<u32> is Some(_));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | type Always = pattern_type!(Option<u32> is Some(_));
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: pattern types are unstable
12-
--> $DIR/unimplemented_pat.rs:12:16
12+
--> $DIR/unimplemented_pat.rs:11:16
1313
|
1414
LL | type Binding = pattern_type!(Option<u32> is x);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/unpretty/expanded-exhaustive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(builtin_syntax)]
99
#![feature(concat_idents)]
1010
#![feature(const_trait_impl)]
11-
#![feature(core_pattern_type)]
1211
#![feature(decl_macro)]
1312
#![feature(deref_patterns)]
1413
#![feature(explicit_tail_calls)]
@@ -18,6 +17,7 @@
1817
#![feature(never_patterns)]
1918
#![feature(never_type)]
2019
#![feature(pattern_types)]
20+
#![feature(pattern_type_macro)]
2121
#![feature(prelude_import)]
2222
#![feature(specialization)]
2323
#![feature(trace_macros)]

0 commit comments

Comments
 (0)