diff options
| author | David Wood <david@davidtw.co> | 2018-07-24 16:22:41 +0200 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-07-27 12:48:47 +0200 |
| commit | b377e7bbfbf584de4c1a775fd41b957cbd2e057b (patch) | |
| tree | cc971126db8d0f01669a998725f74e515a2654a3 /src/test | |
| parent | 055aaaf765eee0eb951b55898d943ff7dde3d4ae (diff) | |
| download | rust-b377e7bbfbf584de4c1a775fd41b957cbd2e057b.tar.gz rust-b377e7bbfbf584de4c1a775fd41b957cbd2e057b.zip | |
Change label from closure to function where appropriate.
Diffstat (limited to 'src/test')
10 files changed, 32 insertions, 34 deletions
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 c6f8d2e519c..123a93636d2 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 @@ -10,21 +10,19 @@ warning: not reporting region error due to nll LL | self.x.iter().map(|a| a.0) | ^^^^ -error: borrowed data escapes outside of closure +error: unsatisfied lifetime constraints --> $DIR/static-return-lifetime-infered.rs:17:9 | LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> { - | ----- `self` is a reference that is only valid in the closure body + | - let's call the lifetime of this reference `'1` LL | self.x.iter().map(|a| a.0) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` escapes the closure body here + | ^^^^^^^^^^^^^ free region requires that `'1` must outlive `'static` -error: borrowed data escapes outside of closure +error: unsatisfied lifetime constraints --> $DIR/static-return-lifetime-infered.rs:21:9 | -LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> { - | -------- `self` is a reference that is only valid in the closure body LL | self.x.iter().map(|a| a.0) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` escapes the closure body here + | ^^^^^^^^^^^^^ free region requires that `'a` must outlive `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr index e26b1956d5e..f5d98e04ad8 100644 --- a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr +++ b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr @@ -4,13 +4,13 @@ warning: not reporting region error due to nll LL | static_val(x); //~ ERROR cannot infer | ^ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/dyn-trait.rs:32:5 | LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) { - | - `x` is a reference that is only valid in the closure body + | - `x` is a reference that is only valid in the function body LL | static_val(x); //~ ERROR cannot infer - | ^^^^^^^^^^^^^ `x` escapes the closure body here + | ^^^^^^^^^^^^^ `x` escapes the function body here error: aborting due to previous error diff --git a/src/test/ui/issue-16683.nll.stderr b/src/test/ui/issue-16683.nll.stderr index f9dda27da09..890bb426441 100644 --- a/src/test/ui/issue-16683.nll.stderr +++ b/src/test/ui/issue-16683.nll.stderr @@ -10,13 +10,13 @@ warning: not reporting region error due to nll LL | self.a(); //~ ERROR cannot infer | ^ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/issue-16683.rs:14:9 | LL | fn b(&self) { - | ----- `self` is a reference that is only valid in the closure body + | ----- `self` is a reference that is only valid in the function body LL | self.a(); //~ ERROR cannot infer - | ^^^^^^^^ `self` escapes the closure body here + | ^^^^^^^^ `self` escapes the function body here error: aborting due to previous error diff --git a/src/test/ui/issue-17758.nll.stderr b/src/test/ui/issue-17758.nll.stderr index 5775135aefc..c51a72f885d 100644 --- a/src/test/ui/issue-17758.nll.stderr +++ b/src/test/ui/issue-17758.nll.stderr @@ -10,13 +10,13 @@ warning: not reporting region error due to nll LL | self.foo(); | ^^^ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/issue-17758.rs:17:9 | LL | fn bar(&self) { - | ----- `self` is a reference that is only valid in the closure body + | ----- `self` is a reference that is only valid in the function body LL | self.foo(); - | ^^^^^^^^^^ `self` escapes the closure body here + | ^^^^^^^^^^ `self` escapes the function body here error: aborting due to previous error diff --git a/src/test/ui/issue-52213.nll.stderr b/src/test/ui/issue-52213.nll.stderr index fb5da7d7a19..c288cf9ed82 100644 --- a/src/test/ui/issue-52213.nll.stderr +++ b/src/test/ui/issue-52213.nll.stderr @@ -5,10 +5,10 @@ LL | match (&t,) { //~ ERROR cannot infer an appropriate lifetime | ^^^^^ error: unsatisfied lifetime constraints - --> $DIR/issue-52213.rs:12:11 + --> $DIR/issue-52213.rs:13:11 | -LL | match (&t,) { //~ ERROR cannot infer an appropriate lifetime - | ^^^^^ free region requires that `'a` must outlive `'b` +LL | ((u,),) => u, + | ^ free region requires that `'a` must outlive `'b` error: aborting due to previous error diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index 3177cd7c28f..33e4240736f 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -23,18 +23,18 @@ LL | | }); = note: number of external vids: 2 = note: where '_#1r: '_#0r -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5 | LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { - | ------ `cell_a` is a reference that is only valid in the closure body + | ------ `cell_a` is a reference that is only valid in the function body LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { LL | | //~^ ERROR LL | | LL | | // Only works if 'x: 'y: LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll LL | | }); - | |______^ `cell_a` escapes the closure body here + | |______^ `cell_a` escapes the function body here note: No external requirements --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1 diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 089c88abcdd..5f98a0fd36d 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -23,18 +23,18 @@ LL | | }); = note: number of external vids: 3 = note: where '_#1r: '_#0r -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5 | LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { - | ------ `cell_a` is a reference that is only valid in the closure body + | ------ `cell_a` is a reference that is only valid in the function body LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { LL | | //~^ ERROR LL | | // Only works if 'x: 'y: LL | | demand_y(x, y, x.get()) LL | | //~^ WARNING not reporting region error due to nll LL | | }); - | |______^ `cell_a` escapes the closure body here + | |______^ `cell_a` escapes the function body here note: No external requirements --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1 diff --git a/src/test/ui/nll/issue-50716.stderr b/src/test/ui/nll/issue-50716.stderr index 8acf2ef51ec..f12ab9b4f96 100644 --- a/src/test/ui/nll/issue-50716.stderr +++ b/src/test/ui/nll/issue-50716.stderr @@ -1,11 +1,11 @@ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/issue-50716.rs:25:14 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) - | - `s` is a reference that is only valid in the closure body + | - `s` is a reference that is only valid in the function body ... LL | let _x = *s; //~ ERROR - | ^^ `s` escapes the closure body here + | ^^ `s` escapes the function body here error: aborting due to previous error diff --git a/src/test/ui/nll/mir_check_cast_reify.stderr b/src/test/ui/nll/mir_check_cast_reify.stderr index 13f90e1f159..d8f186a2232 100644 --- a/src/test/ui/nll/mir_check_cast_reify.stderr +++ b/src/test/ui/nll/mir_check_cast_reify.stderr @@ -4,14 +4,14 @@ warning: not reporting region error due to nll LL | let f: fn(_) -> _ = foo; | ^^^ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/mir_check_cast_reify.rs:48:5 | LL | fn bar<'a>(x: &'a u32) -> &'static u32 { - | - `x` is a reference that is only valid in the closure body + | - `x` is a reference that is only valid in the function body ... LL | f(x) - | ^^^^ `x` escapes the closure body here + | ^^^^ `x` escapes the function body here error: aborting due to previous error diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr index b08c6f32e6b..98c03e37814 100644 --- a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr +++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr @@ -4,14 +4,14 @@ warning: not reporting region error due to nll LL | let g: unsafe fn(_) -> _ = f; | ^ -error: borrowed data escapes outside of closure +error: borrowed data escapes outside of function --> $DIR/mir_check_cast_unsafe_fn.rs:20:14 | LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 { - | ----- `input` is a reference that is only valid in the closure body + | ----- `input` is a reference that is only valid in the function body ... LL | unsafe { g(input) } - | ^^^^^^^^ `input` escapes the closure body here + | ^^^^^^^^ `input` escapes the function body here error: aborting due to previous error |
