diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 6508295b8edca..f25dfa733c4b8 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -2,7 +2,7 @@ use crate::check::{Inherited, FnCtxt}; use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter}; use crate::hir::def_id::DefId; -use rustc::traits::{self, ObligationCauseCode}; +use rustc::traits::{self, ObligationCause, ObligationCauseCode}; use rustc::ty::{self, Ty, TyCtxt, GenericParamDefKind, TypeFoldable, ToPredicate}; use rustc::ty::subst::{Subst, InternalSubsts}; use rustc::util::nodemap::{FxHashSet, FxHashMap}; @@ -895,6 +895,11 @@ fn receiver_is_valid<'fcx, 'tcx>( // The first type is `receiver_ty`, which we know its not equal to `self_ty`; skip it. autoderef.next(); + let receiver_trait_def_id = fcx.tcx.require_lang_item( + lang_items::ReceiverTraitLangItem, + None, + ); + // Keep dereferencing `receiver_ty` until we get to `self_ty`. loop { if let Some((potential_self_ty, _)) = autoderef.next() { @@ -911,6 +916,19 @@ fn receiver_is_valid<'fcx, 'tcx>( } break + } else { + // Without `feature(arbitrary_self_types)`, we require that each step in the + // deref chain implement `receiver` + if !arbitrary_self_types_enabled + && !receiver_is_implemented( + fcx, + receiver_trait_def_id, + cause.clone(), + potential_self_ty, + ) + { + return false + } } } else { debug!("receiver_is_valid: type `{:?}` does not deref to `{:?}`", @@ -919,43 +937,42 @@ fn receiver_is_valid<'fcx, 'tcx>( // unecessary errors (#58712). return receiver_ty.references_error(); } - - // Without the `arbitrary_self_types` feature, `receiver_ty` must directly deref to - // `self_ty`. Enforce this by only doing one iteration of the loop. - if !arbitrary_self_types_enabled { - return false - } } // Without `feature(arbitrary_self_types)`, we require that `receiver_ty` implements `Receiver`. - if !arbitrary_self_types_enabled { - let trait_def_id = match fcx.tcx.lang_items().receiver_trait() { - Some(did) => did, - None => { - debug!("receiver_is_valid: missing Receiver trait"); - return false - } - }; + if !arbitrary_self_types_enabled + && !receiver_is_implemented(fcx, receiver_trait_def_id, cause.clone(), receiver_ty) + { + return false + } - let trait_ref = ty::TraitRef{ - def_id: trait_def_id, - substs: fcx.tcx.mk_substs_trait(receiver_ty, &[]), - }; + true +} + +fn receiver_is_implemented( + fcx: &FnCtxt<'_, 'tcx>, + receiver_trait_def_id: DefId, + cause: ObligationCause<'tcx>, + receiver_ty: Ty<'tcx>, +) -> bool { + let trait_ref = ty::TraitRef{ + def_id: receiver_trait_def_id, + substs: fcx.tcx.mk_substs_trait(receiver_ty, &[]), + }; - let obligation = traits::Obligation::new( - cause, - fcx.param_env, - trait_ref.to_predicate() - ); + let obligation = traits::Obligation::new( + cause, + fcx.param_env, + trait_ref.to_predicate() + ); - if !fcx.predicate_must_hold_modulo_regions(&obligation) { - debug!("receiver_is_valid: type `{:?}` does not implement `Receiver` trait", - receiver_ty); - return false - } + if fcx.predicate_must_hold_modulo_regions(&obligation) { + true + } else { + debug!("receiver_is_implemented: type `{:?}` does not implement `Receiver` trait", + receiver_ty); + false } - - true } fn check_variances_for_type_defn<'tcx>( diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr index cdffc1d86edfb..653ccb9db949a 100644 --- a/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr +++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr @@ -1,5 +1,5 @@ error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:34:32 + --> $DIR/arbitrary-self-types-not-object-safe.rs:33:32 | LL | fn foo(self: &Rc) -> usize; | --- method `foo`'s `self` parameter cannot be dispatched on @@ -8,7 +8,7 @@ LL | let x = Rc::new(5usize) as Rc; | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:34:13 + --> $DIR/arbitrary-self-types-not-object-safe.rs:33:13 | LL | fn foo(self: &Rc) -> usize; | --- method `foo`'s `self` parameter cannot be dispatched on diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr index 725632a12126e..33f1fa2e51be3 100644 --- a/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr +++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr @@ -1,5 +1,5 @@ error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:34:13 + --> $DIR/arbitrary-self-types-not-object-safe.rs:33:13 | LL | fn foo(self: &Rc) -> usize; | --- method `foo`'s `self` parameter cannot be dispatched on diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.rs b/src/test/ui/self/arbitrary-self-types-not-object-safe.rs index 2eeabad28db02..40e8df3395f6e 100644 --- a/src/test/ui/self/arbitrary-self-types-not-object-safe.rs +++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.rs @@ -1,7 +1,6 @@ // revisions: curr object_safe_for_dispatch #![cfg_attr(object_safe_for_dispatch, feature(object_safe_for_dispatch))] -#![feature(arbitrary_self_types)] use std::rc::Rc; diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr index e6eba377a9578..353da8fd20b22 100644 --- a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr +++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr @@ -1,5 +1,5 @@ error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:31:32 + --> $DIR/arbitrary-self-types-not-object-safe.rs:29:32 | LL | fn foo(self: &Rc) -> usize; | --- method `foo`'s `self` parameter cannot be dispatched on @@ -8,7 +8,7 @@ LL | let x = Rc::new(5usize) as Rc; | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:31:13 + --> $DIR/arbitrary-self-types-not-object-safe.rs:29:13 | LL | fn foo(self: &Rc) -> usize; | --- method `foo`'s `self` parameter cannot be dispatched on diff --git a/src/test/ui/self/arbitrary_self_types_nested.rs b/src/test/ui/self/arbitrary_self_types_nested.rs new file mode 100644 index 0000000000000..680196fbb92f6 --- /dev/null +++ b/src/test/ui/self/arbitrary_self_types_nested.rs @@ -0,0 +1,36 @@ +// run-pass + +use { + std::{ + rc::Rc, + sync::Arc, + }, +}; + +#[derive(Default)] +struct Ty; + +trait Trait { + fn receive_trait(self: &Arc>>) -> u32; +} + +const TRAIT_MAGIC: u32 = 42; +const INHERENT_MAGIC: u32 = 1995; + +impl Trait for Ty { + fn receive_trait(self: &Arc>>) -> u32 { + TRAIT_MAGIC + } +} + +impl Ty { + fn receive_inherent(self: &Arc>>) -> u32 { + INHERENT_MAGIC + } +} + +fn main() { + let ty = >>>::default(); + assert_eq!(TRAIT_MAGIC, ty.receive_trait()); + assert_eq!(INHERENT_MAGIC, ty.receive_inherent()); +} diff --git a/src/test/ui/self/arbitrary_self_types_struct.rs b/src/test/ui/self/arbitrary_self_types_struct.rs index cf62cd3a4e639..905ad83b659d4 100644 --- a/src/test/ui/self/arbitrary_self_types_struct.rs +++ b/src/test/ui/self/arbitrary_self_types_struct.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(arbitrary_self_types)] use std::rc::Rc; diff --git a/src/test/ui/self/arbitrary_self_types_trait.rs b/src/test/ui/self/arbitrary_self_types_trait.rs index fb06344df7ed0..973c7cae85a94 100644 --- a/src/test/ui/self/arbitrary_self_types_trait.rs +++ b/src/test/ui/self/arbitrary_self_types_trait.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(arbitrary_self_types)] use std::rc::Rc; diff --git a/src/test/ui/self/arbitrary_self_types_unsized_struct.rs b/src/test/ui/self/arbitrary_self_types_unsized_struct.rs index b78223fd57cf6..d43f3132890b5 100644 --- a/src/test/ui/self/arbitrary_self_types_unsized_struct.rs +++ b/src/test/ui/self/arbitrary_self_types_unsized_struct.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(arbitrary_self_types)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/alias-async.rs b/src/test/ui/self/elision/alias-async.rs index 9743c13909658..7c0dd068623f3 100644 --- a/src/test/ui/self/elision/alias-async.rs +++ b/src/test/ui/self/elision/alias-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/alias.rs b/src/test/ui/self/elision/alias.rs index b5aacfaeec427..0c801d7023212 100644 --- a/src/test/ui/self/elision/alias.rs +++ b/src/test/ui/self/elision/alias.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/assoc-async.rs b/src/test/ui/self/elision/assoc-async.rs index fa5968de5acc2..363b7fc2aaeb2 100644 --- a/src/test/ui/self/elision/assoc-async.rs +++ b/src/test/ui/self/elision/assoc-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/assoc.rs b/src/test/ui/self/elision/assoc.rs index 163eb49383a87..fa39a2b478b1e 100644 --- a/src/test/ui/self/elision/assoc.rs +++ b/src/test/ui/self/elision/assoc.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-alias-async.rs b/src/test/ui/self/elision/lt-alias-async.rs index cc5badaaa6ef6..3a6f8471e6642 100644 --- a/src/test/ui/self/elision/lt-alias-async.rs +++ b/src/test/ui/self/elision/lt-alias-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-alias.rs b/src/test/ui/self/elision/lt-alias.rs index df2300deda25f..bbba88e4e5bb9 100644 --- a/src/test/ui/self/elision/lt-alias.rs +++ b/src/test/ui/self/elision/lt-alias.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-assoc-async.rs b/src/test/ui/self/elision/lt-assoc-async.rs index f060800e4da52..0d3ff630d14e7 100644 --- a/src/test/ui/self/elision/lt-assoc-async.rs +++ b/src/test/ui/self/elision/lt-assoc-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-assoc.rs b/src/test/ui/self/elision/lt-assoc.rs index 70573598fcb16..8f3543135365c 100644 --- a/src/test/ui/self/elision/lt-assoc.rs +++ b/src/test/ui/self/elision/lt-assoc.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr b/src/test/ui/self/elision/lt-ref-self-async.nll.stderr index b4f8ff6001d60..1288759703f69 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/lt-ref-self-async.nll.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:13:42 + --> $DIR/lt-ref-self-async.rs:12:42 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | ^^^^ @@ -7,7 +7,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:14:9 + --> $DIR/lt-ref-self-async.rs:13:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | - @@ -18,7 +18,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:19:48 + --> $DIR/lt-ref-self-async.rs:18:48 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | ^^^^ @@ -26,7 +26,7 @@ LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:20:9 + --> $DIR/lt-ref-self-async.rs:19:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | - @@ -37,7 +37,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:23:57 + --> $DIR/lt-ref-self-async.rs:22:57 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | ^^^^ @@ -45,7 +45,7 @@ LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:24:9 + --> $DIR/lt-ref-self-async.rs:23:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - @@ -56,7 +56,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:27:57 + --> $DIR/lt-ref-self-async.rs:26:57 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | ^^^^ @@ -64,7 +64,7 @@ LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:28:9 + --> $DIR/lt-ref-self-async.rs:27:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - @@ -75,7 +75,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:31:66 + --> $DIR/lt-ref-self-async.rs:30:66 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -83,7 +83,7 @@ LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:32:9 + --> $DIR/lt-ref-self-async.rs:31:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - @@ -94,7 +94,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/lt-ref-self-async.rs:35:62 + --> $DIR/lt-ref-self-async.rs:34:62 | LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -102,7 +102,7 @@ LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#23r error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:36:9 + --> $DIR/lt-ref-self-async.rs:35:9 | LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | - diff --git a/src/test/ui/self/elision/lt-ref-self-async.rs b/src/test/ui/self/elision/lt-ref-self-async.rs index 5aba7cfcf296e..ef6cbe7772c27 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.rs +++ b/src/test/ui/self/elision/lt-ref-self-async.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/lt-ref-self-async.stderr b/src/test/ui/self/elision/lt-ref-self-async.stderr index 235b71ccab3a8..badd973c37f08 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.stderr +++ b/src/test/ui/self/elision/lt-ref-self-async.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:14:9 + --> $DIR/lt-ref-self-async.rs:13:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | ----- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:20:9 + --> $DIR/lt-ref-self-async.rs:19:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | ----- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:24:9 + --> $DIR/lt-ref-self-async.rs:23:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | ----- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:28:9 + --> $DIR/lt-ref-self-async.rs:27:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | ----- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:32:9 + --> $DIR/lt-ref-self-async.rs:31:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ----- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:36:9 + --> $DIR/lt-ref-self-async.rs:35:9 | LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | ----- ---- diff --git a/src/test/ui/self/elision/lt-ref-self.nll.stderr b/src/test/ui/self/elision/lt-ref-self.nll.stderr index e97a01e746d4b..a0c56f2221850 100644 --- a/src/test/ui/self/elision/lt-ref-self.nll.stderr +++ b/src/test/ui/self/elision/lt-ref-self.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:12:9 + --> $DIR/lt-ref-self.rs:11:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -9,7 +9,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:18:9 + --> $DIR/lt-ref-self.rs:17:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -19,7 +19,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:22:9 + --> $DIR/lt-ref-self.rs:21:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:26:9 + --> $DIR/lt-ref-self.rs:25:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -39,7 +39,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:30:9 + --> $DIR/lt-ref-self.rs:29:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -49,7 +49,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:34:9 + --> $DIR/lt-ref-self.rs:33:9 | LL | fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/lt-ref-self.rs b/src/test/ui/self/elision/lt-ref-self.rs index 8abf2876a5c1b..423c7d5822df7 100644 --- a/src/test/ui/self/elision/lt-ref-self.rs +++ b/src/test/ui/self/elision/lt-ref-self.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/lt-ref-self.stderr b/src/test/ui/self/elision/lt-ref-self.stderr index afd07d38f2fe4..f392580d42209 100644 --- a/src/test/ui/self/elision/lt-ref-self.stderr +++ b/src/test/ui/self/elision/lt-ref-self.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:12:9 + --> $DIR/lt-ref-self.rs:11:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:18:9 + --> $DIR/lt-ref-self.rs:17:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:22:9 + --> $DIR/lt-ref-self.rs:21:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:26:9 + --> $DIR/lt-ref-self.rs:25:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:30:9 + --> $DIR/lt-ref-self.rs:29:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ---- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:34:9 + --> $DIR/lt-ref-self.rs:33:9 | LL | fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/lt-self-async.rs b/src/test/ui/self/elision/lt-self-async.rs index 42647b82ef8e7..4cedaf79da3a3 100644 --- a/src/test/ui/self/elision/lt-self-async.rs +++ b/src/test/ui/self/elision/lt-self-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/lt-self.rs b/src/test/ui/self/elision/lt-self.rs index 9b0ee5e42a51a..cf74f892b8fce 100644 --- a/src/test/ui/self/elision/lt-self.rs +++ b/src/test/ui/self/elision/lt-self.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/lt-struct-async.rs b/src/test/ui/self/elision/lt-struct-async.rs index dc5a53b89d786..abbee7fdfcb87 100644 --- a/src/test/ui/self/elision/lt-struct-async.rs +++ b/src/test/ui/self/elision/lt-struct-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/lt-struct.rs b/src/test/ui/self/elision/lt-struct.rs index e41dfbbe0bf0d..799c6c079b34d 100644 --- a/src/test/ui/self/elision/lt-struct.rs +++ b/src/test/ui/self/elision/lt-struct.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/ref-alias-async.rs b/src/test/ui/self/elision/ref-alias-async.rs index 4b02c2fd00c86..15f16525b6b1c 100644 --- a/src/test/ui/self/elision/ref-alias-async.rs +++ b/src/test/ui/self/elision/ref-alias-async.rs @@ -1,7 +1,6 @@ // edition:2018 // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-alias.rs b/src/test/ui/self/elision/ref-alias.rs index d83ac612235e3..341f5b52df0ad 100644 --- a/src/test/ui/self/elision/ref-alias.rs +++ b/src/test/ui/self/elision/ref-alias.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-assoc-async.rs b/src/test/ui/self/elision/ref-assoc-async.rs index 258e27b7cb3bc..ad10d8ba4f4e2 100644 --- a/src/test/ui/self/elision/ref-assoc-async.rs +++ b/src/test/ui/self/elision/ref-assoc-async.rs @@ -1,7 +1,6 @@ // edition:2018 // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-assoc.rs b/src/test/ui/self/elision/ref-assoc.rs index f9354bc884710..2f02cb5f3c8af 100644 --- a/src/test/ui/self/elision/ref-assoc.rs +++ b/src/test/ui/self/elision/ref-assoc.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-alias-async.rs b/src/test/ui/self/elision/ref-mut-alias-async.rs index 5f9ccf3bc7f2b..2c3f971d26e8b 100644 --- a/src/test/ui/self/elision/ref-mut-alias-async.rs +++ b/src/test/ui/self/elision/ref-mut-alias-async.rs @@ -1,7 +1,6 @@ // edition:2018 // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-alias.rs b/src/test/ui/self/elision/ref-mut-alias.rs index 395816f8f5d80..ce1ab3ffccaba 100644 --- a/src/test/ui/self/elision/ref-mut-alias.rs +++ b/src/test/ui/self/elision/ref-mut-alias.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr b/src/test/ui/self/elision/ref-mut-self-async.nll.stderr index b6f2b63f093b1..24e3f7a098fb1 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-self-async.nll.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:13:46 + --> $DIR/ref-mut-self-async.rs:12:46 | LL | async fn ref_self(&mut self, f: &u32) -> &u32 { | ^^^^ @@ -7,7 +7,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:14:9 + --> $DIR/ref-mut-self-async.rs:13:9 | LL | async fn ref_self(&mut self, f: &u32) -> &u32 { | - @@ -18,7 +18,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:19:52 + --> $DIR/ref-mut-self-async.rs:18:52 | LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | ^^^^ @@ -26,7 +26,7 @@ LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:20:9 + --> $DIR/ref-mut-self-async.rs:19:9 | LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | - @@ -37,7 +37,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:23:61 + --> $DIR/ref-mut-self-async.rs:22:61 | LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | ^^^^ @@ -45,7 +45,7 @@ LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:24:9 + --> $DIR/ref-mut-self-async.rs:23:9 | LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | - @@ -56,7 +56,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:27:61 + --> $DIR/ref-mut-self-async.rs:26:61 | LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | ^^^^ @@ -64,7 +64,7 @@ LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:28:9 + --> $DIR/ref-mut-self-async.rs:27:9 | LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | - @@ -75,7 +75,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:31:70 + --> $DIR/ref-mut-self-async.rs:30:70 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -83,7 +83,7 @@ LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:32:9 + --> $DIR/ref-mut-self-async.rs:31:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - @@ -94,7 +94,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-self-async.rs:35:70 + --> $DIR/ref-mut-self-async.rs:34:70 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -102,7 +102,7 @@ LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:36:9 + --> $DIR/ref-mut-self-async.rs:35:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - diff --git a/src/test/ui/self/elision/ref-mut-self-async.rs b/src/test/ui/self/elision/ref-mut-self-async.rs index b8eb416d90432..1e65605036d6f 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.rs +++ b/src/test/ui/self/elision/ref-mut-self-async.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-self-async.stderr b/src/test/ui/self/elision/ref-mut-self-async.stderr index a656808d46bc2..73d942a83f89a 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.stderr +++ b/src/test/ui/self/elision/ref-mut-self-async.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:14:9 + --> $DIR/ref-mut-self-async.rs:13:9 | LL | async fn ref_self(&mut self, f: &u32) -> &u32 { | --------- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:20:9 + --> $DIR/ref-mut-self-async.rs:19:9 | LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | --------- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:24:9 + --> $DIR/ref-mut-self-async.rs:23:9 | LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | --------- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:28:9 + --> $DIR/ref-mut-self-async.rs:27:9 | LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | --------- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:32:9 + --> $DIR/ref-mut-self-async.rs:31:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | --------- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:36:9 + --> $DIR/ref-mut-self-async.rs:35:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | --------- ---- diff --git a/src/test/ui/self/elision/ref-mut-self.nll.stderr b/src/test/ui/self/elision/ref-mut-self.nll.stderr index 3a8ae3fdcba8c..4e7d7f521d256 100644 --- a/src/test/ui/self/elision/ref-mut-self.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-self.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:12:9 + --> $DIR/ref-mut-self.rs:11:9 | LL | fn ref_self(&mut self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -9,7 +9,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:18:9 + --> $DIR/ref-mut-self.rs:17:9 | LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -19,7 +19,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:22:9 + --> $DIR/ref-mut-self.rs:21:9 | LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:26:9 + --> $DIR/ref-mut-self.rs:25:9 | LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -39,7 +39,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:30:9 + --> $DIR/ref-mut-self.rs:29:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -49,7 +49,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:34:9 + --> $DIR/ref-mut-self.rs:33:9 | LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-self.rs b/src/test/ui/self/elision/ref-mut-self.rs index a7ea47bb7f6de..8d9359dbd94b5 100644 --- a/src/test/ui/self/elision/ref-mut-self.rs +++ b/src/test/ui/self/elision/ref-mut-self.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-self.stderr b/src/test/ui/self/elision/ref-mut-self.stderr index 3d6ae4b3dd388..46d849741ebe3 100644 --- a/src/test/ui/self/elision/ref-mut-self.stderr +++ b/src/test/ui/self/elision/ref-mut-self.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:12:9 + --> $DIR/ref-mut-self.rs:11:9 | LL | fn ref_self(&mut self, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:18:9 + --> $DIR/ref-mut-self.rs:17:9 | LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:22:9 + --> $DIR/ref-mut-self.rs:21:9 | LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:26:9 + --> $DIR/ref-mut-self.rs:25:9 | LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:30:9 + --> $DIR/ref-mut-self.rs:29:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ---- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:34:9 + --> $DIR/ref-mut-self.rs:33:9 | LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr b/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr index fa78543bd87ab..c0423d1d3e669 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-struct-async.rs:13:56 + --> $DIR/ref-mut-struct-async.rs:12:56 | LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | ^^^^ @@ -7,7 +7,7 @@ LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:14:9 + --> $DIR/ref-mut-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | - @@ -18,7 +18,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-struct-async.rs:17:65 + --> $DIR/ref-mut-struct-async.rs:16:65 | LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | ^^^^ @@ -26,7 +26,7 @@ LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:18:9 + --> $DIR/ref-mut-struct-async.rs:17:9 | LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | - @@ -37,7 +37,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-struct-async.rs:21:65 + --> $DIR/ref-mut-struct-async.rs:20:65 | LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | ^^^^ @@ -45,7 +45,7 @@ LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:22:9 + --> $DIR/ref-mut-struct-async.rs:21:9 | LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | - @@ -56,7 +56,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-struct-async.rs:25:74 + --> $DIR/ref-mut-struct-async.rs:24:74 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -64,7 +64,7 @@ LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:26:9 + --> $DIR/ref-mut-struct-async.rs:25:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - @@ -75,7 +75,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-mut-struct-async.rs:29:74 + --> $DIR/ref-mut-struct-async.rs:28:74 | LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -83,7 +83,7 @@ LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:30:9 + --> $DIR/ref-mut-struct-async.rs:29:9 | LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | - diff --git a/src/test/ui/self/elision/ref-mut-struct-async.rs b/src/test/ui/self/elision/ref-mut-struct-async.rs index 1822a9a468b0e..990f485907f8e 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.rs +++ b/src/test/ui/self/elision/ref-mut-struct-async.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-struct-async.stderr b/src/test/ui/self/elision/ref-mut-struct-async.stderr index 2dc8cdb7d28ec..7d613c574486c 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.stderr +++ b/src/test/ui/self/elision/ref-mut-struct-async.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:14:9 + --> $DIR/ref-mut-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | ----------- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:18:9 + --> $DIR/ref-mut-struct-async.rs:17:9 | LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | ----------- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:22:9 + --> $DIR/ref-mut-struct-async.rs:21:9 | LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | ----------- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:26:9 + --> $DIR/ref-mut-struct-async.rs:25:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ----------- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:30:9 + --> $DIR/ref-mut-struct-async.rs:29:9 | LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | ----------- ---- diff --git a/src/test/ui/self/elision/ref-mut-struct.nll.stderr b/src/test/ui/self/elision/ref-mut-struct.nll.stderr index 66152ba40a5f5..cec7034cd9f9d 100644 --- a/src/test/ui/self/elision/ref-mut-struct.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-struct.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:12:9 + --> $DIR/ref-mut-struct.rs:11:9 | LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -9,7 +9,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:16:9 + --> $DIR/ref-mut-struct.rs:15:9 | LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -19,7 +19,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:20:9 + --> $DIR/ref-mut-struct.rs:19:9 | LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:24:9 + --> $DIR/ref-mut-struct.rs:23:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -39,7 +39,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:28:9 + --> $DIR/ref-mut-struct.rs:27:9 | LL | fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-struct.rs b/src/test/ui/self/elision/ref-mut-struct.rs index 795ddf8ac1354..05e275b19e4c4 100644 --- a/src/test/ui/self/elision/ref-mut-struct.rs +++ b/src/test/ui/self/elision/ref-mut-struct.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-mut-struct.stderr b/src/test/ui/self/elision/ref-mut-struct.stderr index 3fec398bb9879..c824f2cac983e 100644 --- a/src/test/ui/self/elision/ref-mut-struct.stderr +++ b/src/test/ui/self/elision/ref-mut-struct.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:12:9 + --> $DIR/ref-mut-struct.rs:11:9 | LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:16:9 + --> $DIR/ref-mut-struct.rs:15:9 | LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:20:9 + --> $DIR/ref-mut-struct.rs:19:9 | LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:24:9 + --> $DIR/ref-mut-struct.rs:23:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:28:9 + --> $DIR/ref-mut-struct.rs:27:9 | LL | fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/ref-self-async.nll.stderr b/src/test/ui/self/elision/ref-self-async.nll.stderr index 88fd2101bc619..46468b693ee98 100644 --- a/src/test/ui/self/elision/ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-self-async.nll.stderr @@ -1,136 +1,13 @@ -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:22:42 - | -LL | async fn ref_self(&self, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:23:9 - | -LL | async fn ref_self(&self, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:28:48 - | -LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:29:9 - | -LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:32:57 - | -LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:33:9 - | -LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:36:57 - | -LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:37:9 - | -LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:40:66 - | -LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:41:9 - | -LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:44:66 - | -LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:45:9 - | -LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-self-async.rs:48:69 +error[E0658]: `Wrap<&Struct, Struct>` cannot be used as the type of `self` without the `arbitrary_self_types` feature + --> $DIR/ref-self-async.rs:47:39 | LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { - | ^^^ - | - = note: hidden type `impl std::future::Future` captures lifetime '_#15r - -error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:49:9 + | ^^^^^^^^^^^^^^^^^ | -LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { - | - - | | - | lifetime `'_` defined here - | lifetime `'_` defined here -LL | f - | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + = note: for more information, see https://github.com/rust-lang/rust/issues/44874 + = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable + = 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`) -error: aborting due to 14 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0700`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/self/elision/ref-self-async.rs b/src/test/ui/self/elision/ref-self-async.rs index 9425fbfca8f08..6a98b79cb3bba 100644 --- a/src/test/ui/self/elision/ref-self-async.rs +++ b/src/test/ui/self/elision/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/src/test/ui/self/elision/ref-self-async.stderr b/src/test/ui/self/elision/ref-self-async.stderr index bda958241b67b..b73290b024f8f 100644 --- a/src/test/ui/self/elision/ref-self-async.stderr +++ b/src/test/ui/self/elision/ref-self-async.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:23:9 + --> $DIR/ref-self-async.rs:22:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | ----- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:29:9 + --> $DIR/ref-self-async.rs:28:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | ----- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:33:9 + --> $DIR/ref-self-async.rs:32:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | ----- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:37:9 + --> $DIR/ref-self-async.rs:36:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | ----- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:41:9 + --> $DIR/ref-self-async.rs:40:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | ----- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:45:9 + --> $DIR/ref-self-async.rs:44:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | ----- ---- @@ -59,7 +59,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:49:9 + --> $DIR/ref-self-async.rs:48:9 | LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | ----- --- diff --git a/src/test/ui/self/elision/ref-struct-async.nll.stderr b/src/test/ui/self/elision/ref-struct-async.nll.stderr index 93fec69ec343a..6f413a7f49fb8 100644 --- a/src/test/ui/self/elision/ref-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-struct-async.nll.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-struct-async.rs:13:52 + --> $DIR/ref-struct-async.rs:12:52 | LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | ^^^^ @@ -7,7 +7,7 @@ LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:14:9 + --> $DIR/ref-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | - @@ -18,7 +18,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-struct-async.rs:17:61 + --> $DIR/ref-struct-async.rs:16:61 | LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | ^^^^ @@ -26,7 +26,7 @@ LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:18:9 + --> $DIR/ref-struct-async.rs:17:9 | LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | - @@ -37,7 +37,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-struct-async.rs:21:61 + --> $DIR/ref-struct-async.rs:20:61 | LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | ^^^^ @@ -45,7 +45,7 @@ LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:22:9 + --> $DIR/ref-struct-async.rs:21:9 | LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | - @@ -56,7 +56,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-struct-async.rs:25:70 + --> $DIR/ref-struct-async.rs:24:70 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -64,7 +64,7 @@ LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:26:9 + --> $DIR/ref-struct-async.rs:25:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - @@ -75,7 +75,7 @@ LL | f | ^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ref-struct-async.rs:29:66 + --> $DIR/ref-struct-async.rs:28:66 | LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | ^^^^ @@ -83,7 +83,7 @@ LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { = note: hidden type `impl std::future::Future` captures lifetime '_#15r error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:30:9 + --> $DIR/ref-struct-async.rs:29:9 | LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | - diff --git a/src/test/ui/self/elision/ref-struct-async.rs b/src/test/ui/self/elision/ref-struct-async.rs index 64c84c4cd2eb9..e6bd5418c8d92 100644 --- a/src/test/ui/self/elision/ref-struct-async.rs +++ b/src/test/ui/self/elision/ref-struct-async.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-struct-async.stderr b/src/test/ui/self/elision/ref-struct-async.stderr index 49a2a00953d87..fc85450c4a7cd 100644 --- a/src/test/ui/self/elision/ref-struct-async.stderr +++ b/src/test/ui/self/elision/ref-struct-async.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:14:9 + --> $DIR/ref-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | ------- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:18:9 + --> $DIR/ref-struct-async.rs:17:9 | LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | ------- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:22:9 + --> $DIR/ref-struct-async.rs:21:9 | LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | ------- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:26:9 + --> $DIR/ref-struct-async.rs:25:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ------- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:30:9 + --> $DIR/ref-struct-async.rs:29:9 | LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | ------- ---- diff --git a/src/test/ui/self/elision/ref-struct.nll.stderr b/src/test/ui/self/elision/ref-struct.nll.stderr index a258bc9f74390..31bb9f49a6c4d 100644 --- a/src/test/ui/self/elision/ref-struct.nll.stderr +++ b/src/test/ui/self/elision/ref-struct.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:12:9 + --> $DIR/ref-struct.rs:11:9 | LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -9,7 +9,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-struct.rs:16:9 + --> $DIR/ref-struct.rs:15:9 | LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -19,7 +19,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-struct.rs:20:9 + --> $DIR/ref-struct.rs:19:9 | LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-struct.rs:24:9 + --> $DIR/ref-struct.rs:23:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -39,7 +39,7 @@ LL | f | ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/ref-struct.rs:28:9 + --> $DIR/ref-struct.rs:27:9 | LL | fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-struct.rs b/src/test/ui/self/elision/ref-struct.rs index 342d6d2b36357..73711a7feead3 100644 --- a/src/test/ui/self/elision/ref-struct.rs +++ b/src/test/ui/self/elision/ref-struct.rs @@ -1,4 +1,3 @@ -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::pin::Pin; diff --git a/src/test/ui/self/elision/ref-struct.stderr b/src/test/ui/self/elision/ref-struct.stderr index 5116488dd22bb..a69673091431c 100644 --- a/src/test/ui/self/elision/ref-struct.stderr +++ b/src/test/ui/self/elision/ref-struct.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:12:9 + --> $DIR/ref-struct.rs:11:9 | LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:16:9 + --> $DIR/ref-struct.rs:15:9 | LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:20:9 + --> $DIR/ref-struct.rs:19:9 | LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:24:9 + --> $DIR/ref-struct.rs:23:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:28:9 + --> $DIR/ref-struct.rs:27:9 | LL | fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/self-async.rs b/src/test/ui/self/elision/self-async.rs index e1379bfaf2e49..eb01cfc9768e6 100644 --- a/src/test/ui/self/elision/self-async.rs +++ b/src/test/ui/self/elision/self-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/self.rs b/src/test/ui/self/elision/self.rs index dbcef71ba14fc..574b7e7c9b3d6 100644 --- a/src/test/ui/self/elision/self.rs +++ b/src/test/ui/self/elision/self.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/struct-async.rs b/src/test/ui/self/elision/struct-async.rs index 4a38a2164c82a..e018e0daf9620 100644 --- a/src/test/ui/self/elision/struct-async.rs +++ b/src/test/ui/self/elision/struct-async.rs @@ -1,7 +1,6 @@ // check-pass // edition:2018 -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc; diff --git a/src/test/ui/self/elision/struct.rs b/src/test/ui/self/elision/struct.rs index 227e993bd3c61..d1ac99d13be7f 100644 --- a/src/test/ui/self/elision/struct.rs +++ b/src/test/ui/self/elision/struct.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(arbitrary_self_types)] #![allow(non_snake_case)] use std::rc::Rc;