Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril

Print lifetimes with backticks

Fixes #65287

r? @varkor
This commit is contained in:
Mazdak Farrokhzad 2019-10-14 07:36:54 +02:00 committed by GitHub
commit c2ae4ded4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
115 changed files with 260 additions and 260 deletions

View file

@ -200,7 +200,7 @@ impl<'tcx> TyCtxt<'tcx> {
{
sp = param.span;
}
(format!("the lifetime {} as defined on", br.name), sp)
(format!("the lifetime `{}` as defined on", br.name), sp)
}
ty::ReFree(ty::FreeRegion {
bound_region: ty::BoundRegion::BrNamed(_, name),
@ -213,7 +213,7 @@ impl<'tcx> TyCtxt<'tcx> {
{
sp = param.span;
}
(format!("the lifetime {} as defined on", name), sp)
(format!("the lifetime `{}` as defined on", name), sp)
}
ty::ReFree(ref fr) => match fr.bound_region {
ty::BrAnon(idx) => (
@ -221,7 +221,7 @@ impl<'tcx> TyCtxt<'tcx> {
self.hir().span(node),
),
_ => (
format!("the lifetime {} as defined on", region),
format!("the lifetime `{}` as defined on", region),
cm.def_span(self.hir().span(node)),
),
},

View file

@ -6,7 +6,7 @@ LL | const NAME: &'a str = "unit";
|
= note: expected type `&'static str`
found type `&'a str`
note: the lifetime 'a as defined on the impl at 6:6...
note: the lifetime `'a` as defined on the impl at 6:6...
--> $DIR/associated-const-impl-wrong-lifetime.rs:6:6
|
LL | impl<'a> Foo for &'a () {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | bar(foo, x)
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 37:8...
--> $DIR/project-fn-ret-contravariant.rs:37:8
|
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | bar(foo, x)
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 44:8...
--> $DIR/project-fn-ret-invariant.rs:44:8
|
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {

View file

@ -15,12 +15,12 @@ LL | foo: &dyn Foo, bar: &'a dyn Foo
LL | foo
| --- this return type evaluates to the `'static` lifetime...
|
note: ...can't outlive the lifetime '_ as defined on the method body at 11:14
note: ...can't outlive the lifetime `'_` as defined on the method body at 11:14
--> $DIR/issue-63388-2.rs:11:14
|
LL | foo: &dyn Foo, bar: &'a dyn Foo
| ^
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime '_ as defined on the method body at 11:14
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'_` as defined on the method body at 11:14
|
LL | foo + '_
|

View file

@ -24,12 +24,12 @@ LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d
|
= note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)`
found type `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)`
note: the lifetime 'c as defined on the method body at 27:24...
note: the lifetime `'c` as defined on the method body at 27:24...
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 27:24
note: ...does not necessarily outlive the lifetime `'c` as defined on the method body at 27:24
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {

View file

@ -14,7 +14,7 @@ LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<
LL | | ap
LL | | }
| |_^
note: ...does not necessarily outlive the lifetime 'f as defined on the function body at 7:37
note: ...does not necessarily outlive the lifetime `'f` as defined on the function body at 7:37
--> $DIR/variadic-ffi-4.rs:7:37
|
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {

View file

@ -11,7 +11,7 @@ note: the anonymous lifetime #2 defined on the body at 14:48...
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 11:36
note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 11:36
--> $DIR/expect-fn-supply-fn.rs:11:36
|
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
@ -25,7 +25,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
|
= note: expected type `fn(&u32)`
found type `fn(&'x u32)`
note: the lifetime 'x as defined on the function body at 11:36...
note: the lifetime `'x` as defined on the function body at 11:36...
--> $DIR/expect-fn-supply-fn.rs:11:36
|
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {

View file

@ -38,7 +38,7 @@ LL | |
LL | |
LL | | });
| |_____^
note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 32:30
note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 32:30
--> $DIR/expect-region-supply-region.rs:32:30
|
LL | fn expect_bound_supply_named<'x>() {
@ -52,7 +52,7 @@ LL | closure_expecting_bound(|x: &'x u32| {
|
= note: expected type `&u32`
found type `&'x u32`
note: the lifetime 'x as defined on the function body at 32:30...
note: the lifetime `'x` as defined on the function body at 32:30...
--> $DIR/expect-region-supply-region.rs:32:30
|
LL | fn expect_bound_supply_named<'x>() {

View file

@ -4,12 +4,12 @@ error[E0478]: lifetime bound not satisfied
LL | child: Box<dyn Wedding<'kiss> + 'SnowWhite>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime 'SnowWhite as defined on the struct at 3:22
note: lifetime parameter instantiated with the lifetime `'SnowWhite` as defined on the struct at 3:22
--> $DIR/E0478.rs:3:22
|
LL | struct Prince<'kiss, 'SnowWhite> {
| ^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'kiss as defined on the struct at 3:15
note: but lifetime parameter must outlive the lifetime `'kiss` as defined on the struct at 3:15
--> $DIR/E0478.rs:3:15
|
LL | struct Prince<'kiss, 'SnowWhite> {

View file

@ -6,12 +6,12 @@ LL | Foo<'b,'a>
|
= note: expected type `Foo<'a, 'b>`
found type `Foo<'b, 'a>`
note: the lifetime 'b as defined on the impl at 6:9...
note: the lifetime `'b` as defined on the impl at 6:9...
--> $DIR/explicit-self-lifetime-mismatch.rs:6:9
|
LL | impl<'a,'b> Foo<'a,'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 6:6
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 6:6
--> $DIR/explicit-self-lifetime-mismatch.rs:6:6
|
LL | impl<'a,'b> Foo<'a,'b> {
@ -25,12 +25,12 @@ LL | Foo<'b,'a>
|
= note: expected type `Foo<'a, 'b>`
found type `Foo<'b, 'a>`
note: the lifetime 'a as defined on the impl at 6:6...
note: the lifetime `'a` as defined on the impl at 6:6...
--> $DIR/explicit-self-lifetime-mismatch.rs:6:6
|
LL | impl<'a,'b> Foo<'a,'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 6:9
note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 6:9
--> $DIR/explicit-self-lifetime-mismatch.rs:6:9
|
LL | impl<'a,'b> Foo<'a,'b> {

View file

@ -10,7 +10,7 @@ LL | | fn(Inv<'y>)) }
|
= note: expected type `std::option::Option<fn(Inv<'y>)>`
found type `std::option::Option<fn(Inv<'x>)>`
note: the lifetime 'x as defined on the function body at 32:20...
note: the lifetime `'x` as defined on the function body at 32:20...
--> $DIR/hr-subtype.rs:32:20
|
LL | fn subtype<'x,'y:'x,'z:'y>() {
@ -19,7 +19,7 @@ LL | fn subtype<'x,'y:'x,'z:'y>() {
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation
note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 32:23
note: ...does not necessarily outlive the lifetime `'y` as defined on the function body at 32:23
--> $DIR/hr-subtype.rs:32:23
|
LL | fn subtype<'x,'y:'x,'z:'y>() {
@ -41,7 +41,7 @@ LL | | fn(Inv<'y>)) }
|
= note: expected type `std::option::Option<fn(Inv<'x>)>`
found type `std::option::Option<fn(Inv<'y>)>`
note: the lifetime 'x as defined on the function body at 38:22...
note: the lifetime `'x` as defined on the function body at 38:22...
--> $DIR/hr-subtype.rs:38:22
|
LL | fn supertype<'x,'y:'x,'z:'y>() {
@ -50,7 +50,7 @@ LL | fn supertype<'x,'y:'x,'z:'y>() {
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation
note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 38:25
note: ...does not necessarily outlive the lifetime `'y` as defined on the function body at 38:25
--> $DIR/hr-subtype.rs:38:25
|
LL | fn supertype<'x,'y:'x,'z:'y>() {

View file

@ -10,7 +10,7 @@ LL | | fn(&'y u32)) }
|
= note: expected type `std::option::Option<fn(&'x u32)>`
found type `std::option::Option<fn(&'y u32)>`
note: the lifetime 'x as defined on the function body at 38:22...
note: the lifetime `'x` as defined on the function body at 38:22...
--> $DIR/hr-subtype.rs:38:22
|
LL | fn supertype<'x,'y:'x,'z:'y>() {
@ -19,7 +19,7 @@ LL | fn supertype<'x,'y:'x,'z:'y>() {
LL | / check! { free_x_vs_free_y: (fn(&'x u32),
LL | | fn(&'y u32)) }
| |__________________________________________- in this macro invocation
note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 38:25
note: ...does not necessarily outlive the lifetime `'y` as defined on the function body at 38:25
--> $DIR/hr-subtype.rs:38:25
|
LL | fn supertype<'x,'y:'x,'z:'y>() {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | static_val(x);
| ^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 19:26...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 19:26...
--> $DIR/dyn-trait.rs:19:26
|
LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {

View file

@ -4,7 +4,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
| ^^^^^^^^^^^^^^
|
note: hidden type `&'a mut &'b T` captures the lifetime 'b as defined on the function body at 28:17
note: hidden type `&'a mut &'b T` captures the lifetime `'b` as defined on the function body at 28:17
--> $DIR/hidden-lifetimes.rs:28:17
|
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
@ -16,7 +16,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
| ^^^^^^^^^^^^^^
|
note: hidden type `std::rc::Rc<std::cell::RefCell<&'b T>>` captures the lifetime 'b as defined on the function body at 45:24
note: hidden type `std::rc::Rc<std::cell::RefCell<&'b T>>` captures the lifetime `'b` as defined on the function body at 45:24
--> $DIR/hidden-lifetimes.rs:45:24
|
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {

View file

@ -24,12 +24,12 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| |
| this return type evaluates to the `'static` lifetime...
|
note: ...can't outlive the lifetime 'a as defined on the function body at 6:13
note: ...can't outlive the lifetime `'a` as defined on the function body at 6:13
--> $DIR/must_outlive_least_region_or_bound.rs:6:13
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| ^^
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the function body at 6:13
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'a` as defined on the function body at 6:13
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ^^^^^^^^^^^^^^
@ -42,12 +42,12 @@ LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| |
| this return type evaluates to the `'static` lifetime...
|
note: ...can't outlive the lifetime 'a as defined on the function body at 12:15
note: ...can't outlive the lifetime `'a` as defined on the function body at 12:15
--> $DIR/must_outlive_least_region_or_bound.rs:12:15
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| ^^
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the function body at 12:15
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'a` as defined on the function body at 12:15
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static + 'a { x }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -4,7 +4,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
| ^^^^^^^^^^^^^^
|
note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 17:7
note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime `'x` as defined on the function body at 17:7
--> $DIR/region-escape-via-bound.rs:17:7
|
LL | where 'x: 'y

View file

@ -30,12 +30,12 @@ LL | self.x.iter().map(|a| a.0)
| |
| ...but this borrow...
|
note: ...can't outlive the lifetime 'a as defined on the method body at 10:20
note: ...can't outlive the lifetime `'a` as defined on the method body at 10:20
--> $DIR/static-return-lifetime-infered.rs:10:20
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
| ^^
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the method body at 10:20
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'a` as defined on the method body at 10:20
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -11,7 +11,7 @@ LL | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
LL | | x
LL | | }
| |_____^
note: ...but the lifetime must also be valid for the lifetime 'a as defined on the method body at 9:32...
note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the method body at 9:32...
--> $DIR/mismatched_trait_impl.rs:9:32
|
LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {

View file

@ -11,7 +11,7 @@ LL | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
LL | | x
LL | | }
| |_____^
note: ...but the lifetime must also be valid for the lifetime 'a as defined on the method body at 9:32...
note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the method body at 9:32...
--> $DIR/mismatched_trait_impl.rs:9:32
|
LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {

View file

@ -12,7 +12,7 @@ LL | drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
LL | | x
LL | | }));
| |_____^
note: ...but the borrowed content is only valid for the lifetime 'x as defined on the function body at 1:9
note: ...but the borrowed content is only valid for the lifetime `'x` as defined on the function body at 1:9
--> $DIR/issue-10291.rs:1:9
|
LL | fn test<'x>(x: &'x isize) {

View file

@ -16,7 +16,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | self.a();
| ^^^^
note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 1:9...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the trait at 1:9...
--> $DIR/issue-16683.rs:1:9
|
LL | trait T<'a> {

View file

@ -17,7 +17,7 @@ LL | |
LL | |
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 5:7
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 5:7
--> $DIR/issue-17740.rs:5:7
|
LL | impl <'a> Foo<'a>{
@ -31,7 +31,7 @@ LL | fn bar(self: &mut Foo) {
|
= note: expected type `Foo<'a>`
found type `Foo<'_>`
note: the lifetime 'a as defined on the impl at 5:7...
note: the lifetime `'a` as defined on the impl at 5:7...
--> $DIR/issue-17740.rs:5:7
|
LL | impl <'a> Foo<'a>{

View file

@ -17,7 +17,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | self.foo();
| ^^^^
note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 4:11...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the trait at 4:11...
--> $DIR/issue-17758.rs:4:11
|
LL | trait Foo<'a> {

View file

@ -15,7 +15,7 @@ LL | |
LL | | println!("{:?}", self);
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime '_ as defined on the impl at 5:5
note: ...does not necessarily outlive the lifetime `'_` as defined on the impl at 5:5
--> $DIR/issue-17905-2.rs:5:5
|
LL | &str,
@ -29,7 +29,7 @@ LL | fn say(self: &Pair<&str, isize>) {
|
= note: expected type `Pair<&str, _>`
found type `Pair<&str, _>`
note: the lifetime '_ as defined on the impl at 5:5...
note: the lifetime `'_` as defined on the impl at 5:5...
--> $DIR/issue-17905-2.rs:5:5
|
LL | &str,

View file

@ -23,7 +23,7 @@ LL | |
LL | | self.sub = t;
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 26:6
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 26:6
--> $DIR/issue-20831-debruijn.rs:26:6
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
@ -43,7 +43,7 @@ LL | | }
|
= note: expected type `'a`
found type `'_`
note: the lifetime 'a as defined on the impl at 26:6...
note: the lifetime `'a` as defined on the impl at 26:6...
--> $DIR/issue-20831-debruijn.rs:26:6
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
@ -83,7 +83,7 @@ LL | |
LL | | self.sub = t;
LL | | }
| |_____^
note: ...but the lifetime must also be valid for the lifetime 'a as defined on the impl at 26:6...
note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6...
--> $DIR/issue-20831-debruijn.rs:26:6
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {

View file

@ -11,7 +11,7 @@ note: the anonymous lifetime #1 defined on the method body at 5:5...
|
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the lifetime 'a as defined on the trait at 3:18
note: ...does not necessarily outlive the lifetime `'a` as defined on the trait at 3:18
--> $DIR/issue-27942.rs:3:18
|
LL | pub trait Buffer<'a, R: Resources<'a>> {
@ -25,7 +25,7 @@ LL | fn select(&self) -> BufferViewHandle<R>;
|
= note: expected type `Resources<'_>`
found type `Resources<'a>`
note: the lifetime 'a as defined on the trait at 3:18...
note: the lifetime `'a` as defined on the trait at 3:18...
--> $DIR/issue-27942.rs:3:18
|
LL | pub trait Buffer<'a, R: Resources<'a>> {

View file

@ -4,12 +4,12 @@ error[E0478]: lifetime bound not satisfied
LL | Foo::<'a, 'b>::xmute(u)
| ^^^^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime 'b as defined on the function body at 9:16
note: lifetime parameter instantiated with the lifetime `'b` as defined on the function body at 9:16
--> $DIR/issue-28848.rs:9:16
|
LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
| ^^
note: but lifetime parameter must outlive the lifetime 'a as defined on the function body at 9:12
note: but lifetime parameter must outlive the lifetime `'a` as defined on the function body at 9:12
--> $DIR/issue-28848.rs:9:12
|
LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {

View file

@ -21,7 +21,7 @@ LL | | {
LL | | Some(&mut self.0)
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 3:6
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 3:6
--> $DIR/issue-37884.rs:3:6
|
LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | match (&t,) {
| ^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 1:23...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 1:23...
--> $DIR/issue-52213.rs:1:23
|
LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
@ -12,7 +12,7 @@ LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
= note: ...so that the types are compatible:
expected (&&(T,),)
found (&&'a (T,),)
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 1:27...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27...
--> $DIR/issue-52213.rs:1:27
|
LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the trait at 5:17...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
--> $DIR/issue-55796.rs:5:17
|
LL | pub trait Graph<'a> {
@ -25,7 +25,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the trait at 5:17...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
--> $DIR/issue-55796.rs:5:17
|
LL | pub trait Graph<'a> {

View file

@ -6,7 +6,7 @@ LL | ref_obj(x)
|
= note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>`
found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>`
note: the lifetime 'a as defined on the function body at 32:10...
note: the lifetime `'a` as defined on the function body at 32:10...
--> $DIR/lifetime-bound-will-change-warning.rs:32:10
|
LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
@ -21,7 +21,7 @@ LL | lib::ref_obj(x)
|
= note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>`
found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>`
note: the lifetime 'a as defined on the function body at 37:12...
note: the lifetime `'a` as defined on the function body at 37:12...
--> $DIR/lifetime-bound-will-change-warning.rs:37:12
|
LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {

View file

@ -5,7 +5,7 @@ LL | s
| ^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 23:17
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 23:17
--> $DIR/lub-if.rs:23:17
|
LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
@ -18,7 +18,7 @@ LL | s
| ^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 32:17
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 32:17
--> $DIR/lub-if.rs:32:17
|
LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {

View file

@ -5,7 +5,7 @@ LL | s
| ^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 25:17
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 25:17
--> $DIR/lub-match.rs:25:17
|
LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
@ -18,7 +18,7 @@ LL | s
| ^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 35:17
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 35:17
--> $DIR/lub-match.rs:35:17
|
LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {

View file

@ -6,12 +6,12 @@ LL | match self.0 { ref mut x => x }
|
= note: expected type `&'a mut &'a i32`
found type `&'a mut &'b i32`
note: the lifetime 'a as defined on the method body at 9:12...
note: the lifetime `'a` as defined on the method body at 9:12...
--> $DIR/match-ref-mut-invariance.rs:9:12
|
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 8:6
note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 8:6
--> $DIR/match-ref-mut-invariance.rs:8:6
|
LL | impl<'b> S<'b> {

View file

@ -6,12 +6,12 @@ LL | x
|
= note: expected type `&'a mut &'a i32`
found type `&'a mut &'b i32`
note: the lifetime 'a as defined on the method body at 9:12...
note: the lifetime `'a` as defined on the method body at 9:12...
--> $DIR/match-ref-mut-let-invariance.rs:9:12
|
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 8:6
note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 8:6
--> $DIR/match-ref-mut-let-invariance.rs:8:6
|
LL | impl<'b> S<'b> {

View file

@ -6,7 +6,7 @@ LL | let _x = *s;
|
= note: expected type `std::marker::Sized`
found type `std::marker::Sized`
note: the lifetime 'a as defined on the function body at 9:8...
note: the lifetime `'a` as defined on the function body at 9:8...
--> $DIR/issue-50716.rs:9:8
|
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)

View file

@ -4,7 +4,7 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
LL | self.y = b.z
| ^^^
|
note: ...the reference is valid for the lifetime '_ as defined on the impl at 12:10...
note: ...the reference is valid for the lifetime `'_` as defined on the impl at 12:10...
--> $DIR/issue-52742.rs:12:10
|
LL | impl Foo<'_, '_> {

View file

@ -16,7 +16,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | Foo { bar }
| ^^^
note: but, the lifetime must be valid for the lifetime '_ as defined on the impl at 7:10...
note: but, the lifetime must be valid for the lifetime `'_` as defined on the impl at 7:10...
--> $DIR/issue-55394.rs:7:10
|
LL | impl Foo<'_> {

View file

@ -5,7 +5,7 @@ LL | *y
| ^^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 1:47
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 1:47
--> $DIR/issue-55401.rs:1:47
|
LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 {

View file

@ -4,12 +4,12 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'d` d
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'd as defined on the function body at 12:14...
note: first, the lifetime cannot outlive the lifetime `'d` as defined on the function body at 12:14...
--> $DIR/normalization-bounds-error.rs:12:14
|
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
| ^^
note: ...but the lifetime must also be valid for the lifetime 'a as defined on the function body at 12:18...
note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the function body at 12:18...
--> $DIR/normalization-bounds-error.rs:12:18
|
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}

View file

@ -6,12 +6,12 @@ LL | const AC: Option<&'c str> = None;
|
= note: expected type `std::option::Option<&'b str>`
found type `std::option::Option<&'c str>`
note: the lifetime 'c as defined on the impl at 20:18...
note: the lifetime `'c` as defined on the impl at 20:18...
--> $DIR/trait-associated-constant.rs:20:18
|
LL | impl<'a: 'b, 'b, 'c> Anything<'a, 'b> for FailStruct {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 20:14
note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 20:14
--> $DIR/trait-associated-constant.rs:20:14
|
LL | impl<'a: 'b, 'b, 'c> Anything<'a, 'b> for FailStruct {

View file

@ -14,7 +14,7 @@ LL | | }
= note: ...so that the expression is assignable:
expected std::boxed::Box<std::boxed::Box<&isize>>
found std::boxed::Box<std::boxed::Box<&isize>>
note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 15:6...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6...
--> $DIR/type-alias-free-regions.rs:15:6
|
LL | impl<'a> FromBox<'a> for C<'a> {
@ -39,7 +39,7 @@ LL | | }
= note: ...so that the expression is assignable:
expected std::boxed::Box<&isize>
found std::boxed::Box<&isize>
note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 25:6...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6...
--> $DIR/type-alias-free-regions.rs:25:6
|
LL | impl<'a> FromTuple<'a> for C<'a> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | <Foo<'a>>::C
| ^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 7:8...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 7:8...
--> $DIR/constant-in-expr-inherent-1.rs:7:8
|
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {

View file

@ -5,7 +5,7 @@ LL | <() as Foo<'a>>::C
| ^^^^^^^^^^^^^^^^^^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 17:8
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 17:8
--> $DIR/constant-in-expr-normalize.rs:17:8
|
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {

View file

@ -5,7 +5,7 @@ LL | <() as Foo<'a>>::C
| ^^^^^^^^^^^^^^^^^^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 9:8
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 9:8
--> $DIR/constant-in-expr-trait-item-1.rs:9:8
|
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {

View file

@ -5,7 +5,7 @@ LL | <T as Foo<'a>>::C
| ^^^^^^^^^^^^^^^^^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 9:8
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 9:8
--> $DIR/constant-in-expr-trait-item-2.rs:9:8
|
LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | T::C
| ^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 9:8...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:8...
--> $DIR/constant-in-expr-trait-item-3.rs:9:8
|
LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to
LL | ss
| ^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 54:10...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 54:10...
--> $DIR/object-lifetime-default-elision.rs:54:10
|
LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
@ -14,7 +14,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | ss
| ^^
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 54:13...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 54:13...
--> $DIR/object-lifetime-default-elision.rs:54:13
|
LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
@ -29,7 +29,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | ss
| ^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 54:10...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 54:10...
--> $DIR/object-lifetime-default-elision.rs:54:10
|
LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
@ -39,7 +39,7 @@ note: ...so that the declared lifetime parameter bounds are satisfied
|
LL | ss
| ^^
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 54:13...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 54:13...
--> $DIR/object-lifetime-default-elision.rs:54:13
|
LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {

View file

@ -6,7 +6,7 @@ LL | ss.t = t;
|
= note: expected type `&'a std::boxed::Box<(dyn Test + 'static)>`
found type `&'a std::boxed::Box<(dyn Test + 'a)>`
note: the lifetime 'a as defined on the function body at 14:6...
note: the lifetime `'a` as defined on the function body at 14:6...
--> $DIR/object-lifetime-default-from-rptr-box-error.rs:14:6
|
LL | fn c<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {

View file

@ -6,7 +6,7 @@ LL | ss.t = t;
|
= note: expected type `&'a MyBox<(dyn Test + 'static)>`
found type `&'a MyBox<(dyn Test + 'a)>`
note: the lifetime 'a as defined on the function body at 20:6...
note: the lifetime `'a` as defined on the function body at 20:6...
--> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:6
|
LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {

View file

@ -18,7 +18,7 @@ LL | load0(ss)
|
= note: expected type `&MyBox<(dyn SomeTrait + 'static)>`
found type `&MyBox<(dyn SomeTrait + 'a)>`
note: the lifetime 'a as defined on the function body at 30:10...
note: the lifetime `'a` as defined on the function body at 30:10...
--> $DIR/object-lifetime-default-mybox.rs:30:10
|
LL | fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {

View file

@ -10,12 +10,12 @@ error[E0478]: lifetime bound not satisfied
LL | z: Box<dyn Is<'a>+'b+'c>,
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime 'b as defined on the struct at 11:15
note: lifetime parameter instantiated with the lifetime `'b` as defined on the struct at 11:15
--> $DIR/region-bounds-on-objects-and-type-parameters.rs:11:15
|
LL | struct Foo<'a,'b,'c> {
| ^^
note: but lifetime parameter must outlive the lifetime 'a as defined on the struct at 11:12
note: but lifetime parameter must outlive the lifetime `'a` as defined on the struct at 11:12
--> $DIR/region-bounds-on-objects-and-type-parameters.rs:11:12
|
LL | struct Foo<'a,'b,'c> {

View file

@ -3,7 +3,7 @@
// over time, but this test used to exhibit some pretty bogus messages
// that were not remotely helpful.
// error-pattern:the lifetime 'a
// error-pattern:the lifetime `'a`
// error-pattern:the static lifetime
struct Invariant<'a>(Option<&'a mut &'a mut ()>);

View file

@ -13,7 +13,7 @@ LL | | };
|
= note: expected type `Invariant<'a>`
found type `Invariant<'static>`
note: the lifetime 'a as defined on the function body at 13:10...
note: the lifetime `'a` as defined on the function body at 13:10...
--> $DIR/region-invariant-static-error-reporting.rs:13:10
|
LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for autoref due to conflictin
LL | x.borrowed()
| ^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 9:42...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:42...
--> $DIR/region-object-lifetime-2.rs:9:42
|
LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
@ -14,7 +14,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | x.borrowed()
| ^
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 9:45...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 9:45...
--> $DIR/region-object-lifetime-2.rs:9:45
|
LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for autoref due to conflictin
LL | x.borrowed()
| ^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 11:41...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 11:41...
--> $DIR/region-object-lifetime-4.rs:11:41
|
LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
@ -14,7 +14,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | x.borrowed()
| ^
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 11:44...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 11:44...
--> $DIR/region-object-lifetime-4.rs:11:44
|
LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {

View file

@ -29,7 +29,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | Box::new(v)
| ^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 25:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 25:6...
--> $DIR/region-object-lifetime-in-coercion.rs:25:6
|
LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
@ -37,7 +37,7 @@ LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
= note: ...so that the expression is assignable:
expected &[u8]
found &'a [u8]
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 25:9...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9...
--> $DIR/region-object-lifetime-in-coercion.rs:25:9
|
LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to
LL | let p: &'static mut usize = &mut self.food;
| ^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime '_ as defined on the body at 9:18...
note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 9:18...
--> $DIR/regions-addr-of-upvar-self.rs:9:18
|
LL | let _f = || {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifet
LL | let _: &'a WithAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 33:15
note: the pointer is valid for the lifetime `'a` as defined on the function body at 33:15
--> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:33:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 33:18
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 33:18
--> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:33:18
|
LL | fn with_assoc<'a,'b>() {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | impl<'a> Foo<'static> for &'a i32 {
| ^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 14:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 14:6...
--> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:6
|
LL | impl<'a> Foo<'static> for &'a i32 {
@ -25,7 +25,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | impl<'a,'b> Foo<'b> for &'a i64 {
| ^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 19:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 19:6...
--> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:6
|
LL | impl<'a,'b> Foo<'b> for &'a i64 {
@ -33,7 +33,7 @@ LL | impl<'a,'b> Foo<'b> for &'a i64 {
= note: ...so that the types are compatible:
expected Foo<'b>
found Foo<'_>
note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 19:9...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9...
--> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9
|
LL | impl<'a,'b> Foo<'b> for &'a i64 {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | impl<'a> Foo for &'a i32 {
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 9:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 9:6...
--> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:6
|
LL | impl<'a> Foo for &'a i32 {

View file

@ -6,12 +6,12 @@ LL | return e;
|
= note: expected type `TupleStruct<'b>`
found type `TupleStruct<'a>`
note: the lifetime 'a as defined on the function body at 8:10...
note: the lifetime `'a` as defined on the function body at 8:10...
--> $DIR/regions-bounds.rs:8:10
|
LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 8:13
note: ...does not necessarily outlive the lifetime `'b` as defined on the function body at 8:13
--> $DIR/regions-bounds.rs:8:13
|
LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
@ -25,12 +25,12 @@ LL | return e;
|
= note: expected type `Struct<'b>`
found type `Struct<'a>`
note: the lifetime 'a as defined on the function body at 12:10...
note: the lifetime `'a` as defined on the function body at 12:10...
--> $DIR/regions-bounds.rs:12:10
|
LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 12:13
note: ...does not necessarily outlive the lifetime `'b` as defined on the function body at 12:13
--> $DIR/regions-bounds.rs:12:13
|
LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to
LL | box B(&*v) as Box<dyn X>
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 9:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:6...
--> $DIR/regions-close-object-into-object-2.rs:9:6
|
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to
LL | box B(&*v) as Box<dyn X>
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 9:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:6...
--> $DIR/regions-close-object-into-object-4.rs:9:6
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
LL | box v as Box<dyn SomeTrait + 'a>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 18:20...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 18:20...
--> $DIR/regions-close-over-type-parameter-multiple.rs:18:20
|
LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
@ -14,7 +14,7 @@ note: ...so that the declared lifetime parameter bounds are satisfied
|
LL | box v as Box<dyn SomeTrait + 'a>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but, the lifetime must be valid for the lifetime 'c as defined on the function body at 18:26...
note: but, the lifetime must be valid for the lifetime `'c` as defined on the function body at 18:26...
--> $DIR/regions-close-over-type-parameter-multiple.rs:18:26
|
LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d
LL | Ast::Add(x, y)
| ^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 6:16...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 6:16...
--> $DIR/regions-creating-enums4.rs:6:16
|
LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
@ -12,7 +12,7 @@ LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
= note: ...so that the expression is assignable:
expected &Ast<'_>
found &Ast<'a>
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 6:19...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19...
--> $DIR/regions-creating-enums4.rs:6:19
|
LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {

View file

@ -4,12 +4,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
LL | g2.get()
| ^^^^^^^^
|
note: ...the reference is valid for the lifetime 'a as defined on the impl at 18:6...
note: ...the reference is valid for the lifetime `'a` as defined on the impl at 18:6...
--> $DIR/regions-early-bound-error-method.rs:18:6
|
LL | impl<'a> Box<'a> {
| ^^
note: ...but the borrowed content is only valid for the lifetime 'b as defined on the method body at 19:11
note: ...but the borrowed content is only valid for the lifetime `'b` as defined on the method body at 19:11
--> $DIR/regions-early-bound-error-method.rs:19:11
|
LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {

View file

@ -4,12 +4,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
LL | g1.get()
| ^^^^^^^^
|
note: ...the reference is valid for the lifetime 'b as defined on the function body at 18:11...
note: ...the reference is valid for the lifetime `'b` as defined on the function body at 18:11...
--> $DIR/regions-early-bound-error.rs:18:11
|
LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
| ^^
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 18:8
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 18:8
--> $DIR/regions-early-bound-error.rs:18:8
|
LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {

View file

@ -8,12 +8,12 @@ LL | | let z: Option<&'a &'b usize> = None;
LL | | }
| |_^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 5:14
note: the pointer is valid for the lifetime `'a` as defined on the function body at 5:14
--> $DIR/regions-free-region-ordering-callee-4.rs:5:14
|
LL | fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 5:18
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 5:18
--> $DIR/regions-free-region-ordering-callee-4.rs:5:18
|
LL | fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to
LL | None => &self.val
| ^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the method body at 14:12...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the method body at 14:12...
--> $DIR/regions-free-region-ordering-incorrect.rs:14:12
|
LL | fn get<'a>(&'a self) -> &'b T {
@ -14,7 +14,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | None => &self.val
| ^^^^^^^^^
note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 13:6...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 13:6...
--> $DIR/regions-free-region-ordering-incorrect.rs:13:6
|
LL | impl<'b, T> Node<'b, T> {

View file

@ -7,12 +7,12 @@ LL | | {
LL | | }
| |_^
|
note: the pointer is valid for the lifetime 'x as defined on the function body at 21:11
note: the pointer is valid for the lifetime `'x` as defined on the function body at 21:11
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:11
|
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
| ^^
note: but the referenced data is only valid for the lifetime 'y as defined on the function body at 21:15
note: but the referenced data is only valid for the lifetime `'y` as defined on the function body at 21:15
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:15
|
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)

View file

@ -6,7 +6,7 @@ LL | b_isize
|
= note: expected type `Invariant<'static>`
found type `Invariant<'r>`
note: the lifetime 'r as defined on the function body at 11:23...
note: the lifetime `'r` as defined on the function body at 11:23...
--> $DIR/regions-infer-invariance-due-to-decl.rs:11:23
|
LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {

View file

@ -6,7 +6,7 @@ LL | b_isize
|
= note: expected type `Invariant<'static>`
found type `Invariant<'r>`
note: the lifetime 'r as defined on the function body at 9:23...
note: the lifetime `'r` as defined on the function body at 9:23...
--> $DIR/regions-infer-invariance-due-to-mutability-3.rs:9:23
|
LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {

View file

@ -6,7 +6,7 @@ LL | b_isize
|
= note: expected type `Invariant<'static>`
found type `Invariant<'r>`
note: the lifetime 'r as defined on the function body at 9:23...
note: the lifetime `'r` as defined on the function body at 9:23...
--> $DIR/regions-infer-invariance-due-to-mutability-4.rs:9:23
|
LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {

View file

@ -6,12 +6,12 @@ LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
|
= note: expected type `Direct<'b>`
found type `Direct<'a>`
note: the lifetime 'a as defined on the function body at 15:16...
note: the lifetime `'a` as defined on the function body at 15:16...
--> $DIR/regions-infer-not-param.rs:15:16
|
LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 15:19
note: ...does not necessarily outlive the lifetime `'b` as defined on the function body at 15:19
--> $DIR/regions-infer-not-param.rs:15:19
|
LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
@ -25,12 +25,12 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
= note: expected type `Indirect2<'b>`
found type `Indirect2<'a>`
note: the lifetime 'a as defined on the function body at 19:19...
note: the lifetime `'a` as defined on the function body at 19:19...
--> $DIR/regions-infer-not-param.rs:19:19
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 19:22
note: ...does not necessarily outlive the lifetime `'b` as defined on the function body at 19:22
--> $DIR/regions-infer-not-param.rs:19:22
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
@ -44,12 +44,12 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
= note: expected type `Indirect2<'b>`
found type `Indirect2<'a>`
note: the lifetime 'b as defined on the function body at 19:22...
note: the lifetime `'b` as defined on the function body at 19:22...
--> $DIR/regions-infer-not-param.rs:19:22
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
| ^^
note: ...does not necessarily outlive the lifetime 'a as defined on the function body at 19:19
note: ...does not necessarily outlive the lifetime `'a` as defined on the function body at 19:19
--> $DIR/regions-infer-not-param.rs:19:19
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }

View file

@ -17,7 +17,7 @@ LL | |
LL | |
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 16:6
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 16:6
--> $DIR/regions-infer-paramd-indirect.rs:16:6
|
LL | impl<'a> SetF<'a> for C<'a> {

View file

@ -49,7 +49,7 @@ LL | | if false { return ay; }
LL | | return z;
LL | | }));
| |_____^
note: ...but the borrowed content is only valid for the lifetime 'x as defined on the function body at 3:11
note: ...but the borrowed content is only valid for the lifetime `'x` as defined on the function body at 3:11
--> $DIR/regions-nested-fns.rs:3:11
|
LL | fn nested<'x>(x: &'x isize) {

View file

@ -7,12 +7,12 @@ LL | | {
LL | | }
| |_^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 22:8...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 22:8...
--> $DIR/regions-normalize-in-where-clause-list.rs:22:8
|
LL | fn bar<'a, 'b>()
| ^^
note: ...but the lifetime must also be valid for the lifetime 'b as defined on the function body at 22:12...
note: ...but the lifetime must also be valid for the lifetime `'b` as defined on the function body at 22:12...
--> $DIR/regions-normalize-in-where-clause-list.rs:22:12
|
LL | fn bar<'a, 'b>()

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a WithHrAssoc<TheType<'b>>`, reference has a longer lif
LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 27:15
note: the pointer is valid for the lifetime `'a` as defined on the function body at 27:15
--> $DIR/regions-outlives-projection-container-hrtb.rs:27:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 27:18
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 27:18
--> $DIR/regions-outlives-projection-container-hrtb.rs:27:18
|
LL | fn with_assoc<'a,'b>() {
@ -21,12 +21,12 @@ error[E0491]: in type `&'a WithHrAssocSub<TheType<'b>>`, reference has a longer
LL | let _: &'a WithHrAssocSub<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 46:19
note: the pointer is valid for the lifetime `'a` as defined on the function body at 46:19
--> $DIR/regions-outlives-projection-container-hrtb.rs:46:19
|
LL | fn with_assoc_sub<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 46:22
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 46:22
--> $DIR/regions-outlives-projection-container-hrtb.rs:46:22
|
LL | fn with_assoc_sub<'a,'b>() {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifet
LL | let _: &'a WithAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 27:15
note: the pointer is valid for the lifetime `'a` as defined on the function body at 27:15
--> $DIR/regions-outlives-projection-container-wc.rs:27:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 27:18
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 27:18
--> $DIR/regions-outlives-projection-container-wc.rs:27:18
|
LL | fn with_assoc<'a,'b>() {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifet
LL | let _x: &'a WithAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 28:15
note: the pointer is valid for the lifetime `'a` as defined on the function body at 28:15
--> $DIR/regions-outlives-projection-container.rs:28:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 28:18
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 28:18
--> $DIR/regions-outlives-projection-container.rs:28:18
|
LL | fn with_assoc<'a,'b>() {
@ -21,12 +21,12 @@ error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer li
LL | let _x: &'a WithoutAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 50:18
note: the pointer is valid for the lifetime `'a` as defined on the function body at 50:18
--> $DIR/regions-outlives-projection-container.rs:50:18
|
LL | fn without_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 50:21
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 50:21
--> $DIR/regions-outlives-projection-container.rs:50:21
|
LL | fn without_assoc<'a,'b>() {
@ -38,12 +38,12 @@ error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifet
LL | call::<&'a WithAssoc<TheType<'b>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 58:20
note: the pointer is valid for the lifetime `'a` as defined on the function body at 58:20
--> $DIR/regions-outlives-projection-container.rs:58:20
|
LL | fn call_with_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 58:23
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 58:23
--> $DIR/regions-outlives-projection-container.rs:58:23
|
LL | fn call_with_assoc<'a,'b>() {
@ -55,12 +55,12 @@ error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer li
LL | call::<&'a WithoutAssoc<TheType<'b>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the function body at 67:23
note: the pointer is valid for the lifetime `'a` as defined on the function body at 67:23
--> $DIR/regions-outlives-projection-container.rs:67:23
|
LL | fn call_without_assoc<'a,'b>() {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 67:26
note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 67:26
--> $DIR/regions-outlives-projection-container.rs:67:26
|
LL | fn call_without_assoc<'a,'b>() {

View file

@ -12,7 +12,7 @@ LL | with(|o| o)
= note: ...so that the expression is assignable:
expected &isize
found &isize
note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 9:14...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14...
--> $DIR/regions-ret-borrowed-1.rs:9:14
|
LL | fn return_it<'a>() -> &'a isize {

View file

@ -12,7 +12,7 @@ LL | with(|o| o)
= note: ...so that the expression is assignable:
expected &isize
found &isize
note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 12:14...
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14...
--> $DIR/regions-ret-borrowed.rs:12:14
|
LL | fn return_it<'a>() -> &'a isize {

View file

@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to
LL | let mut f = || &mut x;
| ^^^^^^
|
note: first, the lifetime cannot outlive the lifetime '_ as defined on the body at 7:21...
note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 7:21...
--> $DIR/regions-return-ref-to-upvar-issue-17403.rs:7:21
|
LL | let mut f = || &mut x;

View file

@ -5,7 +5,7 @@ LL | t
| ^
|
= note: ...the reference is valid for the static lifetime...
note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 8:24
note: ...but the borrowed content is only valid for the lifetime `'a` as defined on the function body at 8:24
--> $DIR/regions-static-bound.rs:8:24
|
LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {

View file

@ -6,7 +6,7 @@ LL | fn get_ctxt(&self) -> &'a Ctxt {
|
= note: expected type `fn(&HasCtxt<'a>) -> &Ctxt`
found type `fn(&HasCtxt<'a>) -> &'a Ctxt`
note: the lifetime 'a as defined on the impl at 12:6...
note: the lifetime `'a` as defined on the impl at 12:6...
--> $DIR/regions-trait-1.rs:12:6
|
LL | impl<'a> GetCtxt for HasCtxt<'a> {

View file

@ -4,12 +4,12 @@ error[E0478]: lifetime bound not satisfied
LL | x
| ^
|
note: lifetime parameter instantiated with the lifetime 'a as defined on the function body at 13:9
note: lifetime parameter instantiated with the lifetime `'a` as defined on the function body at 13:9
--> $DIR/regions-trait-object-subtyping.rs:13:9
|
LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
| ^^
note: but lifetime parameter must outlive the lifetime 'b as defined on the function body at 13:12
note: but lifetime parameter must outlive the lifetime `'b` as defined on the function body at 13:12
--> $DIR/regions-trait-object-subtyping.rs:13:12
|
LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
@ -21,7 +21,7 @@ error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to
LL | x
| ^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 13:9...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 13:9...
--> $DIR/regions-trait-object-subtyping.rs:13:9
|
LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
@ -31,7 +31,7 @@ note: ...so that reference does not outlive borrowed content
|
LL | x
| ^
note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 13:12...
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 13:12...
--> $DIR/regions-trait-object-subtyping.rs:13:12
|
LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
@ -48,12 +48,12 @@ LL | x
|
= note: expected type `Wrapper<&'b mut (dyn Dummy + 'b)>`
found type `Wrapper<&'a mut (dyn Dummy + 'a)>`
note: the lifetime 'b as defined on the function body at 20:15...
note: the lifetime `'b` as defined on the function body at 20:15...
--> $DIR/regions-trait-object-subtyping.rs:20:15
|
LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
| ^^
note: ...does not necessarily outlive the lifetime 'a as defined on the function body at 20:9
note: ...does not necessarily outlive the lifetime `'a` as defined on the function body at 20:9
--> $DIR/regions-trait-object-subtyping.rs:20:9
|
LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {

View file

@ -6,7 +6,7 @@ LL | let _: Invariant<'static> = c;
|
= note: expected type `Invariant<'static>`
found type `Invariant<'b>`
note: the lifetime 'b as defined on the function body at 11:9...
note: the lifetime `'b` as defined on the function body at 11:9...
--> $DIR/regions-variance-invariant-use-covariant.rs:11:9
|
LL | fn use_<'b>(c: Invariant<'b>) {

View file

@ -4,12 +4,12 @@ error[E0478]: lifetime bound not satisfied
LL | x: Box<dyn TheTrait<'a>+'b>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime 'b as defined on the struct at 6:15
note: lifetime parameter instantiated with the lifetime `'b` as defined on the struct at 6:15
--> $DIR/regions-wf-trait-object.rs:6:15
|
LL | struct Foo<'a,'b> {
| ^^
note: but lifetime parameter must outlive the lifetime 'a as defined on the struct at 6:12
note: but lifetime parameter must outlive the lifetime `'a` as defined on the struct at 6:12
--> $DIR/regions-wf-trait-object.rs:6:12
|
LL | struct Foo<'a,'b> {

View file

@ -34,7 +34,7 @@ LL | impl Drop for N<'static> { fn drop(&mut self) { } }
|
= note: expected type `N<'n>`
found type `N<'static>`
note: the lifetime 'n as defined on the struct at 8:10...
note: the lifetime `'n` as defined on the struct at 8:10...
--> $DIR/reject-specialized-drops-8142.rs:8:10
|
LL | struct N<'n> { x: &'n i8 }
@ -95,12 +95,12 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw`
LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'l1 as defined on the struct at 17:10...
note: first, the lifetime cannot outlive the lifetime `'l1` as defined on the struct at 17:10...
--> $DIR/reject-specialized-drops-8142.rs:17:10
|
LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
| ^^^
note: ...but the lifetime must also be valid for the lifetime 'l2 as defined on the struct at 17:15...
note: ...but the lifetime must also be valid for the lifetime `'l2` as defined on the struct at 17:15...
--> $DIR/reject-specialized-drops-8142.rs:17:15
|
LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a
LL | type Out = &'a Foo<'b>;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the impl at 16:10
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region-rev.rs:16:10
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 16:14
note: but the referenced data is only valid for the lifetime `'b` as defined on the impl at 16:14
--> $DIR/regions-outlives-nominal-type-region-rev.rs:16:14
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a long
LL | type Out = &'a Foo<'b>;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the impl at 16:10
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region.rs:16:10
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 16:14
note: but the referenced data is only valid for the lifetime `'b` as defined on the impl at 16:14
--> $DIR/regions-outlives-nominal-type-region.rs:16:14
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a l
LL | type Out = &'a Foo<&'b i32>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the impl at 16:10
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type-rev.rs:16:10
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 16:14
note: but the referenced data is only valid for the lifetime `'b` as defined on the impl at 16:14
--> $DIR/regions-outlives-nominal-type-type-rev.rs:16:14
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {

View file

@ -4,12 +4,12 @@ error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a l
LL | type Out = &'a Foo<&'b i32>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the impl at 16:10
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type.rs:16:10
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 16:14
note: but the referenced data is only valid for the lifetime `'b` as defined on the impl at 16:14
--> $DIR/regions-outlives-nominal-type-type.rs:16:14
|
LL | impl<'a, 'b> Trait<'a, 'b> for usize {

View file

@ -32,12 +32,12 @@ error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data
LL | type Out = &'a &'b T;
| ^^^^^^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime 'a as defined on the impl at 24:6
note: the pointer is valid for the lifetime `'a` as defined on the impl at 24:6
--> $DIR/regions-struct-not-wf.rs:24:6
|
LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
| ^^
note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 24:10
note: but the referenced data is only valid for the lifetime `'b` as defined on the impl at 24:10
--> $DIR/regions-struct-not-wf.rs:24:10
|
LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {

View file

@ -6,12 +6,12 @@ LL | async fn f(self: Pin<&Self>) -> impl Clone { self }
| |
| ...but this borrow...
|
note: ...can't outlive the lifetime '_ as defined on the method body at 8:26
note: ...can't outlive the lifetime `'_` as defined on the method body at 8:26
--> $DIR/arbitrary_self_types_pin_lifetime_impl_trait-async.rs:8:26
|
LL | async fn f(self: Pin<&Self>) -> impl Clone { self }
| ^
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime '_ as defined on the method body at 8:26
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'_` as defined on the method body at 8:26
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
| ^^^^^^^^^^^^^^^

View file

@ -4,7 +4,7 @@ error[E0478]: lifetime bound not satisfied
LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
| ^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime 'a as defined on the impl at 3:6
note: lifetime parameter instantiated with the lifetime `'a` as defined on the impl at 3:6
--> $DIR/static-lifetime.rs:3:6
|
LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}

View file

@ -4,12 +4,12 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` d
LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
| ^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 24:6...
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 24:6...
--> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:6
|
LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
| ^^
note: ...but the lifetime must also be valid for the lifetime 'b as defined on the impl at 24:9...
note: ...but the lifetime must also be valid for the lifetime `'b` as defined on the impl at 24:9...
--> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:9
|
LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {

View file

@ -6,12 +6,12 @@ LL | fn foo(x: Foo<'b,'a>) {
|
= note: expected type `fn(Foo<'a, 'b>)`
found type `fn(Foo<'b, 'a>)`
note: the lifetime 'b as defined on the impl at 13:9...
note: the lifetime `'b` as defined on the impl at 13:9...
--> $DIR/trait-matching-lifetimes.rs:13:9
|
LL | impl<'a,'b> Tr for Foo<'a,'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:6
note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 13:6
--> $DIR/trait-matching-lifetimes.rs:13:6
|
LL | impl<'a,'b> Tr for Foo<'a,'b> {
@ -25,12 +25,12 @@ LL | fn foo(x: Foo<'b,'a>) {
|
= note: expected type `fn(Foo<'a, 'b>)`
found type `fn(Foo<'b, 'a>)`
note: the lifetime 'a as defined on the impl at 13:6...
note: the lifetime `'a` as defined on the impl at 13:6...
--> $DIR/trait-matching-lifetimes.rs:13:6
|
LL | impl<'a,'b> Tr for Foo<'a,'b> {
| ^^
note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 13:9
note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 13:9
--> $DIR/trait-matching-lifetimes.rs:13:9
|
LL | impl<'a,'b> Tr for Foo<'a,'b> {

Some files were not shown because too many files have changed in this diff Show more