diff --git a/compiler/rustc_codegen_cranelift/example/arbitrary_self_types_pointers_and_wrappers.rs b/compiler/rustc_codegen_cranelift/example/arbitrary_self_types_pointers_and_wrappers.rs index 5479b0c617bfb..dddb08faa7c6e 100644 --- a/compiler/rustc_codegen_cranelift/example/arbitrary_self_types_pointers_and_wrappers.rs +++ b/compiler/rustc_codegen_cranelift/example/arbitrary_self_types_pointers_and_wrappers.rs @@ -1,6 +1,6 @@ // Adapted from rustc run-pass test suite -#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)] +#![feature(unsize, coerce_unsized, dispatch_from_dyn)] use std::marker::Unsize; use std::ops::{CoerceUnsized, Deref, DispatchFromDyn}; diff --git a/compiler/rustc_codegen_cranelift/example/mini_core.rs b/compiler/rustc_codegen_cranelift/example/mini_core.rs index a0a381638c061..b938e7678635d 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core.rs @@ -47,13 +47,6 @@ impl, U: ?Sized> DispatchFromDyn<*const U> for *const T {} impl, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {} impl, U: ?Sized> DispatchFromDyn> for Box {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} - -impl LegacyReceiver for &T {} -impl LegacyReceiver for &mut T {} -impl LegacyReceiver for Box {} - #[lang = "copy"] pub trait Copy {} diff --git a/compiler/rustc_codegen_gcc/example/arbitrary_self_types_pointers_and_wrappers.rs b/compiler/rustc_codegen_gcc/example/arbitrary_self_types_pointers_and_wrappers.rs index b299aa879740a..04ac235bc59eb 100644 --- a/compiler/rustc_codegen_gcc/example/arbitrary_self_types_pointers_and_wrappers.rs +++ b/compiler/rustc_codegen_gcc/example/arbitrary_self_types_pointers_and_wrappers.rs @@ -1,6 +1,6 @@ // Adapted from rustc run-pass test suite -#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)] +#![feature(unsize, coerce_unsized, dispatch_from_dyn)] #![feature(rustc_attrs)] #![allow(internal_features)] diff --git a/compiler/rustc_codegen_gcc/example/mini_core.rs b/compiler/rustc_codegen_gcc/example/mini_core.rs index 5a4ee0a198cef..0819f199cff85 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core.rs @@ -44,13 +44,6 @@ impl, U: ?Sized> DispatchFromDyn<*const U> for *const T {} impl, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {} impl, U: ?Sized> DispatchFromDyn> for Box {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} - -impl LegacyReceiver for &T {} -impl LegacyReceiver for &mut T {} -impl LegacyReceiver for Box {} - #[lang = "copy"] pub trait Copy {} diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 9fc527a6a3ab3..110b832ee3a2b 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4894,8 +4894,6 @@ declare_lint! { /// UB in safe code afterwards. For example: /// /// ```ignore (causes a warning) - /// #![feature(arbitrary_self_types)] - /// /// trait Trait { /// fn f(self: *const Self) /// where diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs index 4f410ec27e92c..fd3d109e5ef86 100644 --- a/library/core/src/ops/deref.rs +++ b/library/core/src/ops/deref.rs @@ -300,7 +300,7 @@ unsafe impl DerefPure for &mut T {} /// Indicates that a struct can be used as a method receiver. /// That is, a type can use this type as a type of `self`, like this: -/// ```compile_fail +/// ``` /// # // This is currently compile_fail because the compiler-side parts /// # // of arbitrary_self_types are not implemented /// use std::ops::Receiver; diff --git a/src/doc/unstable-book/src/language-features/coroutines.md b/src/doc/unstable-book/src/language-features/coroutines.md index 9fb07594650f4..365c05f348d66 100644 --- a/src/doc/unstable-book/src/language-features/coroutines.md +++ b/src/doc/unstable-book/src/language-features/coroutines.md @@ -89,7 +89,7 @@ Feedback on the design and usage is always appreciated! The `Coroutine` trait in `std::ops` currently looks like: ```rust -# #![feature(arbitrary_self_types, coroutine_trait)] +# #![feature(coroutine_trait)] # use std::ops::CoroutineState; # use std::pin::Pin; @@ -184,7 +184,7 @@ fn main() { This coroutine literal will compile down to something similar to: ```rust -#![feature(arbitrary_self_types, coroutine_trait)] +#![feature(coroutine_trait)] use std::ops::{Coroutine, CoroutineState}; use std::pin::Pin; diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs index a68552175c318..f8c986d95b304 100644 --- a/tests/auxiliary/minicore.rs +++ b/tests/auxiliary/minicore.rs @@ -31,11 +31,6 @@ macro_rules! impl_marker_trait { #[lang = "sized"] pub trait Sized {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} -impl LegacyReceiver for &T {} -impl LegacyReceiver for &mut T {} - #[lang = "copy"] pub trait Copy: Sized {} diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs index 7a36490fe93b8..17129a1b6dca6 100644 --- a/tests/codegen/avr/avr-func-addrspace.rs +++ b/tests/codegen/avr/avr-func-addrspace.rs @@ -9,7 +9,7 @@ // It also validates that functions can be called through function pointers // through traits. -#![feature(no_core, lang_items, intrinsics, unboxed_closures, arbitrary_self_types)] +#![feature(no_core, lang_items, intrinsics, unboxed_closures)] #![crate_type = "lib"] #![no_core] @@ -18,8 +18,6 @@ pub trait Sized {} #[lang = "copy"] pub trait Copy {} impl Copy for *const T {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} #[lang = "tuple_trait"] pub trait Tuple {} diff --git a/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs index 5ab55a467268b..f5bf72df651f0 100644 --- a/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs +++ b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs @@ -8,7 +8,7 @@ //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 #![crate_type = "lib"] -#![feature(arbitrary_self_types, no_core, lang_items)] +#![feature(no_core, lang_items)] #![no_core] #[lang = "sized"] @@ -16,8 +16,6 @@ trait Sized {} #[lang = "copy"] trait Copy {} impl Copy for &T {} -#[lang = "legacy_receiver"] -trait LegacyReceiver {} #[lang = "dispatch_from_dyn"] trait DispatchFromDyn {} impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {} diff --git a/tests/rustdoc-json/impls/auto.rs b/tests/rustdoc-json/impls/auto.rs index f37dae4c1ed43..4b78f74b96025 100644 --- a/tests/rustdoc-json/impls/auto.rs +++ b/tests/rustdoc-json/impls/auto.rs @@ -4,9 +4,6 @@ #[lang = "sized"] trait Sized {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} - pub auto trait Bar {} /// has span diff --git a/tests/ui/async-await/inference_var_self_argument.stderr b/tests/ui/async-await/inference_var_self_argument.stderr index 7b7b3dbc757f1..a33c5f7b07dca 100644 --- a/tests/ui/async-await/inference_var_self_argument.stderr +++ b/tests/ui/async-await/inference_var_self_argument.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `&dyn Foo` LL | async fn foo(self: &dyn Foo) { | ^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/inference_var_self_argument.rs:5:5 diff --git a/tests/ui/async-await/issue-66312.stderr b/tests/ui/async-await/issue-66312.stderr index c95ae1147df36..f4db949a5f430 100644 --- a/tests/ui/async-await/issue-66312.stderr +++ b/tests/ui/async-await/issue-66312.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `T` LL | fn is_some(self: T); | ^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0308]: mismatched types --> $DIR/issue-66312.rs:9:8 diff --git a/tests/ui/async-await/issues/issue-53249.rs b/tests/ui/async-await/issues/issue-53249.rs index da86c0c7b26c1..ca666d8fdd520 100644 --- a/tests/ui/async-await/issues/issue-53249.rs +++ b/tests/ui/async-await/issues/issue-53249.rs @@ -1,8 +1,6 @@ //@ check-pass //@ edition:2018 -#![feature(arbitrary_self_types)] - use std::task::{self, Poll}; use std::future::Future; use std::marker::Unpin; diff --git a/tests/ui/deriving/deriving-coerce-pointee-neg.rs b/tests/ui/deriving/deriving-coerce-pointee-neg.rs index da25c854c546a..3421bed86e72f 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-neg.rs +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.rs @@ -1,4 +1,4 @@ -#![feature(derive_coerce_pointee, arbitrary_self_types)] +#![feature(derive_coerce_pointee)] extern crate core; use std::marker::CoercePointee; diff --git a/tests/ui/deriving/deriving-coerce-pointee.rs b/tests/ui/deriving/deriving-coerce-pointee.rs index 26762e4d0face..44c255c661405 100644 --- a/tests/ui/deriving/deriving-coerce-pointee.rs +++ b/tests/ui/deriving/deriving-coerce-pointee.rs @@ -1,5 +1,5 @@ //@ run-pass -#![feature(derive_coerce_pointee, arbitrary_self_types)] +#![feature(derive_coerce_pointee)] use std::marker::CoercePointee; diff --git a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.feature.stderr b/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.feature.stderr deleted file mode 100644 index d0a25e28a7666..0000000000000 --- a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.feature.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0658]: `*const Bar` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:11:18 - | -LL | fn foo(self: *const Self) {} - | ^^^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types_pointers)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error[E0658]: `*mut Bar` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:15:18 - | -LL | fn bar(self: *mut Self) {} - | ^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types_pointers)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error[E0658]: `*const Self` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:5:18 - | -LL | fn foo(self: *const Self); - | ^^^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types_pointers)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.rs b/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.rs index 7ea1b875f79a4..79ceb05662bc4 100644 --- a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.rs +++ b/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.rs @@ -1,6 +1,3 @@ -//@ revisions: default feature -#![cfg_attr(feature, feature(arbitrary_self_types))] - trait Foo { fn foo(self: *const Self); //~ ERROR `*const Self` cannot be used as the type of `self` } diff --git a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.default.stderr b/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.stderr similarity index 91% rename from tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.default.stderr rename to tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.stderr index d0a25e28a7666..0c5b8a4d3b685 100644 --- a/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.default.stderr +++ b/tests/ui/feature-gates/feature-gate-arbitrary-self-types-pointers.stderr @@ -1,5 +1,5 @@ error[E0658]: `*const Bar` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:11:18 + --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:8:18 | LL | fn foo(self: *const Self) {} | ^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | fn foo(self: *const Self) {} = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0658]: `*mut Bar` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:15:18 + --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:12:18 | LL | fn bar(self: *mut Self) {} | ^^^^^^^^^ @@ -21,7 +21,7 @@ LL | fn bar(self: *mut Self) {} = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0658]: `*const Self` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature - --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:5:18 + --> $DIR/feature-gate-arbitrary-self-types-pointers.rs:2:18 | LL | fn foo(self: *const Self); | ^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-arbitrary-self-types.rs b/tests/ui/feature-gates/feature-gate-arbitrary-self-types.rs deleted file mode 100644 index 47ca7e3497578..0000000000000 --- a/tests/ui/feature-gates/feature-gate-arbitrary-self-types.rs +++ /dev/null @@ -1,29 +0,0 @@ -use std::{ - ops::Deref, -}; - -struct Ptr(Box); - -impl Deref for Ptr { - type Target = T; - - fn deref(&self) -> &T { - &*self.0 - } -} - -trait Foo { - fn foo(self: Ptr); //~ ERROR `Ptr` cannot be used as the type of `self` without -} - -struct Bar; - -impl Foo for Bar { - fn foo(self: Ptr) {} //~ ERROR `Ptr` cannot be used as the type of `self` without -} - -impl Bar { - fn bar(self: Box>) {} //~ ERROR `Box>` cannot be used as the -} - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-arbitrary-self-types.stderr b/tests/ui/feature-gates/feature-gate-arbitrary-self-types.stderr deleted file mode 100644 index 3ffba533d63fc..0000000000000 --- a/tests/ui/feature-gates/feature-gate-arbitrary-self-types.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0658]: `Ptr` cannot be used as the type of `self` without the `arbitrary_self_types` feature - --> $DIR/feature-gate-arbitrary-self-types.rs:22:18 - | -LL | fn foo(self: Ptr) {} - | ^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error[E0658]: `Box>` cannot be used as the type of `self` without the `arbitrary_self_types` feature - --> $DIR/feature-gate-arbitrary-self-types.rs:26:18 - | -LL | fn bar(self: Box>) {} - | ^^^^^^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error[E0658]: `Ptr` cannot be used as the type of `self` without the `arbitrary_self_types` feature - --> $DIR/feature-gate-arbitrary-self-types.rs:16:18 - | -LL | fn foo(self: Ptr); - | ^^^^^^^^^ - | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-cell.stderr b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-cell.stderr index 2150effc3b74d..eb9e51a04c394 100644 --- a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-cell.stderr +++ b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-cell.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `Cell<&Self>` LL | fn cell(self: Cell<&Self>); | ^^^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.rs b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.rs index 3c9e903d4ba00..225d24d4ae0ef 100644 --- a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.rs +++ b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.rs @@ -1,6 +1,6 @@ // Check that a self parameter type requires a DispatchFromDyn impl to be dyn-compatible. -#![feature(arbitrary_self_types, unsize, coerce_unsized)] +#![feature(unsize, coerce_unsized)] use std::{ marker::Unsize, diff --git a/tests/ui/issues/issue-56806.stderr b/tests/ui/issues/issue-56806.stderr index ec50d863758db..4b0a59fe12def 100644 --- a/tests/ui/issues/issue-56806.stderr +++ b/tests/ui/issues/issue-56806.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `Box<(dyn Trait + 'static)>` LL | fn dyn_instead_of_self(self: Box); | ^^^^^^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/could-not-resolve-issue-121503.rs b/tests/ui/lifetimes/could-not-resolve-issue-121503.rs index 363162370f21b..339db4cdd9a65 100644 --- a/tests/ui/lifetimes/could-not-resolve-issue-121503.rs +++ b/tests/ui/lifetimes/could-not-resolve-issue-121503.rs @@ -4,7 +4,7 @@ struct Struct; impl Struct { async fn box_ref_Struct(self: Box) -> &u32 { - //~^ ERROR Box` cannot be used as the type of `self` without + //~^ ERROR the trait bound &1 } } diff --git a/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr b/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr index 46804642af88e..5ec8c496af133 100644 --- a/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr +++ b/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr @@ -1,14 +1,16 @@ -error[E0658]: `Box` cannot be used as the type of `self` without the `arbitrary_self_types` feature +error[E0277]: the trait bound `impl FnMut(&mut Self): Allocator` is not satisfied --> $DIR/could-not-resolve-issue-121503.rs:6:35 | LL | async fn box_ref_Struct(self: Box) -> &u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Allocator` is not implemented for `impl FnMut(&mut Self)` | - = note: see issue #44874 for more information - = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` +note: required by a bound in `Box` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL +help: consider restricting opaque type `impl FnMut(&mut Self)` with unstable trait `Allocator` + | +LL | async fn box_ref_Struct(self: Box) -> &u32 { + | +++++++++++++++++++++++ error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0658`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/lint/unused/must_use-in-stdlib-traits.rs b/tests/ui/lint/unused/must_use-in-stdlib-traits.rs index 70dddf61fb7d8..3e5a512f1190b 100644 --- a/tests/ui/lint/unused/must_use-in-stdlib-traits.rs +++ b/tests/ui/lint/unused/must_use-in-stdlib-traits.rs @@ -1,5 +1,4 @@ #![deny(unused_must_use)] -#![feature(arbitrary_self_types)] use std::iter::Iterator; use std::future::Future; diff --git a/tests/ui/lint/unused/must_use-in-stdlib-traits.stderr b/tests/ui/lint/unused/must_use-in-stdlib-traits.stderr index ef738708d5f4e..6ee43ffcf28e6 100644 --- a/tests/ui/lint/unused/must_use-in-stdlib-traits.stderr +++ b/tests/ui/lint/unused/must_use-in-stdlib-traits.stderr @@ -1,5 +1,5 @@ error: unused implementer of `Iterator` that must be used - --> $DIR/must_use-in-stdlib-traits.rs:42:4 + --> $DIR/must_use-in-stdlib-traits.rs:41:4 | LL | iterator(); | ^^^^^^^^^^ @@ -12,7 +12,7 @@ LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ error: unused implementer of `Future` that must be used - --> $DIR/must_use-in-stdlib-traits.rs:43:4 + --> $DIR/must_use-in-stdlib-traits.rs:42:4 | LL | future(); | ^^^^^^^^ @@ -20,7 +20,7 @@ LL | future(); = note: futures do nothing unless you `.await` or poll them error: unused implementer of `FnOnce` that must be used - --> $DIR/must_use-in-stdlib-traits.rs:44:4 + --> $DIR/must_use-in-stdlib-traits.rs:43:4 | LL | square_fn_once(); | ^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | square_fn_once(); = note: closures are lazy and do nothing unless called error: unused implementer of `FnMut` that must be used - --> $DIR/must_use-in-stdlib-traits.rs:45:4 + --> $DIR/must_use-in-stdlib-traits.rs:44:4 | LL | square_fn_mut(); | ^^^^^^^^^^^^^^^ @@ -36,7 +36,7 @@ LL | square_fn_mut(); = note: closures are lazy and do nothing unless called error: unused implementer of `Fn` that must be used - --> $DIR/must_use-in-stdlib-traits.rs:46:4 + --> $DIR/must_use-in-stdlib-traits.rs:45:4 | LL | square_fn(); | ^^^^^^^^^^^ diff --git a/tests/ui/methods/call_method_unknown_referent.rs b/tests/ui/methods/call_method_unknown_referent.rs index b01e2d80f7f80..f03c781508608 100644 --- a/tests/ui/methods/call_method_unknown_referent.rs +++ b/tests/ui/methods/call_method_unknown_referent.rs @@ -1,7 +1,5 @@ //@ edition: 2018 -#![feature(arbitrary_self_types)] - // tests that the referent type of a reference must be known to call methods on it struct SmartPtr(T); diff --git a/tests/ui/methods/call_method_unknown_referent.stderr b/tests/ui/methods/call_method_unknown_referent.stderr index 748b02b52b577..c0760c6fd69f6 100644 --- a/tests/ui/methods/call_method_unknown_referent.stderr +++ b/tests/ui/methods/call_method_unknown_referent.stderr @@ -1,17 +1,17 @@ error[E0282]: type annotations needed - --> $DIR/call_method_unknown_referent.rs:20:31 + --> $DIR/call_method_unknown_referent.rs:18:31 | LL | let _a: i32 = (ptr as &_).read(); | ^^^^ cannot infer type error[E0282]: type annotations needed - --> $DIR/call_method_unknown_referent.rs:26:37 + --> $DIR/call_method_unknown_referent.rs:24:37 | LL | let _b = (rc as std::rc::Rc<_>).read(); | ^^^^ cannot infer type error[E0599]: no method named `read` found for struct `SmartPtr` in the current scope - --> $DIR/call_method_unknown_referent.rs:46:35 + --> $DIR/call_method_unknown_referent.rs:44:35 | LL | struct SmartPtr(T); | ------------------ method `read` not found for this struct diff --git a/tests/ui/methods/call_method_unknown_referent2.rs b/tests/ui/methods/call_method_unknown_referent2.rs index b1615bd8d4414..97a643291f34b 100644 --- a/tests/ui/methods/call_method_unknown_referent2.rs +++ b/tests/ui/methods/call_method_unknown_referent2.rs @@ -1,8 +1,6 @@ //@ edition: 2018 //@ run-pass -#![feature(arbitrary_self_types)] - // tests that the referent type of a reference must be known to call methods on it struct SmartPtr(T); diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs index 9e53ff0791728..a579758f920a3 100644 --- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs +++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs @@ -1,4 +1,4 @@ -#![feature(arbitrary_self_types, coerce_unsized, dispatch_from_dyn, unsize)] +#![feature(coerce_unsized, dispatch_from_dyn, unsize)] #![feature(unsized_locals, unsized_fn_params)] //~^ WARN the feature `unsized_locals` is incomplete diff --git a/tests/ui/privacy/privacy1.rs b/tests/ui/privacy/privacy1.rs index 9436441ecc6a7..ad2b652014fc7 100644 --- a/tests/ui/privacy/privacy1.rs +++ b/tests/ui/privacy/privacy1.rs @@ -12,15 +12,10 @@ pub trait Deref { type Target; } -#[lang="legacy_receiver"] -pub trait LegacyReceiver: Deref {} - impl<'a, T> Deref for &'a T { type Target = T; } -impl<'a, T> LegacyReceiver for &'a T {} - mod bar { // shouldn't bring in too much pub use self::glob::*; diff --git a/tests/ui/privacy/privacy1.stderr b/tests/ui/privacy/privacy1.stderr index a3552e146a65a..9ae1b42ff5b52 100644 --- a/tests/ui/privacy/privacy1.stderr +++ b/tests/ui/privacy/privacy1.stderr @@ -1,54 +1,54 @@ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:132:18 + --> $DIR/privacy1.rs:127:18 | LL | use bar::baz::{foo, bar}; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:132:18 + --> $DIR/privacy1.rs:127:18 | LL | use bar::baz::{foo, bar}; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:141:18 + --> $DIR/privacy1.rs:136:18 | LL | use bar::baz; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `i` is private - --> $DIR/privacy1.rs:165:20 + --> $DIR/privacy1.rs:160:20 | LL | use self::foo::i::A; | ^ private module | note: the module `i` is defined here - --> $DIR/privacy1.rs:170:9 + --> $DIR/privacy1.rs:165:9 | LL | mod i { | ^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:104:16 + --> $DIR/privacy1.rs:99:16 | LL | ::bar::baz::A::foo(); | ^^^ - struct `A` is not publicly re-exported @@ -56,13 +56,13 @@ LL | ::bar::baz::A::foo(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:105:16 + --> $DIR/privacy1.rs:100:16 | LL | ::bar::baz::A::bar(); | ^^^ - struct `A` is not publicly re-exported @@ -70,13 +70,13 @@ LL | ::bar::baz::A::bar(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:107:16 + --> $DIR/privacy1.rs:102:16 | LL | ::bar::baz::A.foo2(); | ^^^ - unit struct `A` is not publicly re-exported @@ -84,13 +84,13 @@ LL | ::bar::baz::A.foo2(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:108:16 + --> $DIR/privacy1.rs:103:16 | LL | ::bar::baz::A.bar2(); | ^^^ - unit struct `A` is not publicly re-exported @@ -98,13 +98,13 @@ LL | ::bar::baz::A.bar2(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ error[E0603]: trait `B` is private - --> $DIR/privacy1.rs:112:16 + --> $DIR/privacy1.rs:107:16 | LL | ::bar::B::foo(); | ^ --- associated function `foo` is not publicly re-exported @@ -112,31 +112,31 @@ LL | ::bar::B::foo(); | private trait | note: the trait `B` is defined here - --> $DIR/privacy1.rs:40:5 + --> $DIR/privacy1.rs:35:5 | LL | trait B { | ^^^^^^^ error[E0603]: function `epriv` is private - --> $DIR/privacy1.rs:118:20 + --> $DIR/privacy1.rs:113:20 | LL | ::bar::epriv(); | ^^^^^ private function | note: the function `epriv` is defined here - --> $DIR/privacy1.rs:65:9 + --> $DIR/privacy1.rs:60:9 | LL | fn epriv(); | ^^^^^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:127:16 + --> $DIR/privacy1.rs:122:16 | LL | ::bar::baz::foo(); | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ @@ -146,13 +146,13 @@ LL | bar::foo(); | ~~~~~~~~ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:128:16 + --> $DIR/privacy1.rs:123:16 | LL | ::bar::baz::bar(); | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:50:5 + --> $DIR/privacy1.rs:45:5 | LL | mod baz { | ^^^^^^^ @@ -162,19 +162,19 @@ LL | bar::bar(); | ~~~~~~~~ error[E0603]: trait `B` is private - --> $DIR/privacy1.rs:157:17 + --> $DIR/privacy1.rs:152:17 | LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } | ^ private trait | note: the trait `B` is defined here - --> $DIR/privacy1.rs:40:5 + --> $DIR/privacy1.rs:35:5 | LL | trait B { | ^^^^^^^ error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:77:23 + --> $DIR/privacy1.rs:72:23 | LL | fn bar() {} | -------- private associated function defined here @@ -183,7 +183,7 @@ LL | self::baz::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:95:13 + --> $DIR/privacy1.rs:90:13 | LL | fn bar() {} | -------- private associated function defined here @@ -192,7 +192,7 @@ LL | bar::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:102:19 + --> $DIR/privacy1.rs:97:19 | LL | fn bar() {} | -------- private associated function defined here @@ -201,7 +201,7 @@ LL | ::bar::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:105:24 + --> $DIR/privacy1.rs:100:24 | LL | fn bar() {} | -------- private associated function defined here @@ -210,7 +210,7 @@ LL | ::bar::baz::A::bar(); | ^^^ private associated function error[E0624]: method `bar2` is private - --> $DIR/privacy1.rs:108:23 + --> $DIR/privacy1.rs:103:23 | LL | fn bar2(&self) {} | -------------- private method defined here diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs index 46e4afd8532e1..4f142ed29f2e0 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs @@ -8,8 +8,8 @@ use std::ops::Deref; struct Foo(u32); impl Foo { const fn get>(self: R) -> u32 { - //~^ ERROR invalid generic `self` parameter type - //~| ERROR destructor of `R` cannot be evaluated at compile-time + //~^ ERROR destructor of `R` cannot be evaluated at compile-time + //~| ERROR invalid generic self.0 //~^ ERROR cannot perform non-const deref coercion on `R` in constant functions } @@ -18,6 +18,7 @@ impl Foo { const FOO: () = { let foo = Foo(1); foo.get::<&Foo>(); + //~^ ERROR mismatched types }; const BAR: [(); { diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr index f217370b024b5..586813f7eaebc 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr @@ -1,3 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/arbitrary-self-from-method-substs-ice.rs:20:5 + | +LL | foo.get::<&Foo>(); + | ^^^ expected `&Foo`, found `Foo` + +error[E0801]: invalid generic `self` parameter type: `R` + --> $DIR/arbitrary-self-from-method-substs-ice.rs:10:49 + | +LL | const fn get>(self: R) -> u32 { + | ^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + error[E0015]: cannot perform non-const deref coercion on `R` in constant functions --> $DIR/arbitrary-self-from-method-substs-ice.rs:13:9 | @@ -16,16 +31,7 @@ LL | const fn get>(self: R) -> u32 { LL | } | - value is dropped here -error[E0801]: invalid generic `self` parameter type: `R` - --> $DIR/arbitrary-self-from-method-substs-ice.rs:10:49 - | -LL | const fn get>(self: R) -> u32 { - | ^ - | - = note: type of `self` must not be a method generic parameter type - = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) - -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0015, E0493, E0801. +Some errors have detailed explanations: E0015, E0308, E0493, E0801. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.rs b/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.rs index 495d261c549ca..ba3bb3a0d7081 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - use std::ops::{Receiver, Deref}; struct SmartPtr<'a, T: ?Sized>(&'a T); diff --git a/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.stderr b/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.stderr index 9af2a08f3712d..5f4946fecb9c6 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.stderr +++ b/tests/ui/self/arbitrary-self-from-method-substs-with-receiver.stderr @@ -1,5 +1,5 @@ error[E0801]: invalid generic `self` parameter type: `R` - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:25:42 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:23:42 | LL | fn a>(self: R) -> u32 { | ^ @@ -8,7 +8,7 @@ LL | fn a>(self: R) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `R` - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:29:39 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:27:39 | LL | fn b>(self: R) -> u32 { | ^ @@ -17,7 +17,7 @@ LL | fn b>(self: R) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `impl Receiver` - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:33:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:31:16 | LL | fn c(self: impl Receiver) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | fn c(self: impl Receiver) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `impl Deref` - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:37:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:35:16 | LL | fn d(self: impl Deref) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,19 +35,19 @@ LL | fn d(self: impl Deref) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0308]: mismatched types - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:51:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:49:16 | LL | assert_eq!(foo.a::<&Foo>(), 2); | ^^^ expected `&Foo`, found `Foo` error[E0308]: mismatched types - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:53:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:51:16 | LL | assert_eq!(foo.b::<&Foo>(), 1); | ^^^ expected `&Foo`, found `Foo` error[E0308]: mismatched types - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:60:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:58:16 | LL | assert_eq!(smart_ptr.a::<&Foo>(), 2); | ^^^^^^^^^ expected `&Foo`, found `SmartPtr<'_, Foo>` @@ -56,7 +56,7 @@ LL | assert_eq!(smart_ptr.a::<&Foo>(), 2); found struct `SmartPtr<'_, Foo, >` error[E0308]: mismatched types - --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:62:16 + --> $DIR/arbitrary-self-from-method-substs-with-receiver.rs:60:16 | LL | assert_eq!(smart_ptr.b::<&Foo>(), 1); | ^^^^^^^^^ expected `&Foo`, found `SmartPtr<'_, Foo>` diff --git a/tests/ui/self/arbitrary-self-from-method-substs.rs b/tests/ui/self/arbitrary-self-from-method-substs.rs index f2d6585961517..9f477018dc5cd 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs.rs @@ -1,6 +1,3 @@ -//@ revisions: default feature -#![cfg_attr(feature, feature(arbitrary_self_types))] - use std::ops::Deref; use std::marker::PhantomData; @@ -31,7 +28,6 @@ impl Foo { self.0 } fn get6(self: FR::Receiver, other: FR) -> u32 { - //[default]~^ ERROR: `::Receiver` cannot be used as the type of `self` 42 } } @@ -59,7 +55,6 @@ struct Bar(std::marker::PhantomData); impl> Bar { fn get(self: R) {} - //[default]~^ ERROR: `R` cannot be used as the type of `self` } trait FindReceiver { @@ -74,17 +69,17 @@ impl FindReceiver for Silly { fn main() { let mut foo = Foo(1); foo.get::<&Foo>(); - //[feature]~^ ERROR mismatched types + //~^ ERROR mismatched types foo.get::>(); - //[feature]~^ ERROR mismatched types + //~^ ERROR mismatched types let smart_ptr = SmartPtr(&foo); let smart_ptr2 = SmartPtr2(&foo); smart_ptr.get(); // this compiles smart_ptr.get::>(); - //[feature]~^ ERROR mismatched types + //~^ ERROR mismatched types smart_ptr.get::<&Foo>(); - //[feature]~^ ERROR mismatched types + //~^ ERROR mismatched types let mut foo = Foo(1); // This test is slightly contrived in an attempt to generate a mismatched types diff --git a/tests/ui/self/arbitrary-self-from-method-substs.stderr b/tests/ui/self/arbitrary-self-from-method-substs.stderr new file mode 100644 index 0000000000000..f1de4afa68f85 --- /dev/null +++ b/tests/ui/self/arbitrary-self-from-method-substs.stderr @@ -0,0 +1,179 @@ +error[E0801]: invalid generic `self` parameter type: `R` + --> $DIR/arbitrary-self-from-method-substs.rs:6:43 + | +LL | fn get>(self: R) -> u32 { + | ^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0801]: invalid generic `self` parameter type: `&R` + --> $DIR/arbitrary-self-from-method-substs.rs:10:44 + | +LL | fn get1>(self: &R) -> u32 { + | ^^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0801]: invalid generic `self` parameter type: `&mut R` + --> $DIR/arbitrary-self-from-method-substs.rs:14:44 + | +LL | fn get2>(self: &mut R) -> u32 { + | ^^^^^^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0801]: invalid generic `self` parameter type: `Rc` + --> $DIR/arbitrary-self-from-method-substs.rs:18:44 + | +LL | fn get3>(self: std::rc::Rc) -> u32 { + | ^^^^^^^^^^^^^^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0801]: invalid generic `self` parameter type: `&Rc` + --> $DIR/arbitrary-self-from-method-substs.rs:22:44 + | +LL | fn get4>(self: &std::rc::Rc) -> u32 { + | ^^^^^^^^^^^^^^^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0801]: invalid generic `self` parameter type: `Rc<&R>` + --> $DIR/arbitrary-self-from-method-substs.rs:26:44 + | +LL | fn get5>(self: std::rc::Rc<&R>) -> u32 { + | ^^^^^^^^^^^^^^^ + | + = note: type of `self` must not be a method generic parameter type + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + +error[E0308]: mismatched types + --> $DIR/arbitrary-self-from-method-substs.rs:71:5 + | +LL | foo.get::<&Foo>(); + | ^^^ expected `&Foo`, found `Foo` + +error[E0308]: mismatched types + --> $DIR/arbitrary-self-from-method-substs.rs:73:5 + | +LL | foo.get::>(); + | ^^^ expected `Rc`, found `Foo` + | + = note: expected struct `Rc` + found struct `Foo` + +error[E0308]: mismatched types + --> $DIR/arbitrary-self-from-method-substs.rs:79:5 + | +LL | smart_ptr.get::>(); + | ^^^^^^^^^ expected `SmartPtr2<'_, Foo>`, found `SmartPtr<'_, Foo>` + | + = note: expected struct `SmartPtr2<'_, Foo>` + found struct `SmartPtr<'_, Foo>` + +error[E0308]: mismatched types + --> $DIR/arbitrary-self-from-method-substs.rs:81:5 + | +LL | smart_ptr.get::<&Foo>(); + | ^^^^^^^^^ expected `&Foo`, found `SmartPtr<'_, Foo>` + | + = note: expected reference `&Foo` + found struct `SmartPtr<'_, Foo, >` + +error[E0271]: type mismatch resolving `::Receiver == Foo` + --> $DIR/arbitrary-self-from-method-substs.rs:87:9 + | +LL | foo.get6(Silly); + | ^^^^ type mismatch resolving `::Receiver == Foo` + | +note: expected this to be `Foo` + --> $DIR/arbitrary-self-from-method-substs.rs:66:21 + | +LL | type Receiver = std::rc::Rc; + | ^^^^^^^^^^^^^^^^ + = note: expected struct `Foo` + found struct `Rc` + +error[E0271]: type mismatch resolving `::Receiver == &Foo` + --> $DIR/arbitrary-self-from-method-substs.rs:91:9 + | +LL | foo.get6(Silly); + | ^^^^ type mismatch resolving `::Receiver == &Foo` + | +note: expected this to be `&Foo` + --> $DIR/arbitrary-self-from-method-substs.rs:66:21 + | +LL | type Receiver = std::rc::Rc; + | ^^^^^^^^^^^^^^^^ + = note: expected reference `&Foo` + found struct `Rc` + +error[E0599]: the method `get` exists for struct `Rc>`, but its trait bounds were not satisfied + --> $DIR/arbitrary-self-from-method-substs.rs:95:7 + | +LL | struct Bar(std::marker::PhantomData); + | ------------- doesn't satisfy `Bar<_>: Deref` +... +LL | t.get(); + | ^^^ method cannot be called on `Rc>` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `<&Bar<_> as Deref>::Target = Bar<&Bar<_>>` + `<&Rc> as Deref>::Target = Bar<&Rc>>` + `<&mut Bar<_> as Deref>::Target = Bar<&mut Bar<_>>` + `<&mut Rc> as Deref>::Target = Bar<&mut Rc>>` + `> as Deref>::Target = Bar>>` + `Bar<_>: Deref` + --> $DIR/arbitrary-self-from-method-substs.rs:56:9 + | +LL | impl> Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------ + | | | + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +note: the trait `Deref` must be implemented + --> $SRC_DIR/core/src/ops/deref.rs:LL:COL + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `get`, perhaps you need to implement it: + candidate #1: `SliceIndex` + +error[E0599]: the method `get` exists for reference `&Rc>`, but its trait bounds were not satisfied + --> $DIR/arbitrary-self-from-method-substs.rs:103:7 + | +LL | struct Bar(std::marker::PhantomData); + | ------------- doesn't satisfy `Bar<_>: Deref` +... +LL | t.get(); + | ^^^ method cannot be called on `&Rc>` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `<&&Rc> as Deref>::Target = Bar<&&Rc>>` + `<&Bar<_> as Deref>::Target = Bar<&Bar<_>>` + `<&Rc> as Deref>::Target = Bar<&Rc>>` + `<&mut &Rc> as Deref>::Target = Bar<&mut &Rc>>` + `<&mut Bar<_> as Deref>::Target = Bar<&mut Bar<_>>` + `<&mut Rc> as Deref>::Target = Bar<&mut Rc>>` + `> as Deref>::Target = Bar>>` + `Bar<_>: Deref` + --> $DIR/arbitrary-self-from-method-substs.rs:56:9 + | +LL | impl> Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------ + | | | + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +note: the trait `Deref` must be implemented + --> $SRC_DIR/core/src/ops/deref.rs:LL:COL + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `get`, perhaps you need to implement it: + candidate #1: `SliceIndex` + +error: aborting due to 14 previous errors + +Some errors have detailed explanations: E0271, E0308, E0599, E0801. +For more information about an error, try `rustc --explain E0271`. diff --git a/tests/ui/self/arbitrary-self-opaque.stderr b/tests/ui/self/arbitrary-self-opaque.stderr index c75165d9f8e27..0469aca27dc81 100644 --- a/tests/ui/self/arbitrary-self-opaque.stderr +++ b/tests/ui/self/arbitrary-self-opaque.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `Bar` LL | fn foo(self: Bar) {} | ^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error: item does not constrain `Bar::{opaque#0}`, but has it in its signature --> $DIR/arbitrary-self-opaque.rs:7:8 diff --git a/tests/ui/self/arbitrary_self_types_by_value_reborrow.rs b/tests/ui/self/arbitrary_self_types_by_value_reborrow.rs index de4db1b9afec7..19904ac7d8e44 100644 --- a/tests/ui/self/arbitrary_self_types_by_value_reborrow.rs +++ b/tests/ui/self/arbitrary_self_types_by_value_reborrow.rs @@ -1,6 +1,5 @@ //@ run-pass -#![feature(arbitrary_self_types)] #![allow(dead_code)] // With arbitrary self types v2, we show an error if there are diff --git a/tests/ui/self/arbitrary_self_types_generic_over_receiver.rs b/tests/ui/self/arbitrary_self_types_generic_over_receiver.rs index 8ccda9368addf..1214c3b09f3b6 100644 --- a/tests/ui/self/arbitrary_self_types_generic_over_receiver.rs +++ b/tests/ui/self/arbitrary_self_types_generic_over_receiver.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - use std::ops::{Receiver, Deref}; struct Foo(u32); diff --git a/tests/ui/self/arbitrary_self_types_generic_over_receiver.stderr b/tests/ui/self/arbitrary_self_types_generic_over_receiver.stderr index 2da3925341e2f..9d4843c9e28f3 100644 --- a/tests/ui/self/arbitrary_self_types_generic_over_receiver.stderr +++ b/tests/ui/self/arbitrary_self_types_generic_over_receiver.stderr @@ -1,5 +1,5 @@ error[E0801]: invalid generic `self` parameter type: `impl Receiver` - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:7:16 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:5:16 | LL | fn a(self: impl Receiver) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | fn a(self: impl Receiver) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `impl Deref` - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:11:16 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:9:16 | LL | fn b(self: impl Deref) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,14 +17,14 @@ LL | fn b(self: impl Deref) -> u32 { = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0277]: the trait bound `Foo: std::ops::Receiver` is not satisfied - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:19:9 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:17:9 | LL | foo.a(); | ^ the trait `std::ops::Receiver` is not implemented for `Foo` | = note: required for `Foo` to implement `std::ops::Receiver` note: required by a bound in `Foo::a` - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:7:21 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:5:21 | LL | fn a(self: impl Receiver) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::a` @@ -36,13 +36,13 @@ LL | &mut foo.a(); | ++++ error[E0277]: the trait bound `Foo: Deref` is not satisfied - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:21:9 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:19:9 | LL | foo.b(); | ^ the trait `Deref` is not implemented for `Foo` | note: required by a bound in `Foo::b` - --> $DIR/arbitrary_self_types_generic_over_receiver.rs:11:21 + --> $DIR/arbitrary_self_types_generic_over_receiver.rs:9:21 | LL | fn b(self: impl Deref) -> u32 { | ^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::b` diff --git a/tests/ui/self/arbitrary_self_types_generic_receiver.rs b/tests/ui/self/arbitrary_self_types_generic_receiver.rs index 0739fb778b605..14b272299b8c3 100644 --- a/tests/ui/self/arbitrary_self_types_generic_receiver.rs +++ b/tests/ui/self/arbitrary_self_types_generic_receiver.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - struct PtrA(T); impl core::ops::Receiver for PtrA { diff --git a/tests/ui/self/arbitrary_self_types_generic_receiver.stderr b/tests/ui/self/arbitrary_self_types_generic_receiver.stderr index 788c55ea2f1c3..4f61ba182fbbf 100644 --- a/tests/ui/self/arbitrary_self_types_generic_receiver.stderr +++ b/tests/ui/self/arbitrary_self_types_generic_receiver.stderr @@ -1,5 +1,5 @@ error[E0801]: invalid generic `self` parameter type: `&R` - --> $DIR/arbitrary_self_types_generic_receiver.rs:26:53 + --> $DIR/arbitrary_self_types_generic_receiver.rs:24:53 | LL | fn a>(self: &R) {} | ^^ @@ -8,7 +8,7 @@ LL | fn a>(self: &R) {} = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `&mut R` - --> $DIR/arbitrary_self_types_generic_receiver.rs:28:53 + --> $DIR/arbitrary_self_types_generic_receiver.rs:26:53 | LL | fn b>(self: &mut R) {} | ^^^^^^ @@ -17,7 +17,7 @@ LL | fn b>(self: &mut R) {} = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `R` - --> $DIR/arbitrary_self_types_generic_receiver.rs:30:53 + --> $DIR/arbitrary_self_types_generic_receiver.rs:28:53 | LL | fn c>(self: R) {} | ^ @@ -26,7 +26,7 @@ LL | fn c>(self: R) {} = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `R` - --> $DIR/arbitrary_self_types_generic_receiver.rs:32:45 + --> $DIR/arbitrary_self_types_generic_receiver.rs:30:45 | LL | fn d>(self: R) {} | ^ @@ -35,7 +35,7 @@ LL | fn d>(self: R) {} = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0801]: invalid generic `self` parameter type: `impl SomePtr` - --> $DIR/arbitrary_self_types_generic_receiver.rs:34:16 + --> $DIR/arbitrary_self_types_generic_receiver.rs:32:16 | LL | fn e(self: impl SomePtr) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/arbitrary_self_types_lifetime_elision.rs b/tests/ui/self/arbitrary_self_types_lifetime_elision.rs index fd645c1013b64..2e2c5c20b519b 100644 --- a/tests/ui/self/arbitrary_self_types_lifetime_elision.rs +++ b/tests/ui/self/arbitrary_self_types_lifetime_elision.rs @@ -1,7 +1,5 @@ //@ run-pass -#![feature(arbitrary_self_types)] - #[derive(Clone)] struct SmartPtr<'a, T: ?Sized>(&'a T); diff --git a/tests/ui/self/arbitrary_self_types_niche_deshadowing.rs b/tests/ui/self/arbitrary_self_types_niche_deshadowing.rs index 9326eca1f5353..4356bf85fef04 100644 --- a/tests/ui/self/arbitrary_self_types_niche_deshadowing.rs +++ b/tests/ui/self/arbitrary_self_types_niche_deshadowing.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] #![allow(incomplete_features)] -#![feature(arbitrary_self_types)] #![feature(arbitrary_self_types_pointers)] #![feature(pin_ergonomics)] diff --git a/tests/ui/self/arbitrary_self_types_no_generics.rs b/tests/ui/self/arbitrary_self_types_no_generics.rs index 8a6f57418829e..8e083656a06d7 100644 --- a/tests/ui/self/arbitrary_self_types_no_generics.rs +++ b/tests/ui/self/arbitrary_self_types_no_generics.rs @@ -1,7 +1,5 @@ //@ run-pass -#![feature(arbitrary_self_types)] - pub struct A; impl A { diff --git a/tests/ui/self/arbitrary_self_types_nonnull.rs b/tests/ui/self/arbitrary_self_types_nonnull.rs index ab1589b956e5b..cb96e73322a9f 100644 --- a/tests/ui/self/arbitrary_self_types_nonnull.rs +++ b/tests/ui/self/arbitrary_self_types_nonnull.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - struct A; impl A { diff --git a/tests/ui/self/arbitrary_self_types_nonnull.stderr b/tests/ui/self/arbitrary_self_types_nonnull.stderr index 5ebe58b4e48ec..a8f11113a70bd 100644 --- a/tests/ui/self/arbitrary_self_types_nonnull.stderr +++ b/tests/ui/self/arbitrary_self_types_nonnull.stderr @@ -1,5 +1,5 @@ error[E0307]: invalid `self` parameter type: `NonNull` - --> $DIR/arbitrary_self_types_nonnull.rs:6:16 + --> $DIR/arbitrary_self_types_nonnull.rs:4:16 | LL | fn m(self: std::ptr::NonNull) {} | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | fn m(self: std::ptr::NonNull) {} = note: `NonNull` does not implement `Receiver` because it has methods that may shadow the referent; consider wrapping your `NonNull` in a newtype wrapper for which you implement `Receiver` error[E0307]: invalid `self` parameter type: `&NonNull` - --> $DIR/arbitrary_self_types_nonnull.rs:8:16 + --> $DIR/arbitrary_self_types_nonnull.rs:6:16 | LL | fn n(self: &std::ptr::NonNull) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs index 26e48f69d23ea..7db92e9ec14ae 100644 --- a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs +++ b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - use std::rc::Rc; struct Foo; diff --git a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr index 4c0ab88493e94..8adbde62ad830 100644 --- a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr +++ b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `frobnicate_ref` found for struct `CppRef` in the current scope - --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:29:17 + --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:27:17 | LL | struct CppRef(T); | ---------------- method `frobnicate_ref` not found for this struct @@ -17,7 +17,7 @@ LL | foo_cpp_ref.frobnicate_cpp_ref(); | ~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `frobnicate_self` found for struct `CppRef` in the current scope - --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:32:17 + --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:30:17 | LL | struct CppRef(T); | ---------------- method `frobnicate_self` not found for this struct diff --git a/tests/ui/self/arbitrary_self_types_pin_getref.rs b/tests/ui/self/arbitrary_self_types_pin_getref.rs index 29dd907f7ff00..c418ba5f34f3e 100644 --- a/tests/ui/self/arbitrary_self_types_pin_getref.rs +++ b/tests/ui/self/arbitrary_self_types_pin_getref.rs @@ -1,10 +1,5 @@ // Confirms that Pin::get_ref can no longer shadow methods in pointees // once arbitrary_self_types is enabled. -// -//@ revisions: default feature -#![cfg_attr(feature, feature(arbitrary_self_types))] - -//@[default] check-pass #![allow(dead_code)] @@ -21,5 +16,5 @@ fn main() { let pinned_a: Pin<&mut A> = pin!(A); let pinned_a: Pin<&A> = pinned_a.as_ref(); let _ = pinned_a.get_ref(); - //[feature]~^ ERROR: multiple applicable items + //~^ ERROR: multiple applicable items } diff --git a/tests/ui/self/arbitrary_self_types_pin_getref.feature.stderr b/tests/ui/self/arbitrary_self_types_pin_getref.stderr similarity index 82% rename from tests/ui/self/arbitrary_self_types_pin_getref.feature.stderr rename to tests/ui/self/arbitrary_self_types_pin_getref.stderr index 52cf69f33a54b..f4bd25a66f788 100644 --- a/tests/ui/self/arbitrary_self_types_pin_getref.feature.stderr +++ b/tests/ui/self/arbitrary_self_types_pin_getref.stderr @@ -1,11 +1,11 @@ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_pin_getref.rs:23:22 + --> $DIR/arbitrary_self_types_pin_getref.rs:18:22 | LL | let _ = pinned_a.get_ref(); | ^^^^^^^ multiple `get_ref` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_pin_getref.rs:17:5 + --> $DIR/arbitrary_self_types_pin_getref.rs:12:5 | LL | fn get_ref(self: &Pin<&A>) {} // note &Pin | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/arbitrary_self_types_pointers_and_wrappers.rs b/tests/ui/self/arbitrary_self_types_pointers_and_wrappers.rs index 76d7754384ebe..e82c91b168443 100644 --- a/tests/ui/self/arbitrary_self_types_pointers_and_wrappers.rs +++ b/tests/ui/self/arbitrary_self_types_pointers_and_wrappers.rs @@ -1,5 +1,5 @@ //@ run-pass -#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)] +#![feature(unsize, coerce_unsized, dispatch_from_dyn)] #![feature(rustc_attrs)] use std::{ diff --git a/tests/ui/self/arbitrary_self_types_recursive_receiver.rs b/tests/ui/self/arbitrary_self_types_recursive_receiver.rs index f3e7f96d7c4de..88ccc9af3d5fe 100644 --- a/tests/ui/self/arbitrary_self_types_recursive_receiver.rs +++ b/tests/ui/self/arbitrary_self_types_recursive_receiver.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(arbitrary_self_types)] struct MyNonNull(*const T); diff --git a/tests/ui/self/arbitrary_self_types_shadowing_val_constptr.rs b/tests/ui/self/arbitrary_self_types_shadowing_val_constptr.rs index 2b718cb0454ce..418c29b5a95c9 100644 --- a/tests/ui/self/arbitrary_self_types_shadowing_val_constptr.rs +++ b/tests/ui/self/arbitrary_self_types_shadowing_val_constptr.rs @@ -1,6 +1,5 @@ //@ run-pass -#![feature(arbitrary_self_types)] #![feature(arbitrary_self_types_pointers)] pub struct A; diff --git a/tests/ui/self/arbitrary_self_types_silly.rs b/tests/ui/self/arbitrary_self_types_silly.rs index 94726bd69cc57..698bb1dd8e324 100644 --- a/tests/ui/self/arbitrary_self_types_silly.rs +++ b/tests/ui/self/arbitrary_self_types_silly.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(arbitrary_self_types)] struct Foo; struct Bar; diff --git a/tests/ui/self/arbitrary_self_types_stdlib_pointers.rs b/tests/ui/self/arbitrary_self_types_stdlib_pointers.rs index 4b8a21f764855..fcff235aedd2d 100644 --- a/tests/ui/self/arbitrary_self_types_stdlib_pointers.rs +++ b/tests/ui/self/arbitrary_self_types_stdlib_pointers.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(arbitrary_self_types)] #![feature(rustc_attrs)] use std::{ diff --git a/tests/ui/self/arbitrary_self_types_struct_receiver_trait.rs b/tests/ui/self/arbitrary_self_types_struct_receiver_trait.rs index cebf0ea7cba93..38f89ba5b5956 100644 --- a/tests/ui/self/arbitrary_self_types_struct_receiver_trait.rs +++ b/tests/ui/self/arbitrary_self_types_struct_receiver_trait.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(arbitrary_self_types)] use std::ops::Receiver; diff --git a/tests/ui/self/arbitrary_self_types_trait_receiver_trait.rs b/tests/ui/self/arbitrary_self_types_trait_receiver_trait.rs index 9c0402da0befe..7d59d8662ff21 100644 --- a/tests/ui/self/arbitrary_self_types_trait_receiver_trait.rs +++ b/tests/ui/self/arbitrary_self_types_trait_receiver_trait.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(arbitrary_self_types)] #![allow(unused_allocation)] struct SmartPtr(T); diff --git a/tests/ui/self/arbitrary_self_types_unshadowing.rs b/tests/ui/self/arbitrary_self_types_unshadowing.rs index cd195654cc195..c9e56d6754cf2 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing.rs +++ b/tests/ui/self/arbitrary_self_types_unshadowing.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - pub struct A; // The receiver of the potentially shadowed method diff --git a/tests/ui/self/arbitrary_self_types_unshadowing.stderr b/tests/ui/self/arbitrary_self_types_unshadowing.stderr index 3a126c495c94d..bda9468b259b3 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing.stderr +++ b/tests/ui/self/arbitrary_self_types_unshadowing.stderr @@ -1,101 +1,101 @@ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:42:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:40:27 | LL | assert_eq!(Wrapper(A).f(), 1); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing.rs:8:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:6:5 | LL | pub fn f(self: Wrapper) -> i32 { 1 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:36:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:34:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:44:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:42:27 | LL | assert_eq!(Wrapper(A).g(), 2); | ^ multiple `g` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing.rs:9:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:7:5 | LL | pub fn g(self: &Wrapper) -> i32 { 2 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:37:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:35:5 | LL | pub fn g(&self) -> i32 { 6 } | ^^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:46:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:44:27 | LL | assert_eq!(Wrapper(A).h(), 3); | ^ multiple `h` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing.rs:10:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:8:5 | LL | pub fn h(self: &mut Wrapper) -> i32 { 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:38:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:36:5 | LL | pub fn h(&mut self) -> i32 { 7 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:49:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:47:27 | LL | assert_eq!(Wrapper(B).f(), 9); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `B` - --> $DIR/arbitrary_self_types_unshadowing.rs:17:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:15:5 | LL | pub fn f(self: &Wrapper) -> i32 { 9 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:36:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:34:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:51:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:49:27 | LL | assert_eq!(Wrapper(C).f(), 10); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `C` - --> $DIR/arbitrary_self_types_unshadowing.rs:25:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:23:5 | LL | pub fn f(self: &mut Wrapper) -> i32 { 10 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:36:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:34:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing.rs:53:27 + --> $DIR/arbitrary_self_types_unshadowing.rs:51:27 | LL | assert_eq!(Wrapper(C).g(), 11); | ^ multiple `g` found | note: candidate #1 is defined in an impl for the type `C` - --> $DIR/arbitrary_self_types_unshadowing.rs:26:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:24:5 | LL | pub fn g(self: &mut Wrapper) -> i32 { 11 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing.rs:37:5 + --> $DIR/arbitrary_self_types_unshadowing.rs:35:5 | LL | pub fn g(&self) -> i32 { 6 } | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs index 62553c2622a7e..e3180190d1c1c 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs +++ b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs @@ -1,5 +1,4 @@ #![feature(arbitrary_self_types_pointers)] -#![feature(arbitrary_self_types)] pub struct A; diff --git a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.stderr b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.stderr index 6d453aed0f06d..8ebae45162211 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.stderr +++ b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.stderr @@ -1,118 +1,118 @@ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:45:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:44:27 | LL | assert_eq!(Wrapper(A).f(), 1); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:9:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:8:5 | LL | pub fn f(self: Wrapper) -> i32 { 1 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:38:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:37:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:47:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:46:27 | LL | assert_eq!(Wrapper(A).g(), 2); | ^ multiple `g` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:10:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:9:5 | LL | pub fn g(self: &Wrapper) -> i32 { 2 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:39:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:38:5 | LL | pub fn g(&self) -> i32 { 6 } | ^^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:49:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:48:27 | LL | assert_eq!(Wrapper(A).h(), 3); | ^ multiple `h` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:11:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:10:5 | LL | pub fn h(self: &mut Wrapper) -> i32 { 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:40:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:39:5 | LL | pub fn h(&mut self) -> i32 { 7 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:53:22 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:52:22 | LL | assert_eq!(a_ptr.i(), 4); | ^ multiple `i` found | note: candidate #1 is defined in an impl for the type `A` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:12:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:11:5 | LL | pub fn i(self: *const Wrapper) -> i32 { 4 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:41:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:40:5 | LL | pub fn i(self: *const Self) -> i32 { 8 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:55:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:54:27 | LL | assert_eq!(Wrapper(B).f(), 9); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `B` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:19:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:18:5 | LL | pub fn f(self: &Wrapper) -> i32 { 9 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:38:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:37:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:57:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:56:27 | LL | assert_eq!(Wrapper(C).f(), 10); | ^ multiple `f` found | note: candidate #1 is defined in an impl for the type `C` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:27:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:26:5 | LL | pub fn f(self: &mut Wrapper) -> i32 { 10 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:38:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:37:5 | LL | pub fn f(self) -> i32 { 5 } | ^^^^^^^^^^^^^^^^^^^^^ error[E0034]: multiple applicable items in scope - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:59:27 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:58:27 | LL | assert_eq!(Wrapper(C).g(), 11); | ^ multiple `g` found | note: candidate #1 is defined in an impl for the type `C` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:28:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:27:5 | LL | pub fn g(self: &mut Wrapper) -> i32 { 11 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl for the type `Wrapper` - --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:39:5 + --> $DIR/arbitrary_self_types_unshadowing_ptrs.rs:38:5 | LL | pub fn g(&self) -> i32 { 6 } | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/arbitrary_self_types_weak.rs b/tests/ui/self/arbitrary_self_types_weak.rs index 91f2b9e0a95f5..bd036f971e753 100644 --- a/tests/ui/self/arbitrary_self_types_weak.rs +++ b/tests/ui/self/arbitrary_self_types_weak.rs @@ -1,5 +1,3 @@ -#![feature(arbitrary_self_types)] - struct A; impl A { diff --git a/tests/ui/self/arbitrary_self_types_weak.stderr b/tests/ui/self/arbitrary_self_types_weak.stderr index 42d239419ad01..8a4508bbffa62 100644 --- a/tests/ui/self/arbitrary_self_types_weak.stderr +++ b/tests/ui/self/arbitrary_self_types_weak.stderr @@ -1,5 +1,5 @@ error[E0307]: invalid `self` parameter type: `std::rc::Weak` - --> $DIR/arbitrary_self_types_weak.rs:6:16 + --> $DIR/arbitrary_self_types_weak.rs:4:16 | LL | fn m(self: std::rc::Weak) {} | ^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | fn m(self: std::rc::Weak) {} = note: `Weak` does not implement `Receiver` because it has methods that may shadow the referent; consider wrapping your `Weak` in a newtype wrapper for which you implement `Receiver` error[E0307]: invalid `self` parameter type: `std::sync::Weak` - --> $DIR/arbitrary_self_types_weak.rs:8:16 + --> $DIR/arbitrary_self_types_weak.rs:6:16 | LL | fn n(self: std::sync::Weak) {} | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/conflicting_inner.rs b/tests/ui/self/conflicting_inner.rs index 1a7037dce7393..74ef8e44daddf 100644 --- a/tests/ui/self/conflicting_inner.rs +++ b/tests/ui/self/conflicting_inner.rs @@ -1,6 +1,4 @@ //@ run-pass -//@ revisions: default feature -#![cfg_attr(feature, feature(arbitrary_self_types))] // This test aims to be like the IndexVec within rustc, and conflicts // over its into_iter(). diff --git a/tests/ui/self/conflicting_inner2.feature.stderr b/tests/ui/self/conflicting_inner2.feature.stderr new file mode 100644 index 0000000000000..de45431dfd52e --- /dev/null +++ b/tests/ui/self/conflicting_inner2.feature.stderr @@ -0,0 +1,10 @@ +warning: the feature `arbitrary_self_types` has been stable since 1.84.0-dev and no longer requires an attribute to enable + --> $DIR/conflicting_inner2.rs:3:30 + | +LL | #![cfg_attr(feature, feature(arbitrary_self_types))] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(stable_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/self/conflicting_inner2.rs b/tests/ui/self/conflicting_inner2.rs index e6a6b5ef793e3..ad51dbf9b476c 100644 --- a/tests/ui/self/conflicting_inner2.rs +++ b/tests/ui/self/conflicting_inner2.rs @@ -1,6 +1,4 @@ //@ run-pass -//@ revisions: default feature -#![cfg_attr(feature, feature(arbitrary_self_types))] use std::pin::Pin; use std::ops::DerefMut; diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs index 71f198f7dc70e..89683db3ec115 100644 --- a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs @@ -2,7 +2,6 @@ // fields that weren't ZSTs. I don't believe this was possible to abuse, but // it's at least nice to give users better errors. -#![feature(arbitrary_self_types)] #![feature(unsize)] #![feature(dispatch_from_dyn)] diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr index 1f13c51f67996..c1159feb0a6ea 100644 --- a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr @@ -1,5 +1,5 @@ error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions - --> $DIR/dispatch-from-dyn-zst-transmute-zst-nonzst.rs:17:1 + --> $DIR/dispatch-from-dyn-zst-transmute-zst-nonzst.rs:16:1 | LL | / impl DispatchFromDyn> for Dispatchable LL | | diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute.rs b/tests/ui/self/dispatch-from-dyn-zst-transmute.rs index 57c255b4d7bca..2350b9556393f 100644 --- a/tests/ui/self/dispatch-from-dyn-zst-transmute.rs +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![feature(unsize)] #![feature(dispatch_from_dyn)] diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr b/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr index 5a8ae88b5f1b8..d152b23092394 100644 --- a/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr @@ -1,5 +1,5 @@ error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions - --> $DIR/dispatch-from-dyn-zst-transmute.rs:17:1 + --> $DIR/dispatch-from-dyn-zst-transmute.rs:16:1 | LL | / impl<'a, T, U> DispatchFromDyn> for Foo<'a, T> LL | | diff --git a/tests/ui/self/elision/multiple-ref-self-async.rs b/tests/ui/self/elision/multiple-ref-self-async.rs index f63b455901ee0..2fa9a6719ed42 100644 --- a/tests/ui/self/elision/multiple-ref-self-async.rs +++ b/tests/ui/self/elision/multiple-ref-self-async.rs @@ -1,6 +1,5 @@ //@ edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::marker::PhantomData; diff --git a/tests/ui/self/elision/multiple-ref-self-async.stderr b/tests/ui/self/elision/multiple-ref-self-async.stderr index e2abc7c1e7852..241929c311a3e 100644 --- a/tests/ui/self/elision/multiple-ref-self-async.stderr +++ b/tests/ui/self/elision/multiple-ref-self-async.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self-async.rs:22:74 + --> $DIR/multiple-ref-self-async.rs:21:74 | LL | async fn wrap_ref_Self_ref_Self(self: Wrap<&Self, &Self>, f: &u8) -> &u8 { | ------------------ --- ^ expected named lifetime parameter @@ -11,7 +11,7 @@ LL | async fn wrap_ref_Self_ref_Self<'a>(self: Wrap<&'a Self, &'a Self>, f: | ++++ ++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self-async.rs:27:84 + --> $DIR/multiple-ref-self-async.rs:26:84 | LL | async fn box_wrap_ref_Self_ref_Self(self: Box>, f: &u32) -> &u32 { | ----------------------- ---- ^ expected named lifetime parameter @@ -23,7 +23,7 @@ LL | async fn box_wrap_ref_Self_ref_Self<'a>(self: Box $DIR/multiple-ref-self-async.rs:32:84 + --> $DIR/multiple-ref-self-async.rs:31:84 | LL | async fn pin_wrap_ref_Self_ref_Self(self: Pin>, f: &u32) -> &u32 { | ----------------------- ---- ^ expected named lifetime parameter @@ -35,7 +35,7 @@ LL | async fn pin_wrap_ref_Self_ref_Self<'a>(self: Pin $DIR/multiple-ref-self-async.rs:37:93 + --> $DIR/multiple-ref-self-async.rs:36:93 | LL | async fn box_box_wrap_ref_Self_ref_Self(self: Box>>, f: &u32) -> &u32 { | ---------------------------- ---- ^ expected named lifetime parameter @@ -47,7 +47,7 @@ LL | async fn box_box_wrap_ref_Self_ref_Self<'a>(self: Box $DIR/multiple-ref-self-async.rs:42:93 + --> $DIR/multiple-ref-self-async.rs:41:93 | LL | async fn box_pin_wrap_ref_Self_ref_Self(self: Box>>, f: &u32) -> &u32 { | ---------------------------- ---- ^ expected named lifetime parameter diff --git a/tests/ui/self/elision/multiple-ref-self.rs b/tests/ui/self/elision/multiple-ref-self.rs index dd9b138051d0b..a83c7727ec476 100644 --- a/tests/ui/self/elision/multiple-ref-self.rs +++ b/tests/ui/self/elision/multiple-ref-self.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::marker::PhantomData; diff --git a/tests/ui/self/elision/multiple-ref-self.stderr b/tests/ui/self/elision/multiple-ref-self.stderr index 24d74d352e482..9f18e06e00fb4 100644 --- a/tests/ui/self/elision/multiple-ref-self.stderr +++ b/tests/ui/self/elision/multiple-ref-self.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self.rs:20:68 + --> $DIR/multiple-ref-self.rs:19:68 | LL | fn wrap_ref_Self_ref_Self(self: Wrap<&Self, &Self>, f: &u8) -> &u8 { | ------------------ --- ^ expected named lifetime parameter @@ -11,7 +11,7 @@ LL | fn wrap_ref_Self_ref_Self<'a>(self: Wrap<&'a Self, &'a Self>, f: &'a u8 | ++++ ++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self.rs:25:78 + --> $DIR/multiple-ref-self.rs:24:78 | LL | fn box_wrap_ref_Self_ref_Self(self: Box>, f: &u32) -> &u32 { | ----------------------- ---- ^ expected named lifetime parameter @@ -23,7 +23,7 @@ LL | fn box_wrap_ref_Self_ref_Self<'a>(self: Box>, | ++++ ++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self.rs:30:78 + --> $DIR/multiple-ref-self.rs:29:78 | LL | fn pin_wrap_ref_Self_ref_Self(self: Pin>, f: &u32) -> &u32 { | ----------------------- ---- ^ expected named lifetime parameter @@ -35,7 +35,7 @@ LL | fn pin_wrap_ref_Self_ref_Self<'a>(self: Pin>, | ++++ ++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/multiple-ref-self.rs:35:87 + --> $DIR/multiple-ref-self.rs:34:87 | LL | fn box_box_wrap_ref_Self_ref_Self(self: Box>>, f: &u32) -> &u32 { | ---------------------------- ---- ^ expected named lifetime parameter @@ -47,7 +47,7 @@ LL | fn box_box_wrap_ref_Self_ref_Self<'a>(self: Box $DIR/multiple-ref-self.rs:40:87 + --> $DIR/multiple-ref-self.rs:39:87 | LL | fn box_pin_wrap_ref_Self_ref_Self(self: Box>>, f: &u32) -> &u32 { | ---------------------------- ---- ^ expected named lifetime parameter diff --git a/tests/ui/self/elision/ref-self-async.rs b/tests/ui/self/elision/ref-self-async.rs index 1f3e670d3d1df..74428546e49be 100644 --- a/tests/ui/self/elision/ref-self-async.rs +++ b/tests/ui/self/elision/ref-self-async.rs @@ -1,7 +1,6 @@ //@ edition:2018 #![allow(non_snake_case)] -#![feature(arbitrary_self_types)] use std::marker::PhantomData; use std::ops::Deref; diff --git a/tests/ui/self/elision/ref-self-async.stderr b/tests/ui/self/elision/ref-self-async.stderr index a75ece5f2c768..f2478f361c4f0 100644 --- a/tests/ui/self/elision/ref-self-async.stderr +++ b/tests/ui/self/elision/ref-self-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:23:9 + --> $DIR/ref-self-async.rs:22:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_self<'a>(&self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:30:9 + --> $DIR/ref-self-async.rs:29:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn ref_Self<'a>(self: &Self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:35:9 + --> $DIR/ref-self-async.rs:34:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn box_ref_Self<'a>(self: Box<&Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:40:9 + --> $DIR/ref-self-async.rs:39:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn pin_ref_Self<'a>(self: Pin<&Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:45:9 + --> $DIR/ref-self-async.rs:44:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &'a | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:50:9 + --> $DIR/ref-self-async.rs:49:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -89,7 +89,7 @@ LL | async fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &'a | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:55:9 + --> $DIR/ref-self-async.rs:54:9 | LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | - - let's call the lifetime of this reference `'1` diff --git a/tests/ui/self/elision/ref-self-multi.rs b/tests/ui/self/elision/ref-self-multi.rs index ed431a9c852dd..860b9214e40f4 100644 --- a/tests/ui/self/elision/ref-self-multi.rs +++ b/tests/ui/self/elision/ref-self-multi.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] #![allow(unused)] diff --git a/tests/ui/self/elision/ref-self-multi.stderr b/tests/ui/self/elision/ref-self-multi.stderr index 7e0451aa0d5c3..8448658c51bab 100644 --- a/tests/ui/self/elision/ref-self-multi.stderr +++ b/tests/ui/self/elision/ref-self-multi.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/ref-self-multi.rs:18:56 + --> $DIR/ref-self-multi.rs:17:56 | LL | fn ref_box_ref_Self(self: &Box<&Self>, f: &u32) -> &u32 { | ----------- ---- ^ expected named lifetime parameter @@ -11,7 +11,7 @@ LL | fn ref_box_ref_Self<'a>(self: &'a Box<&'a Self>, f: &'a u32) -> &'a u32 | ++++ ++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/ref-self-multi.rs:23:63 + --> $DIR/ref-self-multi.rs:22:63 | LL | fn ref_wrap_ref_Self(self: &Wrap<&Self, u32>, f: &u32) -> &u32 { | ----------------- ---- ^ expected named lifetime parameter diff --git a/tests/ui/self/elision/ref-self.fixed b/tests/ui/self/elision/ref-self.fixed index 784ccb9efe2f6..649fff366ead1 100644 --- a/tests/ui/self/elision/ref-self.fixed +++ b/tests/ui/self/elision/ref-self.fixed @@ -1,7 +1,6 @@ //@ run-rustfix //@ edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case, dead_code)] use std::marker::PhantomData; diff --git a/tests/ui/self/elision/ref-self.rs b/tests/ui/self/elision/ref-self.rs index dbe441879cc5d..af9d7bdbdb2aa 100644 --- a/tests/ui/self/elision/ref-self.rs +++ b/tests/ui/self/elision/ref-self.rs @@ -1,7 +1,6 @@ //@ run-rustfix //@ edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case, dead_code)] use std::marker::PhantomData; diff --git a/tests/ui/self/elision/ref-self.stderr b/tests/ui/self/elision/ref-self.stderr index 64e7bfc1bb06c..f4540aaacefb1 100644 --- a/tests/ui/self/elision/ref-self.stderr +++ b/tests/ui/self/elision/ref-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-self.rs:26:9 + --> $DIR/ref-self.rs:25:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'a>(&self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:33:9 + --> $DIR/ref-self.rs:32:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'a>(self: &Self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:38:9 + --> $DIR/ref-self.rs:37:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'a>(self: Box<&Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:43:9 + --> $DIR/ref-self.rs:42:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:48:9 + --> $DIR/ref-self.rs:47:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:53:9 + --> $DIR/ref-self.rs:52:9 | LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -89,7 +89,7 @@ LL | fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:58:9 + --> $DIR/ref-self.rs:57:9 | LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | - - let's call the lifetime of this reference `'1` @@ -104,7 +104,7 @@ LL | fn wrap_ref_Self_Self<'a>(self: Wrap<&Self, Self>, f: &'a u8) -> &'a u8 | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:63:9 + --> $DIR/ref-self.rs:62:9 | LL | fn ref_box_Self(self: &Box, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/tests/ui/span/issue-27522.stderr b/tests/ui/span/issue-27522.stderr index c57a100bbe227..04904b0ddc1c5 100644 --- a/tests/ui/span/issue-27522.stderr +++ b/tests/ui/span/issue-27522.stderr @@ -4,8 +4,8 @@ error[E0307]: invalid `self` parameter type: `&SomeType` LL | fn handler(self: &SomeType); | ^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-where-sized.stderr b/tests/ui/suggestions/dyn-incompatible-trait-should-use-where-sized.stderr index beafd7c2ab00f..eb9f9196a7234 100644 --- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-where-sized.stderr +++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-where-sized.stderr @@ -32,8 +32,8 @@ error[E0307]: invalid `self` parameter type: `()` LL | fn bar(self: ()) {} | ^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/auxiliary/minicore.rs b/tests/ui/traits/const-traits/auxiliary/minicore.rs index 08d7817548d7c..eb4b43d74f2e3 100644 --- a/tests/ui/traits/const-traits/auxiliary/minicore.rs +++ b/tests/ui/traits/const-traits/auxiliary/minicore.rs @@ -103,13 +103,6 @@ pub trait FnOnce { #[lang = "tuple_trait"] pub trait Tuple {} -#[lang = "legacy_receiver"] -pub trait LegacyReceiver {} - -impl LegacyReceiver for &T {} - -impl LegacyReceiver for &mut T {} - #[lang = "receiver"] pub trait Receiver { #[lang = "receiver_target"] @@ -410,8 +403,6 @@ impl const Deref for Option { } } -impl LegacyReceiver for Pin

{} - impl Clone for RefCell { fn clone(&self) -> RefCell { RefCell::new(self.borrow().clone()) diff --git a/tests/ui/traits/issue-78372.stderr b/tests/ui/traits/issue-78372.stderr index 86234d15a5d4b..1c58915111f2c 100644 --- a/tests/ui/traits/issue-78372.stderr +++ b/tests/ui/traits/issue-78372.stderr @@ -61,8 +61,8 @@ error[E0307]: invalid `self` parameter type: `Smaht` LL | fn foo(self: Smaht); | ^^^^^^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion between structures --> $DIR/issue-78372.rs:3:1 diff --git a/tests/ui/type-alias-impl-trait/method_resolution3.rs b/tests/ui/type-alias-impl-trait/method_resolution3.rs index 0e6176bfe03c7..ec37d4dcda9f2 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution3.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution3.rs @@ -5,7 +5,7 @@ //@ revisions: current next //@[next] compile-flags: -Znext-solver -#![feature(type_alias_impl_trait, arbitrary_self_types)] +#![feature(type_alias_impl_trait)] type Foo = impl Copy; diff --git a/tests/ui/type-alias-impl-trait/method_resolution4.rs b/tests/ui/type-alias-impl-trait/method_resolution4.rs index f33b4e473ae86..909d9c44479c7 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution4.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution4.rs @@ -5,7 +5,7 @@ //@ revisions: current next //@[next] compile-flags: -Znext-solver -#![feature(type_alias_impl_trait, arbitrary_self_types)] +#![feature(type_alias_impl_trait)] mod foo { pub type Foo = impl Copy; diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr index 2a8c4edbdb5f3..36bdc714e050b 100644 --- a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr +++ b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr @@ -22,8 +22,8 @@ error[E0307]: invalid `self` parameter type: `isize` LL | fn foo(self: isize, x: isize) -> isize { | ^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0307]: invalid `self` parameter type: `Bar` --> $DIR/ufcs-explicit-self-bad.rs:19:18 @@ -31,8 +31,8 @@ error[E0307]: invalid `self` parameter type: `Bar` LL | fn foo(self: Bar, x: isize) -> isize { | ^^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0307]: invalid `self` parameter type: `&Bar` --> $DIR/ufcs-explicit-self-bad.rs:23:18 @@ -40,8 +40,8 @@ error[E0307]: invalid `self` parameter type: `&Bar` LL | fn bar(self: &Bar, x: isize) -> isize { | ^^^^^^^^^^^ | - = note: type of `self` must be `Self` or a type that dereferences to it - = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) + = note: type of `self` must be `Self` or some type implementing `Receiver` + = help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box`, `self: Rc`, or `self: Arc` error[E0308]: mismatched `self` parameter type --> $DIR/ufcs-explicit-self-bad.rs:37:21