From 2083e2a6473ea9d2fc65097844c9e0fec899b225 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Mon, 9 Sep 2019 15:27:33 -0700 Subject: [PATCH] Stabilize nested self receivers Previously, only Self, &Self, &mut Self, Arc, Rc, and Box were available as stable method receivers. This commit stabilizes nested uses of all the above types. However, nested receivers remain non-object-safe. --- src/librustc_typeck/check/wfcheck.rs | 81 ++++++---- ...ary-self-types-not-object-safe.curr.stderr | 4 +- ...bject-safe.object_safe_for_dispatch.stderr | 2 +- .../arbitrary-self-types-not-object-safe.rs | 1 - ...rbitrary-self-types-not-object-safe.stderr | 4 +- .../ui/self/arbitrary_self_types_nested.rs | 36 +++++ .../ui/self/arbitrary_self_types_struct.rs | 1 - .../ui/self/arbitrary_self_types_trait.rs | 1 - .../arbitrary_self_types_unsized_struct.rs | 1 - src/test/ui/self/elision/alias-async.rs | 1 - src/test/ui/self/elision/alias.rs | 1 - src/test/ui/self/elision/assoc-async.rs | 1 - src/test/ui/self/elision/assoc.rs | 1 - src/test/ui/self/elision/lt-alias-async.rs | 1 - src/test/ui/self/elision/lt-alias.rs | 1 - src/test/ui/self/elision/lt-assoc-async.rs | 1 - src/test/ui/self/elision/lt-assoc.rs | 1 - .../self/elision/lt-ref-self-async.nll.stderr | 24 +-- src/test/ui/self/elision/lt-ref-self-async.rs | 1 - .../ui/self/elision/lt-ref-self-async.stderr | 12 +- .../ui/self/elision/lt-ref-self.nll.stderr | 12 +- src/test/ui/self/elision/lt-ref-self.rs | 1 - src/test/ui/self/elision/lt-ref-self.stderr | 12 +- src/test/ui/self/elision/lt-self-async.rs | 1 - src/test/ui/self/elision/lt-self.rs | 1 - src/test/ui/self/elision/lt-struct-async.rs | 1 - src/test/ui/self/elision/lt-struct.rs | 1 - src/test/ui/self/elision/ref-alias-async.rs | 1 - src/test/ui/self/elision/ref-alias.rs | 1 - src/test/ui/self/elision/ref-assoc-async.rs | 1 - src/test/ui/self/elision/ref-assoc.rs | 1 - .../ui/self/elision/ref-mut-alias-async.rs | 1 - src/test/ui/self/elision/ref-mut-alias.rs | 1 - .../elision/ref-mut-self-async.nll.stderr | 24 +-- .../ui/self/elision/ref-mut-self-async.rs | 1 - .../ui/self/elision/ref-mut-self-async.stderr | 12 +- .../ui/self/elision/ref-mut-self.nll.stderr | 12 +- src/test/ui/self/elision/ref-mut-self.rs | 1 - src/test/ui/self/elision/ref-mut-self.stderr | 12 +- .../elision/ref-mut-struct-async.nll.stderr | 20 +-- .../ui/self/elision/ref-mut-struct-async.rs | 1 - .../self/elision/ref-mut-struct-async.stderr | 10 +- .../ui/self/elision/ref-mut-struct.nll.stderr | 10 +- src/test/ui/self/elision/ref-mut-struct.rs | 1 - .../ui/self/elision/ref-mut-struct.stderr | 10 +- .../ui/self/elision/ref-self-async.nll.stderr | 139 +----------------- src/test/ui/self/elision/ref-self-async.rs | 1 - .../ui/self/elision/ref-self-async.stderr | 14 +- .../self/elision/ref-struct-async.nll.stderr | 20 +-- src/test/ui/self/elision/ref-struct-async.rs | 1 - .../ui/self/elision/ref-struct-async.stderr | 10 +- .../ui/self/elision/ref-struct.nll.stderr | 10 +- src/test/ui/self/elision/ref-struct.rs | 1 - src/test/ui/self/elision/ref-struct.stderr | 10 +- src/test/ui/self/elision/self-async.rs | 1 - src/test/ui/self/elision/self.rs | 1 - src/test/ui/self/elision/struct-async.rs | 1 - src/test/ui/self/elision/struct.rs | 1 - 58 files changed, 215 insertions(+), 320 deletions(-) create mode 100644 src/test/ui/self/arbitrary_self_types_nested.rs diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 6508295b8ed..f25dfa733c4 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,45 +937,44 @@ 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 - } - }; - - let trait_ref = ty::TraitRef{ - def_id: trait_def_id, - substs: fcx.tcx.mk_substs_trait(receiver_ty, &[]), - }; - - 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 !arbitrary_self_types_enabled + && !receiver_is_implemented(fcx, receiver_trait_def_id, cause.clone(), receiver_ty) + { + return false } 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() + ); + + if fcx.predicate_must_hold_modulo_regions(&obligation) { + true + } else { + debug!("receiver_is_implemented: type `{:?}` does not implement `Receiver` trait", + receiver_ty); + false + } +} + fn check_variances_for_type_defn<'tcx>( tcx: TyCtxt<'tcx>, item: &hir::Item, 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 cdffc1d86ed..653ccb9db94 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 725632a1212..33f1fa2e51b 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 2eeabad28db..40e8df3395f 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 e6eba377a95..353da8fd20b 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 00000000000..680196fbb92 --- /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 cf62cd3a4e6..905ad83b659 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 fb06344df7e..973c7cae85a 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 b78223fd57c..d43f3132890 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 9743c139096..7c0dd068623 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 b5aacfaeec4..0c801d70232 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 fa5968de5ac..363b7fc2aae 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 163eb49383a..fa39a2b478b 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 cc5badaaa6e..3a6f8471e66 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 df2300deda2..bbba88e4e5b 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 f060800e4da..0d3ff630d14 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 70573598fcb..8f354313536 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 b4f8ff6001d..1288759703f 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 5aba7cfcf29..ef6cbe7772c 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 235b71ccab3..badd973c37f 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 e97a01e746d..a0c56f22218 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 8abf2876a5c..423c7d5822d 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 afd07d38f2f..f392580d422 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 42647b82ef8..4cedaf79da3 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 9b0ee5e42a5..cf74f892b8f 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 dc5a53b89d7..abbee7fdfcb 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 e41dfbbe0bf..799c6c079b3 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 4b02c2fd00c..15f16525b6b 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 d83ac612235..341f5b52df0 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 258e27b7cb3..ad10d8ba4f4 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 f9354bc8847..2f02cb5f3c8 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 5f9ccf3bc7f..2c3f971d26e 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 395816f8f5d..ce1ab3ffcca 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 b6f2b63f093..24e3f7a098f 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 b8eb416d904..1e65605036d 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 a656808d46b..73d942a83f8 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 3a8ae3fdcba..4e7d7f521d2 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 a7ea47bb7f6..8d9359dbd94 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 3d6ae4b3dd3..46d849741eb 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 fa78543bd87..c0423d1d3e6 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 1822a9a468b..990f485907f 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 2dc8cdb7d28..7d613c57448 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 66152ba40a5..cec7034cd9f 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 795ddf8ac13..05e275b19e4 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 3fec398bb98..c824f2cac98 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 88fd2101bc6..46468b693ee 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 + = 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: 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 `'_` +error: aborting due to previous error -error: aborting due to 14 previous errors - -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 9425fbfca8f..6a98b79cb3b 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 bda958241b6..b73290b024f 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 93fec69ec34..6f413a7f49f 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 64c84c4cd2e..e6bd5418c8d 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 49a2a00953d..fc85450c4a7 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 a258bc9f743..31bb9f49a6c 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 342d6d2b363..73711a7feea 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 5116488dd22..a6967309143 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 e1379bfaf2e..eb01cfc9768 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 dbcef71ba14..574b7e7c9b3 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 4a38a2164c8..e018e0daf96 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 227e993bd3c..d1ac99d13be 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;