From cba0761e5f3677b90390fe7aee1eeda684296658 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sun, 27 Oct 2019 09:39:14 -0500 Subject: update tests --- src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr | 1 + src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr | 4 ++++ src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr | 1 + 3 files changed, 6 insertions(+) (limited to 'src/test/ui/impl-trait') diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr index 82e280b9fb2..45c5142d93f 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr @@ -4,6 +4,7 @@ error: lifetime may not live long enough LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { | -- lifetime `'a` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'static` | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | type E<'a, 'b> = impl Sized; + 'a diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr index 097f003575e..bb5a85aba97 100644 --- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr +++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr @@ -19,6 +19,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } | | | lifetime `'a` defined here | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x } @@ -31,6 +32,7 @@ LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` | = help: consider replacing `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:17:61 @@ -39,6 +41,8 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32 | -- -- lifetime `'b` defined here ^^^^^^^^^^^^^^^^ opaque type requires that `'b` must outlive `'a` | | | lifetime `'a` defined here + | + = help: consider adding the following bound: `'b: 'a` error[E0310]: the parameter type `T` may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:22:51 diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr index 423cfcc4989..22f081b79f1 100644 --- a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr +++ b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr @@ -19,6 +19,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator { | | | lifetime `'a` defined here | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | fn iter_values<'a>(&'a self) -> impl Iterator + 'a { -- cgit 1.4.1-3-g733a5