summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
commit837b550238aa671a591ccf282dddeab29cadb206 (patch)
tree914b6b8862bace72bd3245ca184d374b08d8a672 /tests/ui/nll
parentAdding debian version 1.70.0+dfsg2-1. (diff)
downloadrustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz
rustc-837b550238aa671a591ccf282dddeab29cadb206.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/nll')
-rw-r--r--tests/ui/nll/closure-requirements/escape-argument-callee.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/escape-upvar-nested.stderr8
-rw-r--r--tests/ui/nll/closure-requirements/escape-upvar-ref.stderr4
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr12
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr8
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr6
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr10
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr10
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-val.stderr8
-rw-r--r--tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr6
-rw-r--r--tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr10
-rw-r--r--tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr10
-rw-r--r--tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr6
-rw-r--r--tests/ui/nll/issue-30438-a.rs23
-rw-r--r--tests/ui/nll/issue-30438-a.stderr12
-rw-r--r--tests/ui/nll/issue-30438-b.rs24
-rw-r--r--tests/ui/nll/issue-30438-b.stderr12
-rw-r--r--tests/ui/nll/issue-30438-c.rs20
-rw-r--r--tests/ui/nll/issue-30438-c.stderr9
-rw-r--r--tests/ui/nll/issue-47388.stderr2
-rw-r--r--tests/ui/nll/issue-51244.stderr2
-rw-r--r--tests/ui/nll/issue-54302-cases.rs85
-rw-r--r--tests/ui/nll/issue-54302-cases.stderr38
-rw-r--r--tests/ui/nll/issue-54302.rs19
-rw-r--r--tests/ui/nll/issue-54302.stderr11
-rw-r--r--tests/ui/nll/issue-57989.stderr2
-rw-r--r--tests/ui/nll/member-constraints/min-choice.rs4
-rw-r--r--tests/ui/nll/member-constraints/nested-impl-trait-fail.rs6
-rw-r--r--tests/ui/nll/member-constraints/nested-impl-trait-pass.rs6
-rw-r--r--tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs2
-rw-r--r--tests/ui/nll/ty-outlives/projection-body.rs2
-rw-r--r--tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr32
-rw-r--r--tests/ui/nll/ty-outlives/projection-one-region-closure.stderr40
-rw-r--r--tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr42
-rw-r--r--tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr32
-rw-r--r--tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr82
-rw-r--r--tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr10
-rw-r--r--tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs4
-rw-r--r--tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr8
-rw-r--r--tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr32
-rw-r--r--tests/ui/nll/user-annotations/adt-brace-enums.stderr4
-rw-r--r--tests/ui/nll/user-annotations/adt-brace-structs.stderr4
-rw-r--r--tests/ui/nll/user-annotations/adt-nullary-enums.stderr5
-rw-r--r--tests/ui/nll/user-annotations/adt-tuple-enums.stderr4
-rw-r--r--tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr9
-rw-r--r--tests/ui/nll/user-annotations/adt-tuple-struct.stderr4
-rw-r--r--tests/ui/nll/user-annotations/fns.stderr4
-rw-r--r--tests/ui/nll/user-annotations/method-call.stderr2
-rw-r--r--tests/ui/nll/user-annotations/method-ufcs-3.stderr2
49 files changed, 489 insertions, 210 deletions
diff --git a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
index c0d95ddaa..61233fd84 100644
--- a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
+++ b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
@@ -17,7 +17,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
| - - ^^^^^^ assignment requires that `'1` must outlive `'2`
| | |
| | has type `&'1 i32`
- | has type `&'_#2r mut &'2 i32`
+ | has type `&'?2 mut &'2 i32`
note: no external requirements
--> $DIR/escape-argument-callee.rs:20:1
diff --git a/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr b/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr
index 4fbd5eb19..c00a31ef8 100644
--- a/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr
+++ b/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr
@@ -7,10 +7,10 @@ LL | let mut closure1 = || p = &y;
= note: defining type: test::{closure#0}::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
- (&'_#1r mut &'_#2r i32, &'_#3r i32),
+ (&'?1 mut &'?2 i32, &'?3 i32),
]
= note: number of external vids: 4
- = note: where '_#3r: '_#2r
+ = note: where '?3: '?2
note: external requirements
--> $DIR/escape-upvar-nested.rs:20:27
@@ -21,10 +21,10 @@ LL | let mut closure = || {
= note: defining type: test::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
- (&'_#1r mut &'_#2r i32, &'_#3r i32),
+ (&'?1 mut &'?2 i32, &'?3 i32),
]
= note: number of external vids: 4
- = note: where '_#3r: '_#2r
+ = note: where '?3: '?2
note: no external requirements
--> $DIR/escape-upvar-nested.rs:13:1
diff --git a/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr b/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr
index bc1ceac5b..2d67e6e7d 100644
--- a/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr
+++ b/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr
@@ -7,10 +7,10 @@ LL | let mut closure = || p = &y;
= note: defining type: test::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
- (&'_#1r mut &'_#2r i32, &'_#3r i32),
+ (&'?1 mut &'?2 i32, &'?3 i32),
]
= note: number of external vids: 4
- = note: where '_#3r: '_#2r
+ = note: where '?3: '?2
note: no external requirements
--> $DIR/escape-upvar-ref.rs:17:1
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
index 5a7b12732..ba42576d4 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
@@ -6,20 +6,20 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&'?2 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'?3 u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#4r
- = note: late-bound region is '_#5r
- = note: late-bound region is '_#6r
+ = note: late-bound region is '?4
+ = note: late-bound region is '?5
+ = note: late-bound region is '?6
error: lifetime may not live long enough
--> $DIR/propagate-approximated-fail-no-postdom.rs:46:13
|
LL | |_outlives1, _outlives2, _outlives3, x, y| {
- | ---------- ---------- has type `Cell<&'2 &'_#3r u32>`
+ | ---------- ---------- has type `Cell<&'2 &'?3 u32>`
| |
- | has type `Cell<&'_#1r &'1 u32>`
+ | has type `Cell<&'?1 &'1 u32>`
...
LL | demand_y(x, y, p)
| ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
index db2ecc779..9dd6e0208 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
@@ -6,13 +6,13 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'?2 u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#3r
- = note: late-bound region is '_#4r
+ = note: late-bound region is '?3
+ = note: late-bound region is '?4
= note: number of external vids: 5
- = note: where '_#1r: '_#2r
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/propagate-approximated-ref.rs:42:1
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
index 1d9dafbe5..e2f5576d3 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
@@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case1::{closure#0} with closure substs [
i32,
- for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
(),
]
@@ -36,11 +36,11 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case2::{closure#0} with closure substs [
i32,
- for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
(),
]
= note: number of external vids: 2
- = note: where '_#1r: '_#0r
+ = note: where '?1: '?0
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
index 85f7fe35c..383fb471a 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
@@ -6,13 +6,13 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#2r
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?2
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where '_#1r: '_#0r
+ = note: where '?1: '?0
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1
@@ -40,7 +40,7 @@ LL | | });
| |______`cell_a` escapes the function body here
| argument requires that `'a` must outlive `'static`
|
- = note: requirement occurs because of the type `Cell<&'_#9r u32>`, which makes the generic argument `&'_#9r u32` invariant
+ = note: requirement occurs because of the type `Cell<&'?9 u32>`, which makes the generic argument `&'?9 u32` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
index 7194843e2..ac346c0b1 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
@@ -6,13 +6,13 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&'?2 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#3r
- = note: late-bound region is '_#4r
+ = note: late-bound region is '?3
+ = note: late-bound region is '?4
= note: number of external vids: 5
- = note: where '_#1r: '_#0r
+ = note: where '?1: '?0
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:34:1
@@ -40,7 +40,7 @@ LL | | });
| |______`cell_a` escapes the function body here
| argument requires that `'a` must outlive `'static`
|
- = note: requirement occurs because of the type `Cell<&'_#10r u32>`, which makes the generic argument `&'_#10r u32` invariant
+ = note: requirement occurs because of the type `Cell<&'?10 u32>`, which makes the generic argument `&'?10 u32` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
index 71f8a1c67..b217ae197 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
@@ -6,13 +6,13 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'?2 u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#3r
- = note: late-bound region is '_#4r
+ = note: late-bound region is '?3
+ = note: late-bound region is '?4
= note: number of external vids: 5
- = note: where '_#1r: '_#2r
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/propagate-approximated-val.rs:35:1
diff --git a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
index e1cb97b1c..f31478b6d 100644
--- a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
@@ -6,12 +6,12 @@ LL | |_outlives1, _outlives2, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'?2 u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where '_#1r: '_#2r
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/propagate-despite-same-free-region.rs:39:1
diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
index b66e8391c..1509ade87 100644
--- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
@@ -6,19 +6,19 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'?1 u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#2r
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?2
+ = note: late-bound region is '?3
error: lifetime may not live long enough
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:37:9
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
- | --------- - has type `&'_#7r Cell<&'1 u32>`
+ | --------- - has type `&'?7 Cell<&'1 u32>`
| |
- | has type `&'_#5r Cell<&'2 &'_#1r u32>`
+ | has type `&'?5 Cell<&'2 &'?1 u32>`
LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
index 49641fd06..c85a9872e 100644
--- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
@@ -6,19 +6,19 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'?1 u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'?2 u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
- = note: late-bound region is '_#3r
- = note: late-bound region is '_#4r
+ = note: late-bound region is '?3
+ = note: late-bound region is '?4
error: lifetime may not live long enough
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:41:9
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
- | ---------- ---------- has type `&'_#8r Cell<&'2 &'_#2r u32>`
+ | ---------- ---------- has type `&'?8 Cell<&'2 &'?2 u32>`
| |
- | has type `&'_#6r Cell<&'1 &'_#1r u32>`
+ | has type `&'?6 Cell<&'1 &'?1 u32>`
LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
diff --git a/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr
index 038a5e11f..05e274ab2 100644
--- a/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr
@@ -4,13 +4,13 @@ note: external requirements
LL | establish_relationships(value, |value| {
| ^^^^^^^
|
- = note: defining type: supply::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: supply::<'?1, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((T,)),
(),
]
= note: number of external vids: 2
- = note: where T: '_#1r
+ = note: where T: '?1
note: no external requirements
--> $DIR/propagate-from-trait-match.rs:28:1
@@ -20,7 +20,7 @@ LL | | where
LL | | T: Trait<'a>,
| |_________________^
|
- = note: defining type: supply::<'_#1r, T>
+ = note: defining type: supply::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/propagate-from-trait-match.rs:43:9
diff --git a/tests/ui/nll/issue-30438-a.rs b/tests/ui/nll/issue-30438-a.rs
new file mode 100644
index 000000000..0d4eb796a
--- /dev/null
+++ b/tests/ui/nll/issue-30438-a.rs
@@ -0,0 +1,23 @@
+// Original regression test for Issue #30438.
+
+use std::ops::Index;
+
+struct Test<'a> {
+ s: &'a String
+}
+
+impl <'a> Index<usize> for Test<'a> {
+ type Output = Test<'a>;
+ fn index(&self, _: usize) -> &Self::Output {
+ return &Test { s: &self.s};
+ //~^ ERROR: cannot return reference to temporary value
+ }
+}
+
+fn main() {
+ let s = "Hello World".to_string();
+ let test = Test{s: &s};
+ let r = &test[0];
+ println!("{}", test.s); // OK since test is valid
+ println!("{}", r.s); // Segfault since value pointed by r has already been dropped
+}
diff --git a/tests/ui/nll/issue-30438-a.stderr b/tests/ui/nll/issue-30438-a.stderr
new file mode 100644
index 000000000..53845af82
--- /dev/null
+++ b/tests/ui/nll/issue-30438-a.stderr
@@ -0,0 +1,12 @@
+error[E0515]: cannot return reference to temporary value
+ --> $DIR/issue-30438-a.rs:12:16
+ |
+LL | return &Test { s: &self.s};
+ | ^------------------
+ | ||
+ | |temporary value created here
+ | returns a reference to data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/nll/issue-30438-b.rs b/tests/ui/nll/issue-30438-b.rs
new file mode 100644
index 000000000..79510cdb6
--- /dev/null
+++ b/tests/ui/nll/issue-30438-b.rs
@@ -0,0 +1,24 @@
+// Modified regression test for Issue #30438 that exposed an
+// independent issue (see discussion on ticket).
+
+use std::ops::Index;
+
+struct Test<'a> {
+ s: &'a String
+}
+
+impl <'a> Index<usize> for Test<'a> {
+ type Output = Test<'a>;
+ fn index(&self, _: usize) -> &Self::Output {
+ &Test { s: &self.s}
+ //~^ ERROR: cannot return reference to temporary value
+ }
+}
+
+fn main() {
+ let s = "Hello World".to_string();
+ let test = Test{s: &s};
+ let r = &test[0];
+ println!("{}", test.s); // OK since test is valid
+ println!("{}", r.s); // Segfault since value pointed by r has already been dropped
+}
diff --git a/tests/ui/nll/issue-30438-b.stderr b/tests/ui/nll/issue-30438-b.stderr
new file mode 100644
index 000000000..fd6bd25b1
--- /dev/null
+++ b/tests/ui/nll/issue-30438-b.stderr
@@ -0,0 +1,12 @@
+error[E0515]: cannot return reference to temporary value
+ --> $DIR/issue-30438-b.rs:13:9
+ |
+LL | &Test { s: &self.s}
+ | ^------------------
+ | ||
+ | |temporary value created here
+ | returns a reference to data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/nll/issue-30438-c.rs b/tests/ui/nll/issue-30438-c.rs
new file mode 100644
index 000000000..813c1d3e2
--- /dev/null
+++ b/tests/ui/nll/issue-30438-c.rs
@@ -0,0 +1,20 @@
+// Simplified regression test for #30438, inspired by arielb1.
+
+trait Trait { type Out; }
+
+struct Test<'a> { s: &'a str }
+
+fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
+ let x = Test { s: "this cannot last" };
+ &x
+ //~^ ERROR: cannot return reference to local variable `x`
+}
+
+impl<'b> Trait for Test<'b> { type Out = Test<'b>; }
+
+fn main() {
+ let orig = Test { s: "Hello World" };
+ let r = silly(&orig);
+ println!("{}", orig.s); // OK since `orig` is valid
+ println!("{}", r.s); // Segfault (method does not return a sane value)
+}
diff --git a/tests/ui/nll/issue-30438-c.stderr b/tests/ui/nll/issue-30438-c.stderr
new file mode 100644
index 000000000..7c0010880
--- /dev/null
+++ b/tests/ui/nll/issue-30438-c.stderr
@@ -0,0 +1,9 @@
+error[E0515]: cannot return reference to local variable `x`
+ --> $DIR/issue-30438-c.rs:9:5
+ |
+LL | &x
+ | ^^ returns a reference to data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/nll/issue-47388.stderr b/tests/ui/nll/issue-47388.stderr
index c780451df..09b9d638a 100644
--- a/tests/ui/nll/issue-47388.stderr
+++ b/tests/ui/nll/issue-47388.stderr
@@ -7,7 +7,7 @@ LL | fancy_ref.num = 6;
help: consider changing this to be a mutable reference
|
LL | let fancy_ref = &mut (&mut fancy);
- | ~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/nll/issue-51244.stderr b/tests/ui/nll/issue-51244.stderr
index 03d8acc81..8ccb5809e 100644
--- a/tests/ui/nll/issue-51244.stderr
+++ b/tests/ui/nll/issue-51244.stderr
@@ -7,7 +7,7 @@ LL | *my_ref = 0;
help: consider changing this to be a mutable reference
|
LL | let ref mut my_ref @ _ = 0;
- | ~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/nll/issue-54302-cases.rs b/tests/ui/nll/issue-54302-cases.rs
new file mode 100644
index 000000000..faa116269
--- /dev/null
+++ b/tests/ui/nll/issue-54302-cases.rs
@@ -0,0 +1,85 @@
+trait Mirror {
+ type Image;
+ fn coerce(self) -> Self::Image;
+}
+
+impl<T> Mirror for T {
+ type Image = T;
+ fn coerce(self) -> Self { self }
+}
+
+trait Foo<'x, T> {
+ fn foo(self) -> &'x T;
+}
+
+impl<'s, 'x, T: 'x> Foo<'x, T> for &'s T where &'s T: Foo2<'x, T> {
+ fn foo(self) -> &'x T { self.foo2() }
+}
+
+trait Foo2<'x, T> {
+ fn foo2(self) -> &'x T;
+}
+
+// example 1 - fails leak check
+impl<'x> Foo2<'x, u32> for &'x u32
+{
+ fn foo2(self) -> &'x u32 { self }
+}
+
+// example 2 - OK with this issue
+impl<'x, 'a: 'x> Foo2<'x, i32> for &'a i32
+{
+ fn foo2(self) -> &'x i32 { self }
+}
+
+// example 3 - fails due to issue #XYZ + Leak-check
+impl<'x, T> Foo2<'x, u64> for T
+ where T: Mirror<Image=&'x u64>
+{
+ fn foo2(self) -> &'x u64 { self.coerce() }
+}
+
+// example 4 - fails due to issue #XYZ
+impl<'x, 'a: 'x, T> Foo2<'x, i64> for T
+ where T: Mirror<Image=&'a i64>
+{
+ fn foo2(self) -> &'x i64 { self.coerce() }
+}
+
+
+trait RefFoo<T> {
+ fn ref_foo(&self) -> &'static T;
+}
+
+impl<T> RefFoo<T> for T where for<'a> &'a T: Foo<'static, T> {
+ fn ref_foo(&self) -> &'static T {
+ self.foo()
+ }
+}
+
+
+fn coerce_lifetime1(a: &u32) -> &'static u32
+{
+ <u32 as RefFoo<u32>>::ref_foo(a)
+ //~^ ERROR not general enough
+}
+
+fn coerce_lifetime2(a: &i32) -> &'static i32
+{
+ <i32 as RefFoo<i32>>::ref_foo(a)
+ //~^ ERROR not general enough
+}
+
+fn coerce_lifetime3(a: &u64) -> &'static u64
+{
+ <u64 as RefFoo<u64>>::ref_foo(a)
+ //~^ ERROR not general enough
+}
+
+fn coerce_lifetime4(a: &i64) -> &'static i64
+{
+ <i64 as RefFoo<i64>>::ref_foo(a)
+ //~^ ERROR not general enough
+}
+
+fn main() {}
diff --git a/tests/ui/nll/issue-54302-cases.stderr b/tests/ui/nll/issue-54302-cases.stderr
new file mode 100644
index 000000000..6e8b69c4b
--- /dev/null
+++ b/tests/ui/nll/issue-54302-cases.stderr
@@ -0,0 +1,38 @@
+error: implementation of `Foo` is not general enough
+ --> $DIR/issue-54302-cases.rs:63:5
+ |
+LL | <u32 as RefFoo<u32>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, u32>` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
+
+error: implementation of `Foo` is not general enough
+ --> $DIR/issue-54302-cases.rs:69:5
+ |
+LL | <i32 as RefFoo<i32>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, i32>` would have to be implemented for the type `&'0 i32`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1`
+
+error: implementation of `Foo` is not general enough
+ --> $DIR/issue-54302-cases.rs:75:5
+ |
+LL | <u64 as RefFoo<u64>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, u64>` would have to be implemented for the type `&'0 u64`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1`
+
+error: implementation of `Foo` is not general enough
+ --> $DIR/issue-54302-cases.rs:81:5
+ |
+LL | <i64 as RefFoo<i64>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, i64>` would have to be implemented for the type `&'0 i64`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for some specific lifetime `'1`
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/nll/issue-54302.rs b/tests/ui/nll/issue-54302.rs
new file mode 100644
index 000000000..1bfaebc38
--- /dev/null
+++ b/tests/ui/nll/issue-54302.rs
@@ -0,0 +1,19 @@
+trait Deserialize<'de> {}
+
+trait DeserializeOwned: for<'de> Deserialize<'de> {}
+impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
+
+// Based on this impl, `&'static str` only implements Deserialize<'static>.
+// It does not implement for<'de> Deserialize<'de>.
+impl<'de: 'a, 'a> Deserialize<'de> for &'a str {}
+
+fn main() {
+ // Then why does it implement DeserializeOwned? This compiles.
+ fn assert_deserialize_owned<T: DeserializeOwned>() {}
+ assert_deserialize_owned::<&'static str>();
+ //~^ ERROR not general enough
+
+ // It correctly does not implement for<'de> Deserialize<'de>.
+ //fn assert_hrtb<T: for<'de> Deserialize<'de>>() {}
+ //assert_hrtb::<&'static str>();
+}
diff --git a/tests/ui/nll/issue-54302.stderr b/tests/ui/nll/issue-54302.stderr
new file mode 100644
index 000000000..26c46571f
--- /dev/null
+++ b/tests/ui/nll/issue-54302.stderr
@@ -0,0 +1,11 @@
+error: implementation of `Deserialize` is not general enough
+ --> $DIR/issue-54302.rs:13:5
+ |
+LL | assert_deserialize_owned::<&'static str>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Deserialize` is not general enough
+ |
+ = note: `&'static str` must implement `Deserialize<'0>`, for any lifetime `'0`...
+ = note: ...but `&str` actually implements `Deserialize<'1>`, for some specific lifetime `'1`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/nll/issue-57989.stderr b/tests/ui/nll/issue-57989.stderr
index d5effd6f3..6062b31d6 100644
--- a/tests/ui/nll/issue-57989.stderr
+++ b/tests/ui/nll/issue-57989.stderr
@@ -7,7 +7,7 @@ LL | *x = 0;
help: consider changing this to be a mutable reference
|
LL | fn f(x: &mut i32) {
- | ~~~~~~~~
+ | +++
error[E0506]: cannot assign to `*x` because it is borrowed
--> $DIR/issue-57989.rs:5:5
diff --git a/tests/ui/nll/member-constraints/min-choice.rs b/tests/ui/nll/member-constraints/min-choice.rs
index 14b4dae7a..f4aca69e1 100644
--- a/tests/ui/nll/member-constraints/min-choice.rs
+++ b/tests/ui/nll/member-constraints/min-choice.rs
@@ -1,5 +1,5 @@
-// Assuming that the hidden type in these tests is `&'_#15r u8`,
-// we have a member constraint: `'_#15r member ['static, 'a, 'b, 'c]`.
+// Assuming that the hidden type in these tests is `&'?15 u8`,
+// we have a member constraint: `'?15 member ['static, 'a, 'b, 'c]`.
//
// Make sure we pick up the minimum non-ambiguous region among them.
// We will have to exclude `['b, 'c]` because they're incomparable,
diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs b/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
index 66ff828a8..ceb417f84 100644
--- a/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
+++ b/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
@@ -5,9 +5,9 @@
trait Cap<'a> {}
impl<T> Cap<'_> for T {}
-// Assuming the hidden type is `[&'_#15r u8; 1]`, we have two distinct member constraints:
-// - '_#15r member ['static, 'a, 'b] // from outer impl-trait
-// - '_#15r member ['static, 'a, 'b] // from inner impl-trait
+// Assuming the hidden type is `[&'?15 u8; 1]`, we have two distinct member constraints:
+// - '?15 member ['static, 'a, 'b] // from outer impl-trait
+// - '?15 member ['static, 'a, 'b] // from inner impl-trait
// To satisfy both we can choose 'a or 'b, so it's a failure due to ambiguity.
fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>
where
diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs b/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs
index 15540cb46..4be0f02ac 100644
--- a/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs
+++ b/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs
@@ -5,9 +5,9 @@
trait Cap<'a> {}
impl<T> Cap<'_> for T {}
-// Assuming the hidden type is `[&'_#15r u8; 1]`, we have two distinct member constraints:
-// - '_#15r member ['static, 'a, 'b] // from outer impl-trait
-// - '_#15r member ['static, 'a] // from inner impl-trait
+// Assuming the hidden type is `[&'?15 u8; 1]`, we have two distinct member constraints:
+// - '?15 member ['static, 'a, 'b] // from outer impl-trait
+// - '?15 member ['static, 'a] // from inner impl-trait
// To satisfy both we can only choose 'a.
fn pass_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a>> + Cap<'b>
where
diff --git a/tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs b/tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
index 7cc0acf45..2e9eff593 100644
--- a/tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
+++ b/tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
@@ -5,6 +5,8 @@
// check-pass
// compile-flags:-Zno-leak-check
+#![allow(dropping_copy_types)]
+
fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
panic!()
}
diff --git a/tests/ui/nll/ty-outlives/projection-body.rs b/tests/ui/nll/ty-outlives/projection-body.rs
index b03a539eb..722d67471 100644
--- a/tests/ui/nll/ty-outlives/projection-body.rs
+++ b/tests/ui/nll/ty-outlives/projection-body.rs
@@ -3,6 +3,8 @@
//
// check-pass
+#![allow(dropping_references)]
+
trait MyTrait<'a> {
type Output;
}
diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
index 4933b9348..4eefb180e 100644
--- a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
+++ b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
@@ -4,13 +4,13 @@ note: external requirements
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
- = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: no_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>,
+ extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?2)>,
(),
]
= note: number of external vids: 3
- = note: where <T as std::iter::Iterator>::Item: '_#2r
+ = note: where <T as std::iter::Iterator>::Item: '?2
note: no external requirements
--> $DIR/projection-no-regions-closure.rs:21:1
@@ -20,7 +20,7 @@ LL | | where
LL | | T: Iterator,
| |________________^
|
- = note: defining type: no_region::<'_#1r, T>
+ = note: defining type: no_region::<'?1, T>
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
--> $DIR/projection-no-regions-closure.rs:25:31
@@ -37,13 +37,13 @@ note: external requirements
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
- = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: correct_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>,
+ extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?2)>,
(),
]
= note: number of external vids: 3
- = note: where <T as std::iter::Iterator>::Item: '_#2r
+ = note: where <T as std::iter::Iterator>::Item: '?2
note: no external requirements
--> $DIR/projection-no-regions-closure.rs:30:1
@@ -53,7 +53,7 @@ LL | | where
LL | | T: 'a + Iterator,
| |_____________________^
|
- = note: defining type: correct_region::<'_#1r, T>
+ = note: defining type: correct_region::<'?1, T>
note: external requirements
--> $DIR/projection-no-regions-closure.rs:42:23
@@ -61,13 +61,13 @@ note: external requirements
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
- = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: wrong_region::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>,
+ extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?3)>,
(),
]
= note: number of external vids: 4
- = note: where <T as std::iter::Iterator>::Item: '_#3r
+ = note: where <T as std::iter::Iterator>::Item: '?3
note: no external requirements
--> $DIR/projection-no-regions-closure.rs:38:1
@@ -77,7 +77,7 @@ LL | | where
LL | | T: 'b + Iterator,
| |_____________________^
|
- = note: defining type: wrong_region::<'_#1r, '_#2r, T>
+ = note: defining type: wrong_region::<'?1, '?2, T>
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
--> $DIR/projection-no-regions-closure.rs:42:31
@@ -94,13 +94,13 @@ note: external requirements
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
- = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: outlives_region::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>,
+ extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?3)>,
(),
]
= note: number of external vids: 4
- = note: where <T as std::iter::Iterator>::Item: '_#3r
+ = note: where <T as std::iter::Iterator>::Item: '?3
note: no external requirements
--> $DIR/projection-no-regions-closure.rs:47:1
@@ -111,7 +111,7 @@ LL | | T: 'b + Iterator,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: outlives_region::<'_#1r, '_#2r, T>
+ = note: defining type: outlives_region::<'?1, '?2, T>
error: aborting due to 2 previous errors
diff --git a/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr
index 11ada59c0..986c2bd21 100644
--- a/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr
+++ b/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr
@@ -4,15 +4,15 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_late::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where T: '_#2r
- = note: where '_#1r: '_#2r
+ = note: where T: '?2
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/projection-one-region-closure.rs:41:1
@@ -22,7 +22,7 @@ LL | | where
LL | | T: Anything<'b>,
| |____________________^
|
- = note: defining type: no_relationships_late::<'_#1r, T>
+ = note: defining type: no_relationships_late::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/projection-one-region-closure.rs:45:39
@@ -54,14 +54,14 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_early::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where T: '_#3r
- = note: where '_#2r: '_#3r
+ = note: where T: '?3
+ = note: where '?2: '?3
note: no external requirements
--> $DIR/projection-one-region-closure.rs:51:1
@@ -72,7 +72,7 @@ LL | | T: Anything<'b>,
LL | | 'a: 'a,
| |___________^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
+ = note: defining type: no_relationships_early::<'?1, '?2, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/projection-one-region-closure.rs:56:39
@@ -104,13 +104,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: projection_outlives::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where <T as Anything<'_#2r>>::AssocType: '_#3r
+ = note: where <T as Anything<'?2>>::AssocType: '?3
note: no external requirements
--> $DIR/projection-one-region-closure.rs:62:1
@@ -121,7 +121,7 @@ LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
| |_____________________^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>
+ = note: defining type: projection_outlives::<'?1, '?2, T>
note: external requirements
--> $DIR/projection-one-region-closure.rs:80:29
@@ -129,14 +129,14 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: elements_outlive::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where T: '_#3r
- = note: where '_#2r: '_#3r
+ = note: where T: '?3
+ = note: where '?2: '?3
note: no external requirements
--> $DIR/projection-one-region-closure.rs:74:1
@@ -148,7 +148,7 @@ LL | | T: 'a,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>
+ = note: defining type: elements_outlive::<'?1, '?2, T>
error: aborting due to 4 previous errors
diff --git a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
index 47d4f2e46..25cc60d81 100644
--- a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
+++ b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
@@ -4,14 +4,14 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_late::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where '_#1r: '_#2r
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:33:1
@@ -21,7 +21,7 @@ LL | | where
LL | | T: Anything<'b>,
| |____________________^
|
- = note: defining type: no_relationships_late::<'_#1r, T>
+ = note: defining type: no_relationships_late::<'?1, T>
error: lifetime may not live long enough
--> $DIR/projection-one-region-trait-bound-closure.rs:37:39
@@ -42,13 +42,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_early::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where '_#2r: '_#3r
+ = note: where '?2: '?3
note: no external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:42:1
@@ -59,7 +59,7 @@ LL | | T: Anything<'b>,
LL | | 'a: 'a,
| |___________^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
+ = note: defining type: no_relationships_early::<'?1, '?2, T>
error: lifetime may not live long enough
--> $DIR/projection-one-region-trait-bound-closure.rs:47:39
@@ -80,13 +80,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: projection_outlives::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where <T as Anything<'_#2r>>::AssocType: '_#3r
+ = note: where <T as Anything<'?2>>::AssocType: '?3
note: no external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:52:1
@@ -97,7 +97,7 @@ LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
| |_____________________^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>
+ = note: defining type: projection_outlives::<'?1, '?2, T>
note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:69:29
@@ -105,13 +105,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: elements_outlive::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where '_#2r: '_#3r
+ = note: where '?2: '?3
note: no external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:64:1
@@ -122,7 +122,7 @@ LL | | T: Anything<'b>,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>
+ = note: defining type: elements_outlive::<'?1, '?2, T>
note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:81:29
@@ -130,13 +130,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: one_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: number of external vids: 3
- = note: where '_#1r: '_#2r
+ = note: where '?1: '?2
note: no external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:73:1
@@ -146,7 +146,7 @@ LL | | where
LL | | T: Anything<'a>,
| |____________________^
|
- = note: defining type: one_region::<'_#1r, T>
+ = note: defining type: one_region::<'?1, T>
error: aborting due to 2 previous errors
diff --git a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
index b27186b05..5a092d7b8 100644
--- a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
+++ b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
@@ -4,12 +4,12 @@ note: no external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_late::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:32:1
@@ -19,7 +19,7 @@ LL | | where
LL | | T: Anything<'b>,
| |____________________^
|
- = note: defining type: no_relationships_late::<'_#1r, T>
+ = note: defining type: no_relationships_late::<'?1, T>
note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:45:29
@@ -27,9 +27,9 @@ note: no external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_early::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
@@ -42,7 +42,7 @@ LL | | T: Anything<'b>,
LL | | 'a: 'a,
| |___________^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
+ = note: defining type: no_relationships_early::<'?1, '?2, T>
note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:64:29
@@ -50,9 +50,9 @@ note: no external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: projection_outlives::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
@@ -65,7 +65,7 @@ LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
| |_____________________^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, T>
+ = note: defining type: projection_outlives::<'?1, '?2, T>
note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:73:29
@@ -73,9 +73,9 @@ note: no external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: elements_outlive::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
@@ -88,7 +88,7 @@ LL | | T: Anything<'b>,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: elements_outlive::<'_#1r, '_#2r, T>
+ = note: defining type: elements_outlive::<'?1, '?2, T>
note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:85:29
@@ -96,9 +96,9 @@ note: no external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: one_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
@@ -110,5 +110,5 @@ LL | | where
LL | | T: Anything<'a>,
| |____________________^
|
- = note: defining type: one_region::<'_#1r, T>
+ = note: defining type: one_region::<'?1, T>
diff --git a/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
index 530dd8681..51283aa88 100644
--- a/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
+++ b/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
@@ -4,14 +4,14 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: no_relationships_late::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
- = note: late-bound region is '_#4r
+ = note: late-bound region is '?4
= note: number of external vids: 5
- = note: where <T as Anything<'_#1r, '_#2r>>::AssocType: '_#3r
+ = note: where <T as Anything<'?1, '?2>>::AssocType: '?3
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:34:1
@@ -21,16 +21,16 @@ LL | | where
LL | | T: Anything<'b, 'c>,
| |________________________^
|
- = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>
+ = note: defining type: no_relationships_late::<'?1, '?2, T>
-error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'?5, '?6>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:38:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^
|
- = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: 'a`...
- = note: ...so that the type `<T as Anything<'_#5r, '_#6r>>::AssocType` will meet its required lifetime bounds
+ = help: consider adding an explicit lifetime bound `<T as Anything<'?5, '?6>>::AssocType: 'a`...
+ = note: ...so that the type `<T as Anything<'?5, '?6>>::AssocType` will meet its required lifetime bounds
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
@@ -38,13 +38,13 @@ note: external requirements
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 [
+ = note: defining type: no_relationships_early::<'?1, '?2, '?3, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?4 ()>, T)),
(),
]
= note: number of external vids: 5
- = note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
+ = note: where <T as Anything<'?2, '?3>>::AssocType: '?4
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:43:1
@@ -55,16 +55,16 @@ LL | | T: Anything<'b, 'c>,
LL | | 'a: 'a,
| |___________^
|
- = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>
+ = note: defining type: no_relationships_early::<'?1, '?2, '?3, T>
-error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'?6, '?7>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:48:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^
|
- = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: 'a`...
- = note: ...so that the type `<T as Anything<'_#6r, '_#7r>>::AssocType` will meet its required lifetime bounds
+ = help: consider adding an explicit lifetime bound `<T as Anything<'?6, '?7>>::AssocType: 'a`...
+ = note: ...so that the type `<T as Anything<'?6, '?7>>::AssocType` will meet its required lifetime bounds
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29
@@ -72,13 +72,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
+ = note: defining type: projection_outlives::<'?1, '?2, '?3, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?4 ()>, T)),
(),
]
= note: number of external vids: 5
- = note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
+ = note: where <T as Anything<'?2, '?3>>::AssocType: '?4
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:53:1
@@ -89,7 +89,7 @@ LL | | T: Anything<'b, 'c>,
LL | | T::AssocType: 'a,
| |_____________________^
|
- = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>
+ = note: defining type: projection_outlives::<'?1, '?2, '?3, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:70:29
@@ -97,13 +97,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
+ = note: defining type: elements_outlive1::<'?1, '?2, '?3, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?4 ()>, T)),
(),
]
= note: number of external vids: 5
- = note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
+ = note: where <T as Anything<'?2, '?3>>::AssocType: '?4
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:65:1
@@ -114,7 +114,7 @@ LL | | T: Anything<'b, 'c>,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>
+ = note: defining type: elements_outlive1::<'?1, '?2, '?3, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:79:29
@@ -122,13 +122,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
+ = note: defining type: elements_outlive2::<'?1, '?2, '?3, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?4 ()>, T)),
(),
]
= note: number of external vids: 5
- = note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
+ = note: where <T as Anything<'?2, '?3>>::AssocType: '?4
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:74:1
@@ -139,7 +139,7 @@ LL | | T: Anything<'b, 'c>,
LL | | 'c: 'a,
| |___________^
|
- = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>
+ = note: defining type: elements_outlive2::<'?1, '?2, '?3, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:87:29
@@ -147,14 +147,14 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: two_regions::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where <T as Anything<'_#1r, '_#1r>>::AssocType: '_#2r
+ = note: where <T as Anything<'?1, '?1>>::AssocType: '?2
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:83:1
@@ -164,7 +164,7 @@ LL | | where
LL | | T: Anything<'b, 'b>,
| |________________________^
|
- = note: defining type: two_regions::<'_#1r, T>
+ = note: defining type: two_regions::<'?1, T>
error: lifetime may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:87:5
@@ -178,7 +178,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
- = note: requirement occurs because of the type `Cell<&'_#8r ()>`, which makes the generic argument `&'_#8r ()` invariant
+ = note: requirement occurs because of the type `Cell<&'?8 ()>`, which makes the generic argument `&'?8 ()` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
@@ -188,13 +188,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: two_regions_outlive::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where <T as Anything<'_#2r, '_#2r>>::AssocType: '_#3r
+ = note: where <T as Anything<'?2, '?2>>::AssocType: '?3
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:92:1
@@ -205,7 +205,7 @@ LL | | T: Anything<'b, 'b>,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>
+ = note: defining type: two_regions_outlive::<'?1, '?2, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:109:29
@@ -213,13 +213,13 @@ note: external requirements
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
- = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: one_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: number of external vids: 3
- = note: where <T as Anything<'_#1r, '_#1r>>::AssocType: '_#2r
+ = note: where <T as Anything<'?1, '?1>>::AssocType: '?2
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:101:1
@@ -229,7 +229,7 @@ LL | | where
LL | | T: Anything<'a, 'a>,
| |________________________^
|
- = note: defining type: one_region::<'_#1r, T>
+ = note: defining type: one_region::<'?1, T>
error: aborting due to 3 previous errors
diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
index 2c4a05975..04616f9b7 100644
--- a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
+++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
@@ -6,11 +6,11 @@ LL | twice(cell, value, |a, b| invoke(a, b));
|
= note: defining type: generic::<T>::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
(),
]
= note: number of external vids: 2
- = note: where T: '_#1r
+ = note: where T: '?1
note: no external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
@@ -28,12 +28,12 @@ LL | twice(cell, value, |a, b| invoke(a, b));
|
= note: defining type: generic_fail::<T>::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
(),
]
- = note: late-bound region is '_#2r
+ = note: late-bound region is '?2
= note: number of external vids: 3
- = note: where T: '_#1r
+ = note: where T: '?1
note: no external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
index 4343c3aee..72b18c167 100644
--- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
+++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
@@ -19,8 +19,8 @@ where
// Here, the closure winds up being required to prove that `T:
// 'a`. In principle, it could know that, except that it is
// type-checked in a fully generic way, and hence it winds up with
- // a propagated requirement that `T: '_#2`, where `'_#2` appears
- // in the return type. The caller makes the mapping from `'_#2` to
+ // a propagated requirement that `T: '?2`, where `'?2` appears
+ // in the return type. The caller makes the mapping from `'?2` to
// `'a` (and subsequently reports an error).
with_signature(x, |y| y)
diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
index 35979c8bf..d580774ff 100644
--- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
+++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
@@ -4,13 +4,13 @@ note: external requirements
LL | with_signature(x, |y| y)
| ^^^
|
- = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: no_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>,
+ extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '?2)>,
(),
]
= note: number of external vids: 3
- = note: where T: '_#2r
+ = note: where T: '?2
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-return-type.rs:15:1
@@ -20,7 +20,7 @@ LL | | where
LL | | T: Debug,
| |_____________^
|
- = note: defining type: no_region::<'_#1r, T>
+ = note: defining type: no_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-return-type.rs:26:27
diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
index 4c97db58c..3d4c11a3c 100644
--- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
+++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
@@ -6,12 +6,12 @@ LL | with_signature(a, b, |x, y| {
|
= note: defining type: no_region::<T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?1 ()>, T)),
(),
]
- = note: late-bound region is '_#2r
+ = note: late-bound region is '?2
= note: number of external vids: 3
- = note: where T: '_#1r
+ = note: where T: '?1
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1
@@ -38,13 +38,13 @@ note: external requirements
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
- = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: correct_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: number of external vids: 3
- = note: where T: '_#2r
+ = note: where T: '?2
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:1
@@ -54,7 +54,7 @@ LL | | where
LL | | T: 'a,
| |__________^
|
- = note: defining type: correct_region::<'_#1r, T>
+ = note: defining type: correct_region::<'?1, T>
note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:63:26
@@ -62,14 +62,14 @@ note: external requirements
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
- = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [
+ = note: defining type: wrong_region::<'?1, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
- = note: late-bound region is '_#3r
+ = note: late-bound region is '?3
= note: number of external vids: 4
- = note: where T: '_#2r
+ = note: where T: '?2
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:59:1
@@ -79,7 +79,7 @@ LL | | where
LL | | T: 'b,
| |__________^
|
- = note: defining type: wrong_region::<'_#1r, T>
+ = note: defining type: wrong_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:65:9
@@ -98,13 +98,13 @@ note: external requirements
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
- = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
+ = note: defining type: outlives_region::<'?1, '?2, T>::{closure#0} with closure substs [
i32,
- extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
+ extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
- = note: where T: '_#3r
+ = note: where T: '?3
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:71:1
@@ -115,7 +115,7 @@ LL | | T: 'b,
LL | | 'b: 'a,
| |___________^
|
- = note: defining type: outlives_region::<'_#1r, '_#2r, T>
+ = note: defining type: outlives_region::<'?1, '?2, T>
error: aborting due to 2 previous errors
diff --git a/tests/ui/nll/user-annotations/adt-brace-enums.stderr b/tests/ui/nll/user-annotations/adt-brace-enums.stderr
index 9e94fd5a7..900e7e253 100644
--- a/tests/ui/nll/user-annotations/adt-brace-enums.stderr
+++ b/tests/ui/nll/user-annotations/adt-brace-enums.stderr
@@ -31,7 +31,9 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | SomeEnum::SomeVariant::<&'a u32> { t: &c };
| ^^
| |
diff --git a/tests/ui/nll/user-annotations/adt-brace-structs.stderr b/tests/ui/nll/user-annotations/adt-brace-structs.stderr
index cbb7f6a55..d61643dc6 100644
--- a/tests/ui/nll/user-annotations/adt-brace-structs.stderr
+++ b/tests/ui/nll/user-annotations/adt-brace-structs.stderr
@@ -31,7 +31,9 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | SomeStruct::<&'a u32> { t: &c };
| ^^
| |
diff --git a/tests/ui/nll/user-annotations/adt-nullary-enums.stderr b/tests/ui/nll/user-annotations/adt-nullary-enums.stderr
index bca85a90d..5b385feee 100644
--- a/tests/ui/nll/user-annotations/adt-nullary-enums.stderr
+++ b/tests/ui/nll/user-annotations/adt-nullary-enums.stderr
@@ -34,7 +34,10 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
+LL | combine(
LL | SomeEnum::SomeVariant(Cell::new(&c)),
| ----------^^-
| | |
diff --git a/tests/ui/nll/user-annotations/adt-tuple-enums.stderr b/tests/ui/nll/user-annotations/adt-tuple-enums.stderr
index d2d85ec2b..766da9ec0 100644
--- a/tests/ui/nll/user-annotations/adt-tuple-enums.stderr
+++ b/tests/ui/nll/user-annotations/adt-tuple-enums.stderr
@@ -31,7 +31,9 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | SomeEnum::SomeVariant::<&'a u32>(&c);
| ^^
| |
diff --git a/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr b/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
index b7bc2a10b..2084697e7 100644
--- a/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
+++ b/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
@@ -33,7 +33,10 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
+LL | let f = SomeStruct::<&'a u32>;
LL | f(&c);
| --^^-
| | |
@@ -47,7 +50,9 @@ error[E0597]: `c` does not live long enough
|
LL | let f = SomeStruct::<&'a u32>;
| - lifetime `'1` appears in the type of `f`
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | f(&c);
| --^^-
| | |
diff --git a/tests/ui/nll/user-annotations/adt-tuple-struct.stderr b/tests/ui/nll/user-annotations/adt-tuple-struct.stderr
index 97d39da26..c7480f529 100644
--- a/tests/ui/nll/user-annotations/adt-tuple-struct.stderr
+++ b/tests/ui/nll/user-annotations/adt-tuple-struct.stderr
@@ -31,7 +31,9 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | SomeStruct::<&'a u32>(&c);
| ^^
| |
diff --git a/tests/ui/nll/user-annotations/fns.stderr b/tests/ui/nll/user-annotations/fns.stderr
index 8b53e138d..abaa35e95 100644
--- a/tests/ui/nll/user-annotations/fns.stderr
+++ b/tests/ui/nll/user-annotations/fns.stderr
@@ -31,7 +31,9 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-...
+LL | let _closure = || {
+LL | let c = 66;
+ | - binding `c` declared here
LL | some_fn::<&'a u32>(&c);
| -------------------^^-
| | |
diff --git a/tests/ui/nll/user-annotations/method-call.stderr b/tests/ui/nll/user-annotations/method-call.stderr
index 3803cbf77..b4d1ac042 100644
--- a/tests/ui/nll/user-annotations/method-call.stderr
+++ b/tests/ui/nll/user-annotations/method-call.stderr
@@ -33,6 +33,8 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
+LL | let c = 66;
+ | - binding `c` declared here
LL | a.method::<&'a u32>(b, &c);
| ------------------------^^-
| | |
diff --git a/tests/ui/nll/user-annotations/method-ufcs-3.stderr b/tests/ui/nll/user-annotations/method-ufcs-3.stderr
index 8cb995a03..4dd39e108 100644
--- a/tests/ui/nll/user-annotations/method-ufcs-3.stderr
+++ b/tests/ui/nll/user-annotations/method-ufcs-3.stderr
@@ -33,6 +33,8 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
+LL | let c = 66;
+ | - binding `c` declared here
LL | <_ as Bazoom<_>>::method::<&'a u32>(&a, b, &c);
| -------------------------------------------^^-
| | |