about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-04-30 10:33:37 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-04-30 13:55:17 +0200
commitb4e3e62c9cde00637fc2e69b24581ba77494035b (patch)
treefebd00751fa6caa1f704cdcabe5249a7643643e7
parent39c67b2133702974efe03fea651e9b4a5cb2cbe1 (diff)
downloadrust-b4e3e62c9cde00637fc2e69b24581ba77494035b.tar.gz
rust-b4e3e62c9cde00637fc2e69b24581ba77494035b.zip
Bless nll tests.
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr8
-rw-r--r--src/test/ui/impl-trait/type_parameters_captured.nll.stderr8
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr7
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr6
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr36
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr8
6 files changed, 45 insertions, 28 deletions
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 2681241bbad..db737a9c544 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
@@ -112,11 +112,13 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/must_outlive_least_region_or_bound.rs:40:5
    |
-LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
-   |                                 -- help: consider adding an explicit lifetime bound...: `T: 'static +`
-LL |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
+   |                                         +++++++++
 
 error: aborting due to 9 previous errors
 
diff --git a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr b/src/test/ui/impl-trait/type_parameters_captured.nll.stderr
index 1cd5b65b974..3050f10b205 100644
--- a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr
+++ b/src/test/ui/impl-trait/type_parameters_captured.nll.stderr
@@ -1,11 +1,13 @@
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/type_parameters_captured.rs:9:5
    |
-LL | fn foo<T>(x: T) -> impl Any + 'static {
-   |        - help: consider adding an explicit lifetime bound...: `T: 'static`
-LL |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn foo<T: 'static>(x: T) -> impl Any + 'static {
+   |         +++++++++
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr
index 422673b361a..2906c05864b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr
@@ -1,10 +1,13 @@
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/issue_74400.rs:12:5
    |
-LL | fn g<T>(data: &[T]) {
-   |      - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     f(data, identity)
    |     ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn g<T: 'static>(data: &[T]) {
+   |       +++++++++
 
 error[E0308]: mismatched types
   --> $DIR/issue_74400.rs:12:5
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr
index d38d66c0885..0212c2d712c 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr
@@ -1,8 +1,6 @@
 error[E0311]: the parameter type `T` may not live long enough
   --> $DIR/missing-lifetimes-in-signature-2.rs:20:5
    |
-LL |   fn func<T: Test>(foo: &Foo, t: T) {
-   |           -- help: consider adding an explicit lifetime bound...: `T: 'a +`
 LL | /     foo.bar(move |_| {
 LL | |
 LL | |         t.test();
@@ -22,6 +20,10 @@ LL | |
 LL | |         t.test();
 LL | |     });
    | |______^
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn func<T: Test + 'a>(foo: &Foo, t: T) {
+   |                 ++++
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
index e47f7dc3566..24eac64d334 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
@@ -26,9 +26,6 @@ LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
 error[E0311]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:31:5
    |
-LL |   fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |          - help: consider adding an explicit lifetime bound...: `G: 'a`
-...
 LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
@@ -46,13 +43,14 @@ LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
    | |_____^
+help: consider adding an explicit lifetime bound...
+   |
+LL |     G: Get<T> + 'a,
+   |               ++++
 
 error[E0311]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:53:5
    |
-LL |   fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |              -- help: consider adding an explicit lifetime bound...: `G: 'b +`
-...
 LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
@@ -70,13 +68,14 @@ LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
    | |_____^
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
+   |                  ++++
 
 error[E0311]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:62:9
    |
-LL |       fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
-   |                  -- help: consider adding an explicit lifetime bound...: `G: 'c +`
-LL |
 LL | /         move || {
 LL | |             *dest = g.get();
 LL | |         }
@@ -94,13 +93,14 @@ LL | /         move || {
 LL | |             *dest = g.get();
 LL | |         }
    | |_________^
+help: consider adding an explicit lifetime bound...
+   |
+LL |     fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
+   |                               ++++
 
 error[E0311]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:74:5
    |
-LL |   fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
-   |              -- help: consider adding an explicit lifetime bound...: `G: 'b +`
-...
 LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
@@ -118,6 +118,10 @@ LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
    | |_____^
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
+   |                  ++++
 
 error[E0621]: explicit lifetime required in the type of `dest`
   --> $DIR/missing-lifetimes-in-signature.rs:74:5
@@ -133,13 +137,15 @@ LL | |     }
 error[E0309]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:85:5
    |
-LL |   fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
-   |              - help: consider adding an explicit lifetime bound...: `G: 'a`
-...
 LL | /     move || {
 LL | |         *dest = g.get();
 LL | |     }
    | |_____^ ...so that the type `G` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL |     G: Get<T> + 'a,
+   |               ++++
 
 error: aborting due to 8 previous errors
 
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr
index 72354eaaee1..cf912f4aac2 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr
@@ -1,11 +1,13 @@
 error[E0310]: the parameter type `impl Debug` may not live long enough
   --> $DIR/suggest-impl-trait-lifetime.rs:7:5
    |
-LL | fn foo(d: impl Debug) {
-   |           ---------- help: consider adding an explicit lifetime bound...: `impl Debug + 'static`
-LL |
 LL |     bar(d);
    |     ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL | fn foo(d: impl Debug + 'static) {
+   |                      +++++++++
 
 error: aborting due to previous error