diff options
Diffstat (limited to 'src')
9 files changed, 39 insertions, 11 deletions
diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs index dc10db177ed..53ade85bfd2 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs, staged_api, allow_internal_unstable)] +#![feature(rustc_attrs, staged_api, rustc_allow_const_fn_unstable)] #![feature(const_fn_fn_ptr_basics)] #[stable(feature = "rust1", since = "1.0.0")] @@ -8,7 +8,7 @@ const fn error(_: fn()) {} #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(since="1.0.0", feature = "mep")] -#[allow_internal_unstable(const_fn_fn_ptr_basics)] +#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] const fn compiles(_: fn()) {} fn main() {} diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr index a08d57b6043..6f89225719f 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr @@ -8,9 +8,9 @@ help: if it is not part of the public API, make this function unstably const | LL | #[rustc_const_unstable(feature = "...", issue = "...")] | -help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks +help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks | -LL | #[allow_internal_unstable(const_fn_fn_ptr_basics)] +LL | #[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] | error: aborting due to previous error diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs index b4e836bbc95..430e911aacd 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(allow_internal_unstable)] +#![feature(rustc_allow_const_fn_unstable)] #![feature(const_fn_fn_ptr_basics)] #![feature(rustc_attrs, staged_api)] @@ -7,7 +7,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(since="1.0.0", feature = "mep")] -#[allow_internal_unstable(const_fn_fn_ptr_basics)] +#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] const fn takes_fn_ptr(_: fn()) {} const FN: fn() = || (); diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr index de6a9a19269..d3017c5602a 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr @@ -24,9 +24,9 @@ help: if it is not part of the public API, make this function unstably const | LL | #[rustc_const_unstable(feature = "...", issue = "...")] | -help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks +help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks | -LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)] +LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)] | error: `foo2_gated` is not yet stable as a const fn diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr index f258deb12a9..53a59467e3d 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr @@ -24,9 +24,9 @@ help: if it is not part of the public API, make this function unstably const | LL | #[rustc_const_unstable(feature = "...", issue = "...")] | -help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks +help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks | -LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)] +LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)] | error: `foo2_gated` is not yet stable as a const fn diff --git a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs index ede969097d5..8b13f1bf278 100644 --- a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs +++ b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs @@ -2,6 +2,7 @@ // this needs a different test since this is done after expansion #[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps +//~| ERROR attribute should struct S; fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr index a1acfd55373..df7773ba4fb 100644 --- a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr +++ b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr @@ -6,6 +6,15 @@ LL | #[allow_internal_unstable()] | = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable -error: aborting due to previous error +error: attribute should be applied to a macro + --> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1 + | +LL | #[allow_internal_unstable()] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | struct S; + | --------- not a macro + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.rs b/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.rs new file mode 100644 index 00000000000..19d8fa87f55 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.rs @@ -0,0 +1,6 @@ +#![allow(unused_macros)] + +#[rustc_allow_const_fn_unstable()] //~ ERROR rustc_allow_const_fn_unstable side-steps +const fn foo() { } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr b/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr new file mode 100644 index 00000000000..a549cb64e0c --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr @@ -0,0 +1,12 @@ +error[E0658]: rustc_allow_const_fn_unstable side-steps feature gating and stability checks + --> $DIR/feature-gate-rustc-allow-const-fn-unstable.rs:3:1 + | +LL | #[rustc_allow_const_fn_unstable()] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #69399 <https://github.com/rust-lang/rust/issues/69399> for more information + = help: add `#![feature(rustc_allow_const_fn_unstable)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. |
