From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/feature-gates/bench.stderr | 2 +- src/test/ui/feature-gates/feature-gate-asm_sym.rs | 19 ------ .../ui/feature-gates/feature-gate-asm_sym.stderr | 21 ------ .../feature-gate-collapse_debuginfo.rs | 7 ++ .../feature-gate-collapse_debuginfo.stderr | 12 ++++ ...ure-gate-default_type_parameter_fallback.stderr | 2 +- .../feature-gate-exhaustive-patterns.stderr | 2 +- .../feature-gate-generic_arg_infer.normal.stderr | 30 ++++----- .../feature-gate-generic_associated_types.rs | 31 --------- .../feature-gate-generic_associated_types.stderr | 78 ---------------------- ...ature-gate-generic_associated_types_extended.rs | 2 - ...e-gate-generic_associated_types_extended.stderr | 2 +- .../feature-gate-label_break_value.rs | 5 -- .../feature-gate-label_break_value.stderr | 12 ---- src/test/ui/feature-gates/feature-gate-let_else.rs | 5 -- .../ui/feature-gates/feature-gate-let_else.stderr | 14 ---- ...re-gate-non_exhaustive_omitted_patterns_lint.rs | 2 +- ...ate-non_exhaustive_omitted_patterns_lint.stderr | 8 +-- .../feature-gate-object_safe_for_dispatch.stderr | 8 +-- .../ui/feature-gates/feature-gate-raw-dylib-2.rs | 6 +- .../feature-gates/feature-gate-raw-dylib-2.stderr | 15 ++++- .../feature-gate-raw-dylib-import-name-type.rs | 8 +++ .../feature-gate-raw-dylib-import-name-type.stderr | 21 ++++++ .../ui/feature-gates/feature-gate-raw-dylib.rs | 3 +- .../ui/feature-gates/feature-gate-raw-dylib.stderr | 4 +- .../ui/feature-gates/feature-gate-register_attr.rs | 3 - .../feature-gate-register_attr.stderr | 12 ---- .../ui/feature-gates/feature-gate-repr-simd.stderr | 2 +- ...ure-gate-return_position_impl_trait_in_trait.rs | 18 +++++ ...gate-return_position_impl_trait_in_trait.stderr | 30 +++++++++ .../feature-gate-strict_provenance.stderr | 2 +- .../feature-gate-test_unstable_lint.stderr | 2 +- .../ui/feature-gates/feature-gate-unix_sigpipe.rs | 4 ++ .../feature-gates/feature-gate-unix_sigpipe.stderr | 12 ++++ ...ssue-43106-gating-of-builtin-attrs-error.stderr | 2 +- .../feature-gates/soft-syntax-gates-with-errors.rs | 30 +++++++++ .../soft-syntax-gates-with-errors.stderr | 21 ++++++ .../soft-syntax-gates-without-errors.rs | 26 ++++++++ .../soft-syntax-gates-without-errors.stderr | 24 +++++++ 39 files changed, 266 insertions(+), 241 deletions(-) delete mode 100644 src/test/ui/feature-gates/feature-gate-asm_sym.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-asm_sym.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs create mode 100644 src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr delete mode 100644 src/test/ui/feature-gates/feature-gate-generic_associated_types.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr delete mode 100644 src/test/ui/feature-gates/feature-gate-label_break_value.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-label_break_value.stderr delete mode 100644 src/test/ui/feature-gates/feature-gate-let_else.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-let_else.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs create mode 100644 src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr delete mode 100644 src/test/ui/feature-gates/feature-gate-register_attr.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-register_attr.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs create mode 100644 src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs create mode 100644 src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr create mode 100644 src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs create mode 100644 src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr create mode 100644 src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs create mode 100644 src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr (limited to 'src/test/ui/feature-gates') diff --git a/src/test/ui/feature-gates/bench.stderr b/src/test/ui/feature-gates/bench.stderr index 168ac9257..5f0aaf925 100644 --- a/src/test/ui/feature-gates/bench.stderr +++ b/src/test/ui/feature-gates/bench.stderr @@ -4,9 +4,9 @@ error: use of unstable library feature 'test': `bench` is a part of custom test LL | #[bench] | ^^^^^ | - = note: `#[deny(soft_unstable)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #64266 + = note: `#[deny(soft_unstable)]` on by default error: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable --> $DIR/bench.rs:7:5 diff --git a/src/test/ui/feature-gates/feature-gate-asm_sym.rs b/src/test/ui/feature-gates/feature-gate-asm_sym.rs deleted file mode 100644 index 0de6b3abb..000000000 --- a/src/test/ui/feature-gates/feature-gate-asm_sym.rs +++ /dev/null @@ -1,19 +0,0 @@ -// only-x86_64 - -use std::arch::asm; - -fn bar() {} - -fn foo() { - unsafe { - asm!("mov eax, {}", sym bar::); - //~^ ERROR sym operands for inline assembly are unstable - } -} - -fn main() { - unsafe { - asm!("mov eax, {}", sym foo::<0>); - //~^ ERROR sym operands for inline assembly are unstable - } -} diff --git a/src/test/ui/feature-gates/feature-gate-asm_sym.stderr b/src/test/ui/feature-gates/feature-gate-asm_sym.stderr deleted file mode 100644 index d4b16f60b..000000000 --- a/src/test/ui/feature-gates/feature-gate-asm_sym.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0658]: sym operands for inline assembly are unstable - --> $DIR/feature-gate-asm_sym.rs:9:29 - | -LL | asm!("mov eax, {}", sym bar::); - | ^^^^^^^^^^^^ - | - = note: see issue #93333 for more information - = help: add `#![feature(asm_sym)]` to the crate attributes to enable - -error[E0658]: sym operands for inline assembly are unstable - --> $DIR/feature-gate-asm_sym.rs:16:29 - | -LL | asm!("mov eax, {}", sym foo::<0>); - | ^^^^^^^^^^^^ - | - = note: see issue #93333 for more information - = help: add `#![feature(asm_sym)]` 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-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 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-default_type_parameter_fallback.stderr b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr index a7d5c7ac3..308de2692 100644 --- a/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr +++ b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr @@ -4,9 +4,9 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type` LL | fn avg(_: T) {} | ^^^^^ | - = note: `#[deny(invalid_type_param_default)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #36887 + = note: `#[deny(invalid_type_param_default)]` on by default error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions --> $DIR/feature-gate-default_type_parameter_fallback.rs:8:6 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 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 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 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 { - type Pointer: Deref; - //~^ ERROR generic associated types are unstable - type Pointer2: Deref where T: Clone, U: Clone; - //~^ ERROR generic associated types are unstable - //~| ERROR where clauses on associated types are unstable -} - -struct Foo; - -impl PointerFamily for Foo { - type Pointer = Box; - //~^ ERROR generic associated types are unstable - type Pointer2 = Box; - //~^ 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: Deref; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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: Deref where T: Clone, U: Clone; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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: Deref where T: Clone, U: Clone; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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 = Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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 = Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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 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 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 = Box; - | ^^^^^^^^ the trait `Clone` is not implemented for `U32` - | -help: consider restricting type parameter `U32` - | -LL | type Pointer2 = Box; - | +++++++++++++++++++ - -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 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 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..4d79ce3c6 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 @@ -4,10 +4,10 @@ warning: unknown lint: `non_exhaustive_omitted_patterns` LL | #![deny(non_exhaustive_omitted_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unknown_lints)]` on by default = note: the `non_exhaustive_omitted_patterns` lint is unstable = note: see issue #89554 for more information = help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable + = note: `#[warn(unknown_lints)]` on by default warning: unknown lint: `non_exhaustive_omitted_patterns` --> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:6:1 @@ -99,11 +99,11 @@ LL | #[warn(non_exhaustive_omitted_patterns)] = note: see issue #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 --> $DIR/feature-gate-object_safe_for_dispatch.rs:7:8 @@ -50,10 +50,10 @@ LL | fn foo(&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 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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 --> $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 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 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 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 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 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-repr-simd.stderr b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr index ae44b8020..5b1270a19 100644 --- a/src/test/ui/feature-gates/feature-gate-repr-simd.stderr +++ b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr @@ -25,9 +25,9 @@ LL | LL | #[repr(simd)] | ^^^^ | - = note: `#[deny(conflicting_repr_hints)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #68585 + = note: `#[deny(conflicting_repr_hints)]` on by default error: aborting due to 3 previous errors 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..637765fff --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs @@ -0,0 +1,18 @@ +// edition:2021 + +// async_fn_in_trait is not enough to allow use of RPITIT +#![allow(incomplete_features)] +#![feature(async_fn_in_trait)] + +trait Foo { + fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return + fn baz() -> Box; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return +} + +// Both return_position_impl_trait_in_trait and async_fn_in_trait are required for this (see also +// feature-gate-async_fn_in_trait.rs) +trait AsyncFoo { + async 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..aeabed4a6 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr @@ -0,0 +1,30 @@ +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:8:17 + | +LL | fn bar() -> impl Sized; + | ^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +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:9:21 + | +LL | fn baz() -> Box; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +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:15:23 + | +LL | async fn bar() -> impl Sized; + | ^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0562`. diff --git a/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr b/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr index 34bd240c3..751da87cc 100644 --- a/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr +++ b/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr @@ -4,10 +4,10 @@ warning: unknown lint: `fuzzy_provenance_casts` LL | #![deny(fuzzy_provenance_casts)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unknown_lints)]` on by default = note: the `fuzzy_provenance_casts` lint is unstable = note: see issue #95228 for more information = help: add `#![feature(strict_provenance)]` to the crate attributes to enable + = note: `#[warn(unknown_lints)]` on by default warning: unknown lint: `lossy_provenance_casts` --> $DIR/feature-gate-strict_provenance.rs:7:1 diff --git a/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr b/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr index a29322443..b4d6aa658 100644 --- a/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr +++ b/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr @@ -4,9 +4,9 @@ warning: unknown lint: `test_unstable_lint` LL | #![allow(test_unstable_lint)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unknown_lints)]` on by default = note: the `test_unstable_lint` lint is unstable = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable + = note: `#[warn(unknown_lints)]` on by default warning: unknown lint: `test_unstable_lint` --> $DIR/feature-gate-test_unstable_lint.rs:4:1 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 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/issue-43106-gating-of-builtin-attrs-error.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr index f94ec7d47..5a645cf4e 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr @@ -12,9 +12,9 @@ error: attribute must be of the form `#[inline]` or `#[inline(always|never)]` LL | #[inline = "2100"] fn f() { } | ^^^^^^^^^^^^^^^^^^ | - = note: `#[deny(ill_formed_attribute_input)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #57571 + = note: `#[deny(ill_formed_attribute_input)]` on by default error: `start` attribute can only be used on functions --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:119:1 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 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 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 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 + +warning: `macro` is experimental + --> $DIR/soft-syntax-gates-without-errors.rs:21:5 + | +LL | macro e() {} + | ^^^^^^^^^^^^ + | + = note: see issue #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 + +warning: 2 warnings emitted + -- cgit v1.2.3