diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
commit | 2ff14448863ac1a1dd9533461708e29aae170c2d (patch) | |
tree | 85b9fea2bbfe3f06473cfa381eed11f273b57c5c /src/test/ui/feature-gates | |
parent | Adding debian version 1.64.0+dfsg1-1. (diff) | |
download | rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip |
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/feature-gates')
31 files changed, 228 insertions, 194 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs new file mode 100644 index 000000000..f73bf579f --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs @@ -0,0 +1,7 @@ +#[collapse_debuginfo] +//~^ ERROR the `#[collapse_debuginfo]` attribute is an experimental feature +macro_rules! foo { + ($e:expr) => { $e } +} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr new file mode 100644 index 000000000..2cbde893a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr @@ -0,0 +1,12 @@ +error[E0658]: the `#[collapse_debuginfo]` attribute is an experimental feature + --> $DIR/feature-gate-collapse_debuginfo.rs:1:1 + | +LL | #[collapse_debuginfo] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #100758 <https://github.com/rust-lang/rust/issues/100758> for more information + = help: add `#![feature(collapse_debuginfo)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index f8349391a..5ced344f1 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched | LL | let _x = if let Ok(_x) = foo() { _x } else { todo!() }; | +++++++++++ +++++++++++++++++++++++ -help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched +help: alternatively, you might want to use let else to handle the variant that isn't matched | LL | let Ok(_x) = foo() else { todo!() }; | ++++++++++++++++ diff --git a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr index 49eede479..56123a983 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr +++ b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr @@ -1,33 +1,24 @@ -error[E0658]: using `_` for array lengths is unstable +error: in expressions, `_` can only be used on the left-hand side of an assignment --> $DIR/feature-gate-generic_arg_infer.rs:11:27 | LL | let _x: [u8; 3] = [0; _]; - | ^ - | - = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information - = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + | ^ `_` not allowed here error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/feature-gate-generic_arg_infer.rs:11:27 + --> $DIR/feature-gate-generic_arg_infer.rs:14:18 | -LL | let _x: [u8; 3] = [0; _]; - | ^ `_` not allowed here +LL | let _y: [u8; _] = [0; 3]; + | ^ `_` not allowed here error[E0658]: using `_` for array lengths is unstable --> $DIR/feature-gate-generic_arg_infer.rs:14:18 | LL | let _y: [u8; _] = [0; 3]; - | ^ + | ^ help: consider specifying the array length: `3` | = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable -error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/feature-gate-generic_arg_infer.rs:14:18 - | -LL | let _y: [u8; _] = [0; 3]; - | ^ `_` not allowed here - error[E0747]: type provided when a constant was expected --> $DIR/feature-gate-generic_arg_infer.rs:20:20 | @@ -37,6 +28,15 @@ LL | let _x = foo::<_>([1,2]); = help: const arguments cannot yet be inferred with `_` = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable +error[E0658]: using `_` for array lengths is unstable + --> $DIR/feature-gate-generic_arg_infer.rs:11:27 + | +LL | let _x: [u8; 3] = [0; _]; + | ^ + | + = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information + = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + error: aborting due to 5 previous errors Some errors have detailed explanations: E0658, E0747. diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs deleted file mode 100644 index c5c134514..000000000 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::ops::Deref; - -trait PointerFamily<U> { - type Pointer<T>: Deref<Target = T>; - //~^ ERROR generic associated types are unstable - type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; - //~^ ERROR generic associated types are unstable - //~| ERROR where clauses on associated types are unstable -} - -struct Foo; - -impl PointerFamily<u32> for Foo { - type Pointer<Usize> = Box<Usize>; - //~^ ERROR generic associated types are unstable - type Pointer2<U32> = Box<U32>; - //~^ ERROR generic associated types are unstable - //~| ERROR the trait bound `U32: Clone` is not satisfied -} - -trait Bar { - type Assoc where Self: Sized; - //~^ ERROR where clauses on associated types are unstable -} - -impl Bar for Foo { - type Assoc = Foo where Self: Sized; - //~^ ERROR where clauses on associated types are unstable -} - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr deleted file mode 100644 index 12a40ff0a..000000000 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr +++ /dev/null @@ -1,78 +0,0 @@ -error[E0658]: generic associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:4:5 - | -LL | type Pointer<T>: Deref<Target = T>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: generic associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:6:5 - | -LL | type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: where clauses on associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:6:5 - | -LL | type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: generic associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:14:5 - | -LL | type Pointer<Usize> = Box<Usize>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: generic associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:16:5 - | -LL | type Pointer2<U32> = Box<U32>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: where clauses on associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:22:5 - | -LL | type Assoc where Self: Sized; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: where clauses on associated types are unstable - --> $DIR/feature-gate-generic_associated_types.rs:27:5 - | -LL | type Assoc = Foo where Self: Sized; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0277]: the trait bound `U32: Clone` is not satisfied - --> $DIR/feature-gate-generic_associated_types.rs:16:26 - | -LL | type Pointer2<U32> = Box<U32>; - | ^^^^^^^^ the trait `Clone` is not implemented for `U32` - | -help: consider restricting type parameter `U32` - | -LL | type Pointer2<U32: std::clone::Clone> = Box<U32>; - | +++++++++++++++++++ - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0277, E0658. -For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs index 258b8cd35..7842d44ac 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs +++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // This feature doesn't *currently* fire on any specific code; it's just a // behavior change. Future changes might. #[rustc_error] //~ the diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr index 6a5eba38c..bb1622628 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr +++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr @@ -1,5 +1,5 @@ error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable - --> $DIR/feature-gate-generic_associated_types_extended.rs:5:1 + --> $DIR/feature-gate-generic_associated_types_extended.rs:3:1 | LL | #[rustc_error] | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.rs b/src/test/ui/feature-gates/feature-gate-label_break_value.rs deleted file mode 100644 index 6fc38f455..000000000 --- a/src/test/ui/feature-gates/feature-gate-label_break_value.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub fn main() { - 'a: { //~ ERROR labels on blocks are unstable - break 'a; - } -} diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr b/src/test/ui/feature-gates/feature-gate-label_break_value.stderr deleted file mode 100644 index 4b43fdc59..000000000 --- a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: labels on blocks are unstable - --> $DIR/feature-gate-label_break_value.rs:2:5 - | -LL | 'a: { - | ^^ - | - = note: see issue #48594 <https://github.com/rust-lang/rust/issues/48594> for more information - = help: add `#![feature(label_break_value)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-let_else.rs b/src/test/ui/feature-gates/feature-gate-let_else.rs deleted file mode 100644 index 3f04a9dab..000000000 --- a/src/test/ui/feature-gates/feature-gate-let_else.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - let Some(x) = Some(1) else { //~ ERROR `let...else` statements are unstable - return; - }; -} diff --git a/src/test/ui/feature-gates/feature-gate-let_else.stderr b/src/test/ui/feature-gates/feature-gate-let_else.stderr deleted file mode 100644 index 862526041..000000000 --- a/src/test/ui/feature-gates/feature-gate-let_else.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0658]: `let...else` statements are unstable - --> $DIR/feature-gate-let_else.rs:2:5 - | -LL | / let Some(x) = Some(1) else { -LL | | return; -LL | | }; - | |______^ - | - = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information - = help: add `#![feature(let_else)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs index 29a6e1f8a..9b646060a 100644 --- a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs +++ b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs @@ -21,7 +21,7 @@ fn main() { Foo::A => {} Foo::B => {} } - //~^^^^ ERROR non-exhaustive patterns: `C` not covered + //~^^^^ ERROR non-exhaustive patterns: `Foo::C` not covered match Foo::A { Foo::A => {} diff --git a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr index dbeef6c2d..3de08e215 100644 --- a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr +++ b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr @@ -99,11 +99,11 @@ LL | #[warn(non_exhaustive_omitted_patterns)] = note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information = help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable -error[E0004]: non-exhaustive patterns: `C` not covered +error[E0004]: non-exhaustive patterns: `Foo::C` not covered --> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:20:11 | LL | match Foo::A { - | ^^^^^^ pattern `C` not covered + | ^^^^^^ pattern `Foo::C` not covered | note: `Foo` defined here --> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:12:15 @@ -116,7 +116,7 @@ LL | A, B, C, help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Foo::B => {} -LL + C => todo!() +LL + Foo::C => todo!() | error: aborting due to previous error; 10 warnings emitted diff --git a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr index 72cb4cc84..d76c697fe 100644 --- a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr +++ b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr @@ -13,10 +13,10 @@ LL | trait NonObjectSafe1: Sized {} | this trait cannot be made into an object... error[E0038]: the trait `NonObjectSafe2` cannot be made into an object - --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:36 + --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:45 | LL | fn return_non_object_safe_ref() -> &'static dyn NonObjectSafe2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe2` cannot be made into an object + | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe2` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $DIR/feature-gate-object_safe_for_dispatch.rs:7:8 @@ -50,10 +50,10 @@ LL | fn foo<T>(&self); = help: consider moving `foo` to another trait error[E0038]: the trait `NonObjectSafe4` cannot be made into an object - --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:35 + --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:47 | LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` cannot be made into an object + | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $DIR/feature-gate-object_safe_for_dispatch.rs:15:22 diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs index 518aa20dd..fc47a9061 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs @@ -1,8 +1,12 @@ +// only-x86 #[link(name = "foo")] extern "C" { #[link_ordinal(42)] - //~^ ERROR: the `#[link_ordinal]` attribute is an experimental feature + //~^ ERROR: `#[link_ordinal]` is unstable on x86 fn foo(); + #[link_ordinal(5)] + //~^ ERROR: `#[link_ordinal]` is unstable on x86 + static mut imported_variable: i32; } fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr index dbee5f316..0e900760d 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr @@ -1,5 +1,5 @@ -error[E0658]: the `#[link_ordinal]` attribute is an experimental feature - --> $DIR/feature-gate-raw-dylib-2.rs:3:5 +error[E0658]: `#[link_ordinal]` is unstable on x86 + --> $DIR/feature-gate-raw-dylib-2.rs:4:5 | LL | #[link_ordinal(42)] | ^^^^^^^^^^^^^^^^^^^ @@ -7,6 +7,15 @@ LL | #[link_ordinal(42)] = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information = help: add `#![feature(raw_dylib)]` to the crate attributes to enable -error: aborting due to previous error +error[E0658]: `#[link_ordinal]` is unstable on x86 + --> $DIR/feature-gate-raw-dylib-2.rs:7:5 + | +LL | #[link_ordinal(5)] + | ^^^^^^^^^^^^^^^^^^ + | + = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information + = help: add `#![feature(raw_dylib)]` to the crate attributes to enable + +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-raw-dylib-import-name-type.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs new file mode 100644 index 000000000..295f502d6 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs @@ -0,0 +1,8 @@ +// only-windows +// only-x86 +#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] +//~^ ERROR link kind `raw-dylib` is unstable on x86 +//~| ERROR import name type is unstable +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr new file mode 100644 index 000000000..d6b165b76 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr @@ -0,0 +1,21 @@ +error[E0658]: link kind `raw-dylib` is unstable on x86 + --> $DIR/feature-gate-raw-dylib-import-name-type.rs:3:29 + | +LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] + | ^^^^^^^^^^^ + | + = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information + = help: add `#![feature(raw_dylib)]` to the crate attributes to enable + +error[E0658]: import name type is unstable + --> $DIR/feature-gate-raw-dylib-import-name-type.rs:3:61 + | +LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] + | ^^^^^^^^^^^ + | + = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information + = help: add `#![feature(raw_dylib)]` to the crate attributes to enable + +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-raw-dylib.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs index f894f517b..291cca8fd 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib.rs +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs @@ -1,6 +1,7 @@ // only-windows +// only-x86 #[link(name = "foo", kind = "raw-dylib")] -//~^ ERROR: link kind `raw-dylib` is unstable +//~^ ERROR: link kind `raw-dylib` is unstable on x86 extern "C" {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr index ca7a61f64..f02241e49 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr @@ -1,5 +1,5 @@ -error[E0658]: link kind `raw-dylib` is unstable - --> $DIR/feature-gate-raw-dylib.rs:2:29 +error[E0658]: link kind `raw-dylib` is unstable on x86 + --> $DIR/feature-gate-raw-dylib.rs:3:29 | LL | #[link(name = "foo", kind = "raw-dylib")] | ^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.rs b/src/test/ui/feature-gates/feature-gate-register_attr.rs deleted file mode 100644 index 36dce2aa7..000000000 --- a/src/test/ui/feature-gates/feature-gate-register_attr.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![register_attr(attr)] //~ ERROR the `#[register_attr]` attribute is an experimental feature - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.stderr b/src/test/ui/feature-gates/feature-gate-register_attr.stderr deleted file mode 100644 index 8ca3845d2..000000000 --- a/src/test/ui/feature-gates/feature-gate-register_attr.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[register_attr]` attribute is an experimental feature - --> $DIR/feature-gate-register_attr.rs:1:1 - | -LL | #![register_attr(attr)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #66080 <https://github.com/rust-lang/rust/issues/66080> for more information - = help: add `#![feature(register_attr)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs new file mode 100644 index 000000000..de7966c66 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs @@ -0,0 +1,5 @@ +trait Foo { + fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return +} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr new file mode 100644 index 000000000..36177bbe1 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr @@ -0,0 +1,12 @@ +error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return + --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:2:17 + | +LL | fn bar() -> impl Sized; + | ^^^^^^^^^^ + | + = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0562`. diff --git a/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs new file mode 100644 index 000000000..46dc3f6cc --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs @@ -0,0 +1,4 @@ +#![crate_type = "bin"] + +#[unix_sigpipe = "inherit"] //~ the `#[unix_sigpipe]` attribute is an experimental feature +fn main () {} diff --git a/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr new file mode 100644 index 000000000..cf3284467 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr @@ -0,0 +1,12 @@ +error[E0658]: the `#[unix_sigpipe]` attribute is an experimental feature + --> $DIR/feature-gate-unix_sigpipe.rs:3:1 + | +LL | #[unix_sigpipe = "inherit"] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #97889 <https://github.com/rust-lang/rust/issues/97889> for more information + = help: add `#![feature(unix_sigpipe)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs new file mode 100644 index 000000000..49f1cba71 --- /dev/null +++ b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs @@ -0,0 +1,30 @@ +// check-fail +// This file is used to test the behavior of the early-pass syntax warnings. +// If macro syntax is stabilized, replace with a different unstable syntax. + +macro a() {} +//~^ ERROR: `macro` is experimental + +#[cfg(FALSE)] +macro b() {} + +macro_rules! identity { + ($($x:tt)*) => ($($x)*); +} + +identity! { + macro c() {} + //~^ ERROR: `macro` is experimental +} + +#[cfg(FALSE)] +identity! { + macro d() {} // No error +} + +identity! { + #[cfg(FALSE)] + macro e() {} +} + +fn main() {} diff --git a/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr new file mode 100644 index 000000000..49550d811 --- /dev/null +++ b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr @@ -0,0 +1,21 @@ +error[E0658]: `macro` is experimental + --> $DIR/soft-syntax-gates-with-errors.rs:5:1 + | +LL | macro a() {} + | ^^^^^^^^^^^^ + | + = note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information + = help: add `#![feature(decl_macro)]` to the crate attributes to enable + +error[E0658]: `macro` is experimental + --> $DIR/soft-syntax-gates-with-errors.rs:16:5 + | +LL | macro c() {} + | ^^^^^^^^^^^^ + | + = note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information + = help: add `#![feature(decl_macro)]` to the crate attributes to enable + +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/soft-syntax-gates-without-errors.rs b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs new file mode 100644 index 000000000..ca4ad2320 --- /dev/null +++ b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs @@ -0,0 +1,26 @@ +// check-pass +// This file is used to test the behavior of the early-pass syntax warnings. +// If macro syntax is stabilized, replace with a different unstable syntax. + +#[cfg(FALSE)] +macro b() {} +//~^ WARN: `macro` is experimental +//~| WARN: unstable syntax + +macro_rules! identity { + ($($x:tt)*) => ($($x)*); +} + +#[cfg(FALSE)] +identity! { + macro d() {} // No error +} + +identity! { + #[cfg(FALSE)] + macro e() {} + //~^ WARN: `macro` is experimental + //~| WARN: unstable syntax +} + +fn main() {} diff --git a/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr new file mode 100644 index 000000000..3d9c22e54 --- /dev/null +++ b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr @@ -0,0 +1,24 @@ +warning: `macro` is experimental + --> $DIR/soft-syntax-gates-without-errors.rs:6:1 + | +LL | macro b() {} + | ^^^^^^^^^^^^ + | + = note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information + = help: add `#![feature(decl_macro)]` to the crate attributes to enable + = warning: unstable syntax can change at any point in the future, causing a hard error! + = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> + +warning: `macro` is experimental + --> $DIR/soft-syntax-gates-without-errors.rs:21:5 + | +LL | macro e() {} + | ^^^^^^^^^^^^ + | + = note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information + = help: add `#![feature(decl_macro)]` to the crate attributes to enable + = warning: unstable syntax can change at any point in the future, causing a hard error! + = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> + +warning: 2 warnings emitted + |