Rollup merge of #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 #128987
This commit is contained in:
León Orell Valerian Liehr 2024-12-05 07:29:56 +01:00 committed by GitHub
commit 44174d9213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 53 additions and 74 deletions

View File

@ -345,7 +345,7 @@ pub mod net;
pub mod option;
pub mod panic;
pub mod panicking;
#[unstable(feature = "core_pattern_types", issue = "123646")]
#[unstable(feature = "pattern_type_macro", issue = "123646")]
pub mod pat;
pub mod pin;
#[unstable(feature = "random", issue = "130703")]

View File

@ -6,7 +6,7 @@
/// ```
#[macro_export]
#[rustc_builtin_macro(pattern_type)]
#[unstable(feature = "core_pattern_type", issue = "123646")]
#[unstable(feature = "pattern_type_macro", issue = "123646")]
macro_rules! pattern_type {
($($arg:tt)*) => {
/* compiler built-in */

View File

@ -589,7 +589,7 @@ pub mod net;
pub mod num;
pub mod os;
pub mod panic;
#[unstable(feature = "core_pattern_types", issue = "123646")]
#[unstable(feature = "pattern_type_macro", issue = "123646")]
pub mod pat;
pub mod path;
#[unstable(feature = "anonymous_pipe", issue = "127154")]

View File

@ -3936,17 +3936,8 @@ The tracking issue for this feature is: [#117693]
"##,
},
Lint {
label: "core_pattern_type",
description: r##"# `core_pattern_type`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "core_pattern_types",
description: r##"# `core_pattern_types`
label: "pattern_type_macro",
description: r##"# `pattern_type_macro`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.

View File

@ -4,8 +4,7 @@
//@ compile-flags: -Csymbol-mangling-version=v0 -Copt-level=0 --crate-type=lib
#![feature(pattern_types)]
#![feature(core_pattern_types)]
#![feature(core_pattern_type)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

@ -1,4 +1,4 @@
#![feature(pattern_types, core_pattern_type)]
#![feature(pattern_types, pattern_type_macro)]
#![allow(internal_features)]
type Pat<const START: u32, const END: u32> =

View File

@ -1,6 +1,5 @@
#![feature(pattern_types)]
#![feature(core_pattern_types)]
#![feature(core_pattern_type)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

@ -1,5 +1,5 @@
error[E0586]: inclusive range with no end
--> $DIR/bad_pat.rs:7:43
--> $DIR/bad_pat.rs:6:43
|
LL | type NonNullU32_2 = pattern_type!(u32 is 1..=);
| ^^^
@ -12,7 +12,7 @@ LL + type NonNullU32_2 = pattern_type!(u32 is 1..);
|
error[E0586]: inclusive range with no end
--> $DIR/bad_pat.rs:9:40
--> $DIR/bad_pat.rs:8:40
|
LL | type Positive2 = pattern_type!(i32 is 0..=);
| ^^^
@ -25,7 +25,7 @@ LL + type Positive2 = pattern_type!(i32 is 0..);
|
error: wildcard patterns are not permitted for pattern types
--> $DIR/bad_pat.rs:11:33
--> $DIR/bad_pat.rs:10:33
|
LL | type Wild = pattern_type!(() is _);
| ^

View File

@ -1,8 +1,7 @@
//@ check-pass
#![feature(pattern_types)]
#![feature(core_pattern_types)]
#![feature(core_pattern_type)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

@ -1,8 +1,7 @@
//! Check that pattern types don't implement traits of their base automatically
#![feature(pattern_types)]
#![feature(core_pattern_types)]
#![feature(core_pattern_type)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

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

View File

@ -3,12 +3,12 @@
use std::pat::pattern_type;
type NonNullU32 = pattern_type!(u32 is 1..);
//~^ use of unstable library feature `core_pattern_type`
//~^ use of unstable library feature `pattern_type_macro`
type Percent = pattern_type!(u32 is 0..=100);
//~^ use of unstable library feature `core_pattern_type`
//~^ use of unstable library feature `pattern_type_macro`
type Negative = pattern_type!(i32 is ..=0);
//~^ use of unstable library feature `core_pattern_type`
//~^ use of unstable library feature `pattern_type_macro`
type Positive = pattern_type!(i32 is 0..);
//~^ use of unstable library feature `core_pattern_type`
//~^ use of unstable library feature `pattern_type_macro`
type Always = pattern_type!(Option<u32> is Some(_));
//~^ use of unstable library feature `core_pattern_type`
//~^ use of unstable library feature `pattern_type_macro`

View File

@ -1,51 +1,51 @@
error[E0658]: use of unstable library feature `core_pattern_type`
error[E0658]: use of unstable library feature `pattern_type_macro`
--> $DIR/feature-gate-pattern_types.rs:5:19
|
LL | type NonNullU32 = pattern_type!(u32 is 1..);
| ^^^^^^^^^^^^
|
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
= help: add `#![feature(pattern_type_macro)]` 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[E0658]: use of unstable library feature `core_pattern_type`
error[E0658]: use of unstable library feature `pattern_type_macro`
--> $DIR/feature-gate-pattern_types.rs:7:16
|
LL | type Percent = pattern_type!(u32 is 0..=100);
| ^^^^^^^^^^^^
|
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
= help: add `#![feature(pattern_type_macro)]` 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[E0658]: use of unstable library feature `core_pattern_type`
error[E0658]: use of unstable library feature `pattern_type_macro`
--> $DIR/feature-gate-pattern_types.rs:9:17
|
LL | type Negative = pattern_type!(i32 is ..=0);
| ^^^^^^^^^^^^
|
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
= help: add `#![feature(pattern_type_macro)]` 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[E0658]: use of unstable library feature `core_pattern_type`
error[E0658]: use of unstable library feature `pattern_type_macro`
--> $DIR/feature-gate-pattern_types.rs:11:17
|
LL | type Positive = pattern_type!(i32 is 0..);
| ^^^^^^^^^^^^
|
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
= help: add `#![feature(pattern_type_macro)]` 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[E0658]: use of unstable library feature `core_pattern_type`
error[E0658]: use of unstable library feature `pattern_type_macro`
--> $DIR/feature-gate-pattern_types.rs:13:15
|
LL | type Always = pattern_type!(Option<u32> is Some(_));
| ^^^^^^^^^^^^
|
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
= help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
= help: add `#![feature(pattern_type_macro)]` 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 5 previous errors

View File

@ -1,7 +1,7 @@
//@ compile-flags: -Zno-analysis
//@ check-pass
#![feature(core_pattern_type)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

@ -1,4 +1,4 @@
#![feature(core_pattern_type, core_pattern_types)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"

View File

@ -37,7 +37,7 @@ error: layout_of(NonZero<u32>) = Layout {
max_repr_align: None,
unadjusted_abi_align: Align(4 bytes),
}
--> $DIR/range_patterns.rs:11:1
--> $DIR/range_patterns.rs:10:1
|
LL | type X = std::num::NonZeroU32;
| ^^^^^^
@ -74,7 +74,7 @@ error: layout_of((u32) is 1..=) = Layout {
max_repr_align: None,
unadjusted_abi_align: Align(4 bytes),
}
--> $DIR/range_patterns.rs:13:1
--> $DIR/range_patterns.rs:12:1
|
LL | type Y = pattern_type!(u32 is 1..);
| ^^^^^^
@ -182,7 +182,7 @@ error: layout_of(Option<(u32) is 1..=>) = Layout {
max_repr_align: None,
unadjusted_abi_align: Align(4 bytes),
}
--> $DIR/range_patterns.rs:15:1
--> $DIR/range_patterns.rs:14:1
|
LL | type Z = Option<pattern_type!(u32 is 1..)>;
| ^^^^^^
@ -290,7 +290,7 @@ error: layout_of(Option<NonZero<u32>>) = Layout {
max_repr_align: None,
unadjusted_abi_align: Align(4 bytes),
}
--> $DIR/range_patterns.rs:17:1
--> $DIR/range_patterns.rs:16:1
|
LL | type A = Option<std::num::NonZeroU32>;
| ^^^^^^
@ -334,7 +334,7 @@ error: layout_of(NonZeroU32New) = Layout {
max_repr_align: None,
unadjusted_abi_align: Align(4 bytes),
}
--> $DIR/range_patterns.rs:19:1
--> $DIR/range_patterns.rs:18:1
|
LL | struct NonZeroU32New(pattern_type!(u32 is 1..));
| ^^^^^^^^^^^^^^^^^^^^

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//! check that pattern types can have traits implemented for them if

View File

@ -1,12 +1,12 @@
error[E0390]: cannot define inherent `impl` for primitive types outside of `core`
--> $DIR/range_patterns_inherent_impls.rs:13:1
--> $DIR/range_patterns_inherent_impls.rs:12:1
|
LL | impl Y {
| ^^^^^^
|
= help: consider moving this inherent impl into `core` if possible
help: alternatively add `#[rustc_allow_incoherent_impl]` to the relevant impl items
--> $DIR/range_patterns_inherent_impls.rs:15:5
--> $DIR/range_patterns_inherent_impls.rs:14:5
|
LL | fn foo() {}
| ^^^^^^^^

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//! check that pattern types can have local traits

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//! check that pattern types can have local traits

View File

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

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//! Some practical niche checks.

View File

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

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//! check that pattern types don't have an `Add` impl.

View File

@ -1,5 +1,5 @@
error[E0369]: cannot add `u32` to `(u32) is 1..=`
--> $DIR/range_patterns_unusable_math.rs:15:15
--> $DIR/range_patterns_unusable_math.rs:14:15
|
LL | let x = x + 1_u32;
| - ^ ----- u32

View File

@ -1,6 +1,5 @@
#![feature(pattern_types, rustc_attrs)]
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]
//@ check-pass

View File

@ -1,8 +1,7 @@
//! This test ensures we do not ICE for unimplemented
//! patterns unless the feature gate is enabled.
#![feature(core_pattern_type)]
#![feature(core_pattern_types)]
#![feature(pattern_type_macro)]
use std::pat::pattern_type;

View File

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

View File

@ -8,7 +8,6 @@
#![feature(builtin_syntax)]
#![feature(concat_idents)]
#![feature(const_trait_impl)]
#![feature(core_pattern_type)]
#![feature(decl_macro)]
#![feature(deref_patterns)]
#![feature(explicit_tail_calls)]
@ -18,6 +17,7 @@
#![feature(never_patterns)]
#![feature(never_type)]
#![feature(pattern_types)]
#![feature(pattern_type_macro)]
#![feature(prelude_import)]
#![feature(specialization)]
#![feature(trace_macros)]

View File

@ -9,7 +9,6 @@
#![feature(builtin_syntax)]
#![feature(concat_idents)]
#![feature(const_trait_impl)]
#![feature(core_pattern_type)]
#![feature(decl_macro)]
#![feature(deref_patterns)]
#![feature(explicit_tail_calls)]
@ -19,6 +18,7 @@
#![feature(never_patterns)]
#![feature(never_type)]
#![feature(pattern_types)]
#![feature(pattern_type_macro)]
#![feature(prelude_import)]
#![feature(specialization)]
#![feature(trace_macros)]