diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs index 0961203d76d..12b2481cc79 100644 --- a/compiler/rustc_borrowck/src/nll.rs +++ b/compiler/rustc_borrowck/src/nll.rs @@ -389,8 +389,9 @@ pub(super) fn dump_annotation<'a, 'tcx>( // viewing the intraprocedural state, the -Zdump-mir output is // better. + let def_span = tcx.def_span(body.source.def_id()); let mut err = if let Some(closure_region_requirements) = closure_region_requirements { - let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "external requirements"); + let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "external requirements"); regioncx.annotate(tcx, &mut err); @@ -409,7 +410,7 @@ pub(super) fn dump_annotation<'a, 'tcx>( err } else { - let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "no external requirements"); + let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "no external requirements"); regioncx.annotate(tcx, &mut err); err diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr index ff16bf0e078..59b848ea85c 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -2,7 +2,7 @@ note: no external requirements --> $DIR/escape-argument-callee.rs:26:38 | LL | let mut closure = expect_sig(|p, y| *p = y); - | ^^^^^^^^^^^^^ + | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -22,14 +22,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y); note: no external requirements --> $DIR/escape-argument-callee.rs:20:1 | -LL | / fn test() { -LL | | let x = 44; -LL | | let mut p = &x; -LL | | -... | -LL | | deref(p); -LL | | } - | |_^ +LL | fn test() { + | ^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/closure-requirements/escape-argument.stderr b/src/test/ui/nll/closure-requirements/escape-argument.stderr index 49ec0dd931a..ff4e8e590e5 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument.stderr @@ -2,7 +2,7 @@ note: no external requirements --> $DIR/escape-argument.rs:26:38 | LL | let mut closure = expect_sig(|p, y| *p = y); - | ^^^^^^^^^^^^^ + | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -13,14 +13,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y); note: no external requirements --> $DIR/escape-argument.rs:20:1 | -LL | / fn test() { -LL | | let x = 44; -LL | | let mut p = &x; -LL | | -... | -LL | | deref(p); -LL | | } - | |_^ +LL | fn test() { + | ^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr index f0ae4c7fb04..4fbd5eb19a5 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/escape-upvar-nested.rs:21:32 | LL | let mut closure1 = || p = &y; - | ^^^^^^^^^ + | ^^ | = note: defining type: test::{closure#0}::{closure#0} with closure substs [ i16, @@ -15,12 +15,8 @@ LL | let mut closure1 = || p = &y; note: external requirements --> $DIR/escape-upvar-nested.rs:20:27 | -LL | let mut closure = || { - | ___________________________^ -LL | | let mut closure1 = || p = &y; -LL | | closure1(); -LL | | }; - | |_________^ +LL | let mut closure = || { + | ^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -33,14 +29,8 @@ LL | | }; note: no external requirements --> $DIR/escape-upvar-nested.rs:13:1 | -LL | / fn test() { -LL | | let x = 44; -LL | | let mut p = &x; -LL | | -... | -LL | | deref(p); -LL | | } - | |_^ +LL | fn test() { + | ^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr index e99fc4b43a2..bc1ceac5bf0 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/escape-upvar-ref.rs:23:27 | LL | let mut closure = || p = &y; - | ^^^^^^^^^ + | ^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -15,14 +15,8 @@ LL | let mut closure = || p = &y; note: no external requirements --> $DIR/escape-upvar-ref.rs:17:1 | -LL | / fn test() { -LL | | let x = 44; -LL | | let mut p = &x; -LL | | -... | -LL | | deref(p); -LL | | } - | |_^ +LL | fn test() { + | ^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 11420efaa06..0d94fca2823 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -1,12 +1,8 @@ note: no external requirements --> $DIR/propagate-approximated-fail-no-postdom.rs:43:9 | -LL | / |_outlives1, _outlives2, _outlives3, x, y| { -LL | | // Only works if 'x: 'y: -LL | | let p = x.get(); -LL | | demand_y(x, y, p) -LL | | }, - | |_________^ +LL | |_outlives1, _outlives2, _outlives3, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -31,14 +27,8 @@ LL | demand_y(x, y, p) note: no external requirements --> $DIR/propagate-approximated-fail-no-postdom.rs:38:1 | -LL | / fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) { -LL | | establish_relationships( -LL | | cell_a, -LL | | cell_b, -... | -LL | | ); -LL | | } - | |_^ +LL | fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 98c3c28fb43..435a5353340 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -1,13 +1,8 @@ note: external requirements --> $DIR/propagate-approximated-ref.rs:43:47 | -LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { - | _______________________________________________^ -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); - | |_____^ +LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -22,14 +17,8 @@ LL | | }); note: no external requirements --> $DIR/propagate-approximated-ref.rs:42:1 | -LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); -LL | | } - | |_^ +LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 3ab55b370c2..6aafbe42c49 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -1,12 +1,8 @@ note: no external requirements --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:21:15 | -LL | foo(cell, |cell_a, cell_x| { - | _______________^ -LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure -LL | | -LL | | }) - | |_____^ +LL | foo(cell, |cell_a, cell_x| { + | ^^^^^^^^^^^^^^^^ | = note: defining type: case1::{closure#0} with closure substs [ i32, @@ -27,25 +23,16 @@ LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure note: no external requirements --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:18:1 | -LL | / fn case1() { -LL | | let a = 0; -LL | | let cell = Cell::new(&a); -LL | | foo(cell, |cell_a, cell_x| { -... | -LL | | }) -LL | | } - | |_^ +LL | fn case1() { + | ^^^^^^^^^^ | = note: defining type: case1 note: external requirements --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15 | -LL | foo(cell, |cell_a, cell_x| { - | _______________^ -LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error -LL | | }) - | |_____^ +LL | foo(cell, |cell_a, cell_x| { + | ^^^^^^^^^^^^^^^^ | = note: defining type: case2::{closure#0} with closure substs [ i32, @@ -58,14 +45,8 @@ LL | | }) note: no external requirements --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1 | -LL | / fn case2() { -LL | | let a = 0; -LL | | let cell = Cell::new(&a); -LL | | -... | -LL | | }) -LL | | } - | |_^ +LL | fn case2() { + | ^^^^^^^^^^ | = note: defining type: case2 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 6c2314d197b..c95907ea75e 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 @@ -1,14 +1,8 @@ note: external requirements --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47 | -LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { - | _______________________________________________^ -LL | | -LL | | -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | }); - | |_____^ +LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { + | ^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -23,14 +17,8 @@ LL | | }); note: no external requirements --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1 | -LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { -LL | | -LL | | -... | -LL | | }); -LL | | } - | |_^ +LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply 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 22d11552a3f..db58d9d6f1a 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 @@ -1,14 +1,8 @@ note: external requirements --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:35:47 | -LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { - | _______________________________________________^ -LL | | -LL | | -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | }); - | |_____^ +LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -23,14 +17,8 @@ LL | | }); note: no external requirements --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:34:1 | -LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { -LL | | -LL | | -... | -LL | | }); -LL | | } - | |_^ +LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr index 2ec9d4d8db1..be5f1e5ef1a 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -1,13 +1,8 @@ note: external requirements --> $DIR/propagate-approximated-val.rs:36:45 | -LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { - | _____________________________________________^ -LL | | // Only works if 'x: 'y: -LL | | demand_y(outlives1, outlives2, x.get()) -LL | | -LL | | }); - | |_____^ +LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -22,14 +17,8 @@ LL | | }); note: no external requirements --> $DIR/propagate-approximated-val.rs:35:1 | -LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { -LL | | // Only works if 'x: 'y: -LL | | demand_y(outlives1, outlives2, x.get()) -LL | | -LL | | }); -LL | | } - | |_^ +LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index 21e4232c788..d18db97be57 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -1,12 +1,8 @@ note: external requirements --> $DIR/propagate-despite-same-free-region.rs:42:9 | -LL | / |_outlives1, _outlives2, x, y| { -LL | | // Only works if 'x: 'y: -LL | | let p = x.get(); -LL | | demand_y(x, y, p) -LL | | }, - | |_________^ +LL | |_outlives1, _outlives2, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -20,14 +16,8 @@ LL | | }, note: no external requirements --> $DIR/propagate-despite-same-free-region.rs:39:1 | -LL | / fn supply<'a>(cell_a: Cell<&'a u32>) { -LL | | establish_relationships( -LL | | cell_a, -LL | | |_outlives1, _outlives2, x, y| { -... | -LL | | ); -LL | | } - | |_^ +LL | fn supply<'a>(cell_a: Cell<&'a u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index 8b9b0435420..e6f88de4ee8 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -1,13 +1,8 @@ note: no external requirements --> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:35:47 | -LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { - | _______________________________________________^ -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); - | |_____^ +LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { + | ^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -31,14 +26,8 @@ LL | demand_y(x, y, x.get()) note: no external requirements --> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:34:1 | -LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); -LL | | } - | |_^ +LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index 060ce690f03..5f5fce77137 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -1,13 +1,8 @@ note: no external requirements --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:39:47 | -LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { - | _______________________________________________^ -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); - | |_____^ +LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ i16, @@ -31,14 +26,8 @@ LL | demand_y(x, y, x.get()) note: no external requirements --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:38:1 | -LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { -LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { -LL | | // Only works if 'x: 'y: -LL | | demand_y(x, y, x.get()) -LL | | -LL | | }); -LL | | } - | |_^ +LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr index 08605efa2ea..750b08bbe85 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -1,15 +1,8 @@ note: external requirements --> $DIR/propagate-from-trait-match.rs:32:36 | -LL | establish_relationships(value, |value| { - | ____________________________________^ -LL | | -LL | | -LL | | // This function call requires that -... | -LL | | require(value); -LL | | }); - | |_____^ +LL | establish_relationships(value, |value| { + | ^^^^^^^ | = note: defining type: supply::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -25,11 +18,7 @@ note: no external requirements LL | / fn supply<'a, T>(value: T) LL | | where LL | | T: Trait<'a>, -LL | | { -... | -LL | | }); -LL | | } - | |_^ + | |_________________^ | = note: defining type: supply::<'_#1r, T> diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr index 5fc1d5c4361..da89071eabd 100644 --- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -2,7 +2,7 @@ note: no external requirements --> $DIR/return-wrong-bound-region.rs:11:16 | LL | expect_sig(|a, b| b); // ought to return `a` - | ^^^^^^^^ + | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ i16, @@ -22,11 +22,8 @@ LL | expect_sig(|a, b| b); // ought to return `a` note: no external requirements --> $DIR/return-wrong-bound-region.rs:10:1 | -LL | / fn test() { -LL | | expect_sig(|a, b| b); // ought to return `a` -LL | | -LL | | } - | |_^ +LL | fn test() { + | ^^^^^^^^^ | = note: defining type: test diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 8fe25181da1..ee1f7b64bb2 100644 --- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/projection-no-regions-closure.rs:25:23 | LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -18,11 +18,7 @@ note: no external requirements LL | / fn no_region<'a, T>(x: Box) -> Box LL | | where LL | | T: Iterator, -LL | | { -LL | | with_signature(x, |mut y| Box::new(y.next())) -LL | | -LL | | } - | |_^ + | |________________^ | = note: defining type: no_region::<'_#1r, T> @@ -39,7 +35,7 @@ note: external requirements --> $DIR/projection-no-regions-closure.rs:34:23 | LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -55,10 +51,7 @@ note: no external requirements LL | / fn correct_region<'a, T>(x: Box) -> Box LL | | where LL | | T: 'a + Iterator, -LL | | { -LL | | with_signature(x, |mut y| Box::new(y.next())) -LL | | } - | |_^ + | |_____________________^ | = note: defining type: correct_region::<'_#1r, T> @@ -66,7 +59,7 @@ note: external requirements --> $DIR/projection-no-regions-closure.rs:42:23 | LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -82,11 +75,7 @@ note: no external requirements LL | / fn wrong_region<'a, 'b, T>(x: Box) -> Box LL | | where LL | | T: 'b + Iterator, -LL | | { -LL | | with_signature(x, |mut y| Box::new(y.next())) -LL | | -LL | | } - | |_^ + | |_____________________^ | = note: defining type: wrong_region::<'_#1r, '_#2r, T> @@ -103,7 +92,7 @@ note: external requirements --> $DIR/projection-no-regions-closure.rs:52:23 | LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -120,10 +109,7 @@ LL | / fn outlives_region<'a, 'b, T>(x: Box) -> Box LL | | where LL | | T: 'b + Iterator, LL | | 'b: 'a, -LL | | { -LL | | with_signature(x, |mut y| Box::new(y.next())) -LL | | } - | |_^ + | |___________^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T> diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index caf2e3c4747..4e57dfad794 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/projection-one-region-closure.rs:45:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -20,11 +20,7 @@ note: no external requirements LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, -LL | | { -... | -LL | | -LL | | } - | |_^ + | |____________________^ | = note: defining type: no_relationships_late::<'_#1r, T> @@ -56,7 +52,7 @@ note: external requirements --> $DIR/projection-one-region-closure.rs:56:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -74,10 +70,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | 'a: 'a, -... | -LL | | -LL | | } - | |_^ + | |___________^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T> @@ -109,7 +102,7 @@ note: external requirements --> $DIR/projection-one-region-closure.rs:70:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -126,10 +119,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | T::AssocType: 'a, -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |_____________________^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T> @@ -137,7 +127,7 @@ note: external requirements --> $DIR/projection-one-region-closure.rs:80:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -155,10 +145,8 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | T: 'a, -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ +LL | | 'b: 'a, + | |___________^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T> diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index 4eebe682d4f..250c796e2c7 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:37:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -19,11 +19,7 @@ note: no external requirements LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | -LL | | } - | |_^ + | |____________________^ | = note: defining type: no_relationships_late::<'_#1r, T> @@ -44,7 +40,7 @@ note: external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:47:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -61,10 +57,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | 'a: 'a, -... | -LL | | -LL | | } - | |_^ + | |___________^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T> @@ -85,7 +78,7 @@ note: external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:60:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -102,10 +95,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | T::AssocType: 'a, -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |_____________________^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T> @@ -113,7 +103,7 @@ note: external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:69:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -130,10 +120,7 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | 'b: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T> @@ -141,7 +128,7 @@ note: external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:81:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -157,11 +144,7 @@ note: no external requirements LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'a>, -LL | | { -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |____________________^ | = note: defining type: one_region::<'_#1r, T> diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr index 46a02598e19..b27186b0537 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr @@ -2,7 +2,7 @@ note: no external requirements --> $DIR/projection-one-region-trait-bound-static-closure.rs:36:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -17,10 +17,7 @@ note: no external requirements LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |____________________^ | = note: defining type: no_relationships_late::<'_#1r, T> @@ -28,7 +25,7 @@ note: no external requirements --> $DIR/projection-one-region-trait-bound-static-closure.rs:45:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -43,10 +40,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | 'a: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T> @@ -54,7 +48,7 @@ note: no external requirements --> $DIR/projection-one-region-trait-bound-static-closure.rs:64:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -69,10 +63,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | T::AssocType: 'a, -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |_____________________^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T> @@ -80,7 +71,7 @@ note: no external requirements --> $DIR/projection-one-region-trait-bound-static-closure.rs:73:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -95,10 +86,7 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b>, LL | | 'b: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T> @@ -106,7 +94,7 @@ note: no external requirements --> $DIR/projection-one-region-trait-bound-static-closure.rs:85:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -120,11 +108,7 @@ note: no external requirements LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'a>, -LL | | { -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |____________________^ | = note: defining type: one_region::<'_#1r, T> diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index 1ee788b40ab..0195a693e5f 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:38:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -19,11 +19,7 @@ note: no external requirements LL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'c>, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | -LL | | } - | |_^ + | |________________________^ | = note: defining type: no_relationships_late::<'_#1r, '_#2r, T> @@ -40,7 +36,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:48:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, @@ -57,10 +53,7 @@ LL | / fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'c>, LL | | 'a: 'a, -... | -LL | | -LL | | } - | |_^ + | |___________^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T> @@ -77,7 +70,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:61:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, @@ -94,10 +87,7 @@ LL | / fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'c>, LL | | T::AssocType: 'a, -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |_____________________^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T> @@ -105,7 +95,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:70:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, @@ -122,10 +112,7 @@ LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'c>, LL | | 'b: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T> @@ -133,7 +120,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:79:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, @@ -150,10 +137,7 @@ LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'c>, LL | | 'c: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T> @@ -161,7 +145,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:87:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -178,11 +162,7 @@ note: no external requirements LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'b>, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | -LL | | } - | |_^ + | |________________________^ | = note: defining type: two_regions::<'_#1r, T> @@ -203,7 +183,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:97:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -220,10 +200,7 @@ LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'b, 'b>, LL | | 'b: 'a, -LL | | { -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |___________^ | = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T> @@ -231,7 +208,7 @@ note: external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:109:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -247,11 +224,7 @@ note: no external requirements LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T) LL | | where LL | | T: Anything<'a, 'a>, -LL | | { -... | -LL | | with_signature(cell, t, |cell, t| require(cell, t)); -LL | | } - | |_^ + | |________________________^ | = note: defining type: one_region::<'_#1r, T> diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index a4588730b3f..5d9a044d107 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24 | LL | twice(cell, value, |a, b| invoke(a, b)); - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ | = note: defining type: generic::::{closure#0} with closure substs [ i16, @@ -15,11 +15,8 @@ LL | twice(cell, value, |a, b| invoke(a, b)); note: no external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1 | -LL | / fn generic(value: T) { -LL | | let cell = Cell::new(&()); -LL | | twice(cell, value, |a, b| invoke(a, b)); -LL | | } - | |_^ +LL | fn generic(value: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: generic:: @@ -27,7 +24,7 @@ note: external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24 | LL | twice(cell, value, |a, b| invoke(a, b)); - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ | = note: defining type: generic_fail::::{closure#0} with closure substs [ i16, @@ -41,11 +38,8 @@ LL | twice(cell, value, |a, b| invoke(a, b)); note: no external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1 | -LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) { -LL | | twice(cell, value, |a, b| invoke(a, b)); -LL | | -LL | | } - | |_^ +LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: generic_fail:: diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 084dd93cb86..50d9e3aabe2 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -2,7 +2,7 @@ note: external requirements --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23 | LL | with_signature(x, |y| y) - | ^^^^^ + | ^^^ | = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -18,11 +18,7 @@ note: no external requirements LL | / fn no_region<'a, T>(x: Box) -> Box LL | | where LL | | T: Debug, -LL | | { -... | -LL | | -LL | | } - | |_^ + | |_____________^ | = note: defining type: no_region::<'_#1r, T> diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index 11a737ba291..14c55e32a3e 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -1,15 +1,8 @@ note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 | -LL | with_signature(a, b, |x, y| { - | __________________________^ -LL | | -LL | | // -LL | | // See `correct_region`, which explains the point of this -... | -LL | | require(&x, &y) -LL | | }) - | |_____^ +LL | with_signature(a, b, |x, y| { + | ^^^^^^ | = note: defining type: no_region::::{closure#0} with closure substs [ i32, @@ -23,14 +16,8 @@ LL | | }) note: no external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1 | -LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { -LL | | with_signature(a, b, |x, y| { -LL | | -LL | | // -... | -LL | | }) -LL | | } - | |_^ +LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: no_region:: @@ -55,15 +42,8 @@ LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) { note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 | -LL | with_signature(a, b, |x, y| { - | __________________________^ -LL | | // Key point of this test: -LL | | // -LL | | // The *closure* is being type-checked with all of its free -... | -LL | | require(&x, &y) -LL | | }) - | |_____^ +LL | with_signature(a, b, |x, y| { + | ^^^^^^ | = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -79,24 +59,15 @@ note: no external requirements LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T) LL | | where LL | | T: 'a, -LL | | { -... | -LL | | }) -LL | | } - | |_^ + | |__________^ | = note: defining type: correct_region::<'_#1r, T> note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 | -LL | with_signature(a, b, |x, y| { - | __________________________^ -LL | | -LL | | // See `correct_region` -LL | | require(&x, &y) -LL | | }) - | |_____^ +LL | with_signature(a, b, |x, y| { + | ^^^^^^ | = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [ i32, @@ -113,11 +84,7 @@ note: no external requirements LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) LL | | where LL | | T: 'b, -LL | | { -... | -LL | | }) -LL | | } - | |_^ + | |__________^ | = note: defining type: wrong_region::<'_#1r, T> @@ -140,12 +107,8 @@ LL | T: 'b + 'a, note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 | -LL | with_signature(a, b, |x, y| { - | __________________________^ -LL | | // See `correct_region` -LL | | require(&x, &y) -LL | | }) - | |_____^ +LL | with_signature(a, b, |x, y| { + | ^^^^^^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, @@ -162,10 +125,7 @@ LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) LL | | where LL | | T: 'b, LL | | 'b: 'a, -... | -LL | | }) -LL | | } - | |_^ + | |___________^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T>