summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-05 19:03:17 +0100
committerGitHub <noreply@github.com>2019-12-05 19:03:17 +0100
commit7945dcdfdcbd5ad9ce798339409e48d814a06787 (patch)
treeb67472bd22bc5809eac0a75c4872e93a8d5f4701
parentRollup merge of #67010 - estebank:raw-idents, r=Centril (diff)
parentInclude a span in more `expected...found` notes (diff)
downloadrust-7945dcdfdcbd5ad9ce798339409e48d814a06787.tar.gz
rust-7945dcdfdcbd5ad9ce798339409e48d814a06787.tar.bz2
rust-7945dcdfdcbd5ad9ce798339409e48d814a06787.tar.xz
Rollup merge of #67011 - Aaron1011:fix/expected-found-span, r=Dylan-DPC
Include a span in more `expected...found` notes In most places, we use a span when emitting `expected...found` errors. However, there were a couple of places where we didn't use any span, resulting in hard-to-interpret error messages. This commit attaches the relevant span to these notes, and additionally switches over to using `note_expected_found` instead of manually formatting the message
-rw-r--r--src/librustc/infer/error_reporting/mod.rs15
-rw-r--r--src/librustc/infer/error_reporting/note.rs20
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr20
-rw-r--r--src/test/ui/c-variadic/variadic-ffi-4.stderr10
-rw-r--r--src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr20
-rw-r--r--src/test/ui/issues/issue-16683.stderr10
-rw-r--r--src/test/ui/issues/issue-17758.stderr10
-rw-r--r--src/test/ui/issues/issue-20831-debruijn.stderr16
-rw-r--r--src/test/ui/issues/issue-52213.stderr10
-rw-r--r--src/test/ui/issues/issue-55796.stderr20
-rw-r--r--src/test/ui/nll/issue-55394.stderr10
-rw-r--r--src/test/ui/nll/normalization-bounds-error.stderr10
-rw-r--r--src/test/ui/nll/type-alias-free-regions.stderr40
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr10
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr10
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-elision.stderr20
-rw-r--r--src/test/ui/regions/region-object-lifetime-in-coercion.stderr20
-rw-r--r--src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr20
-rw-r--r--src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr10
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-2.stderr10
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-4.stderr10
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr10
-rw-r--r--src/test/ui/regions/regions-creating-enums4.stderr20
-rw-r--r--src/test/ui/regions/regions-escape-method.stderr10
-rw-r--r--src/test/ui/regions/regions-escape-via-trait-or-not.stderr10
-rw-r--r--src/test/ui/regions/regions-nested-fns.stderr15
-rw-r--r--src/test/ui/regions/regions-normalize-in-where-clause-list.stderr13
-rw-r--r--src/test/ui/regions/regions-ret-borrowed-1.stderr10
-rw-r--r--src/test/ui/regions/regions-ret-borrowed.stderr10
-rw-r--r--src/test/ui/regions/regions-trait-object-subtyping.stderr10
-rw-r--r--src/test/ui/reject-specialized-drops-8142.stderr10
-rw-r--r--src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr10
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr10
33 files changed, 325 insertions, 134 deletions
diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs
index 5a940f2..58c1498 100644
--- a/src/librustc/infer/error_reporting/mod.rs
+++ b/src/librustc/infer/error_reporting/mod.rs
@@ -1809,12 +1809,17 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1809 sub_region, 1809 sub_region,
1810 "...", 1810 "...",
1811 ); 1811 );
1812 err.note(&format!( 1812 err.span_note(sup_trace.cause.span, &format!(
1813 "...so that the {}:\nexpected {}\n found {}", 1813 "...so that the {}",
1814 sup_trace.cause.as_requirement_str(), 1814 sup_trace.cause.as_requirement_str()
1815 sup_expected.content(),
1816 sup_found.content()
1817 )); 1815 ));
1816
1817 err.note_expected_found(
1818 &"",
1819 sup_expected,
1820 &"",
1821 sup_found
1822 );
1818 err.emit(); 1823 err.emit();
1819 return; 1824 return;
1820 } 1825 }
diff --git a/src/librustc/infer/error_reporting/note.rs b/src/librustc/infer/error_reporting/note.rs
index c1f840a..4b93373 100644
--- a/src/librustc/infer/error_reporting/note.rs
+++ b/src/librustc/infer/error_reporting/note.rs
@@ -13,12 +13,20 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13 match *origin { 13 match *origin {
14 infer::Subtype(ref trace) => { 14 infer::Subtype(ref trace) => {
15 if let Some((expected, found)) = self.values_str(&trace.values) { 15 if let Some((expected, found)) = self.values_str(&trace.values) {
16 let expected = expected.content(); 16 err.span_note(
17 let found = found.content(); 17 trace.cause.span,
18 err.note(&format!("...so that the {}:\nexpected {}\n found {}", 18 &format!(
19 trace.cause.as_requirement_str(), 19 "...so that the {}",
20 expected, 20 trace.cause.as_requirement_str()
21 found)); 21 )
22 );
23
24 err.note_expected_found(
25 &"",
26 expected,
27 &"",
28 found
29 );
22 } else { 30 } else {
23 // FIXME: this really should be handled at some earlier stage. Our 31 // FIXME: this really should be handled at some earlier stage. Our
24 // handling of region checking when type errors are present is 32 // handling of region checking when type errors are present is
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
index 627609c..3e39c8a 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
@@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { 10LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected Type<'_> 13 --> $DIR/project-fn-ret-invariant.rs:48:13
14 found Type<'a> 14 |
15LL | bar(foo, x)
16 | ^
17 = note: expected `Type<'_>`
18 found `Type<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16 = note: ...so that the expression is assignable: 20note: ...so that the expression is assignable
17 expected Type<'static> 21 --> $DIR/project-fn-ret-invariant.rs:48:4
18 found Type<'_> 22 |
23LL | bar(foo, x)
24 | ^^^^^^^^^^^
25 = note: expected `Type<'static>`
26 found `Type<'_>`
19 27
20error: aborting due to previous error 28error: aborting due to previous error
21 29
diff --git a/src/test/ui/c-variadic/variadic-ffi-4.stderr b/src/test/ui/c-variadic/variadic-ffi-4.stderr
index c80ed5e..cd4cd8b 100644
--- a/src/test/ui/c-variadic/variadic-ffi-4.stderr
+++ b/src/test/ui/c-variadic/variadic-ffi-4.stderr
@@ -49,9 +49,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
49 | 49 |
50LL | let _ = ap.with_copy(|ap| { ap }); 50LL | let _ = ap.with_copy(|ap| { ap });
51 | ^^^^^^^^^^^ 51 | ^^^^^^^^^^^
52 = note: ...so that the expression is assignable: 52note: ...so that the expression is assignable
53 expected core::ffi::VaList<'_, '_> 53 --> $DIR/variadic-ffi-4.rs:16:33
54 found core::ffi::VaList<'_, '_> 54 |
55LL | let _ = ap.with_copy(|ap| { ap });
56 | ^^
57 = note: expected `core::ffi::VaList<'_, '_>`
58 found `core::ffi::VaList<'_, '_>`
55note: but, the lifetime must be valid for the method call at 16:13... 59note: but, the lifetime must be valid for the method call at 16:13...
56 --> $DIR/variadic-ffi-4.rs:16:13 60 --> $DIR/variadic-ffi-4.rs:16:13
57 | 61 |
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
index 5e80c67..3300293 100644
--- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
+++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
@@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) { 10LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected std::boxed::Box<dyn std::fmt::Debug> 13 --> $DIR/dyn-trait.rs:20:16
14 found std::boxed::Box<(dyn std::fmt::Debug + 'a)> 14 |
15LL | static_val(x);
16 | ^
17 = note: expected `std::boxed::Box<dyn std::fmt::Debug>`
18 found `std::boxed::Box<(dyn std::fmt::Debug + 'a)>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16 = note: ...so that the types are compatible: 20note: ...so that the types are compatible
17 expected StaticTrait 21 --> $DIR/dyn-trait.rs:20:5
18 found StaticTrait 22 |
23LL | static_val(x);
24 | ^^^^^^^^^^
25 = note: expected `StaticTrait`
26 found `StaticTrait`
19 27
20error: aborting due to previous error 28error: aborting due to previous error
21 29
diff --git a/src/test/ui/issues/issue-16683.stderr b/src/test/ui/issues/issue-16683.stderr
index b663e21..99700f2 100644
--- a/src/test/ui/issues/issue-16683.stderr
+++ b/src/test/ui/issues/issue-16683.stderr
@@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr
21 | 21 |
22LL | trait T<'a> { 22LL | trait T<'a> {
23 | ^^ 23 | ^^
24 = note: ...so that the types are compatible: 24note: ...so that the types are compatible
25 expected &'a Self 25 --> $DIR/issue-16683.rs:4:14
26 found &Self 26 |
27LL | self.a();
28 | ^
29 = note: expected `&'a Self`
30 found `&Self`
27 31
28error: aborting due to previous error 32error: aborting due to previous error
29 33
diff --git a/src/test/ui/issues/issue-17758.stderr b/src/test/ui/issues/issue-17758.stderr
index adcbb62..adfc3f508 100644
--- a/src/test/ui/issues/issue-17758.stderr
+++ b/src/test/ui/issues/issue-17758.stderr
@@ -22,9 +22,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr
22 | 22 |
23LL | trait Foo<'a> { 23LL | trait Foo<'a> {
24 | ^^ 24 | ^^
25 = note: ...so that the types are compatible: 25note: ...so that the types are compatible
26 expected &'a Self 26 --> $DIR/issue-17758.rs:7:14
27 found &Self 27 |
28LL | self.foo();
29 | ^^^
30 = note: expected `&'a Self`
31 found `&Self`
28 32
29error: aborting due to previous error 33error: aborting due to previous error
30 34
diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr
index 13c9c09..c7fd134 100644
--- a/src/test/ui/issues/issue-20831-debruijn.stderr
+++ b/src/test/ui/issues/issue-20831-debruijn.stderr
@@ -88,9 +88,19 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
88 | 88 |
89LL | impl<'a> Publisher<'a> for MyStruct<'a> { 89LL | impl<'a> Publisher<'a> for MyStruct<'a> {
90 | ^^ 90 | ^^
91 = note: ...so that the types are compatible: 91note: ...so that the types are compatible
92 expected Publisher<'_> 92 --> $DIR/issue-20831-debruijn.rs:28:5
93 found Publisher<'_> 93 |
94LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
95LL | | // Not obvious, but there is an implicit lifetime here -------^
96LL | |
97LL | |
98... |
99LL | | self.sub = t;
100LL | | }
101 | |_____^
102 = note: expected `Publisher<'_>`
103 found `Publisher<'_>`
94 104
95error: aborting due to 3 previous errors 105error: aborting due to 3 previous errors
96 106
diff --git a/src/test/ui/issues/issue-52213.stderr b/src/test/ui/issues/issue-52213.stderr
index b79a5dd..a8960f7 100644
--- a/src/test/ui/issues/issue-52213.stderr
+++ b/src/test/ui/issues/issue-52213.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { 10LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected (&&(T,),) 13 --> $DIR/issue-52213.rs:2:11
14 found (&&'a (T,),) 14 |
15LL | match (&t,) {
16 | ^^^^^
17 = note: expected `(&&(T,),)`
18 found `(&&'a (T,),)`
15note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27... 19note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27...
16 --> $DIR/issue-52213.rs:1:27 20 --> $DIR/issue-52213.rs:1:27
17 | 21 |
diff --git a/src/test/ui/issues/issue-55796.stderr b/src/test/ui/issues/issue-55796.stderr
index 7b910f5..b8cafdc 100644
--- a/src/test/ui/issues/issue-55796.stderr
+++ b/src/test/ui/issues/issue-55796.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closu
15LL | Box::new(self.out_edges(u).map(|e| e.target())) 15LL | Box::new(self.out_edges(u).map(|e| e.target()))
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)> 19 --> $DIR/issue-55796.rs:16:9
20 found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>> 20 |
21LL | Box::new(self.out_edges(u).map(|e| e.target()))
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
24 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
21 25
22error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
23 --> $DIR/issue-55796.rs:21:9 27 --> $DIR/issue-55796.rs:21:9
@@ -36,9 +40,13 @@ note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closu
36LL | Box::new(self.in_edges(u).map(|e| e.target())) 40LL | Box::new(self.in_edges(u).map(|e| e.target()))
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 = note: but, the lifetime must be valid for the static lifetime... 42 = note: but, the lifetime must be valid for the static lifetime...
39 = note: ...so that the expression is assignable: 43note: ...so that the expression is assignable
40 expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)> 44 --> $DIR/issue-55796.rs:21:9
41 found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>> 45 |
46LL | Box::new(self.in_edges(u).map(|e| e.target()))
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
49 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
42 50
43error: aborting due to 2 previous errors 51error: aborting due to 2 previous errors
44 52
diff --git a/src/test/ui/nll/issue-55394.stderr b/src/test/ui/nll/issue-55394.stderr
index 714a63b..69a6ab0 100644
--- a/src/test/ui/nll/issue-55394.stderr
+++ b/src/test/ui/nll/issue-55394.stderr
@@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'_` as defined on the im
21 | 21 |
22LL | impl Foo<'_> { 22LL | impl Foo<'_> {
23 | ^^ 23 | ^^
24 = note: ...so that the expression is assignable: 24note: ...so that the expression is assignable
25 expected Foo<'_> 25 --> $DIR/issue-55394.rs:9:9
26 found Foo<'_> 26 |
27LL | Foo { bar }
28 | ^^^^^^^^^^^
29 = note: expected `Foo<'_>`
30 found `Foo<'_>`
27 31
28error: aborting due to previous error 32error: aborting due to previous error
29 33
diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr
index 3a152fb..58f2067 100644
--- a/src/test/ui/nll/normalization-bounds-error.stderr
+++ b/src/test/ui/nll/normalization-bounds-error.stderr
@@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
14 | 14 |
15LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} 15LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
16 | ^^ 16 | ^^
17 = note: ...so that the types are compatible: 17note: ...so that the types are compatible
18 expected Visitor<'d> 18 --> $DIR/normalization-bounds-error.rs:12:1
19 found Visitor<'_> 19 |
20LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 = note: expected `Visitor<'d>`
23 found `Visitor<'_>`
20 24
21error: aborting due to previous error 25error: aborting due to previous error
22 26
diff --git a/src/test/ui/nll/type-alias-free-regions.stderr b/src/test/ui/nll/type-alias-free-regions.stderr
index 6986389..5191dec 100644
--- a/src/test/ui/nll/type-alias-free-regions.stderr
+++ b/src/test/ui/nll/type-alias-free-regions.stderr
@@ -11,17 +11,25 @@ LL | / fn from_box(b: Box<B>) -> Self {
11LL | | C { f: b } 11LL | | C { f: b }
12LL | | } 12LL | | }
13 | |_____^ 13 | |_____^
14 = note: ...so that the expression is assignable: 14note: ...so that the expression is assignable
15 expected std::boxed::Box<std::boxed::Box<&isize>> 15 --> $DIR/type-alias-free-regions.rs:17:16
16 found std::boxed::Box<std::boxed::Box<&isize>> 16 |
17LL | C { f: b }
18 | ^
19 = note: expected `std::boxed::Box<std::boxed::Box<&isize>>`
20 found `std::boxed::Box<std::boxed::Box<&isize>>`
17note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6... 21note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6...
18 --> $DIR/type-alias-free-regions.rs:15:6 22 --> $DIR/type-alias-free-regions.rs:15:6
19 | 23 |
20LL | impl<'a> FromBox<'a> for C<'a> { 24LL | impl<'a> FromBox<'a> for C<'a> {
21 | ^^ 25 | ^^
22 = note: ...so that the expression is assignable: 26note: ...so that the expression is assignable
23 expected C<'a> 27 --> $DIR/type-alias-free-regions.rs:17:9
24 found C<'_> 28 |
29LL | C { f: b }
30 | ^^^^^^^^^^
31 = note: expected `C<'a>`
32 found `C<'_>`
25 33
26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 34error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27 --> $DIR/type-alias-free-regions.rs:27:16 35 --> $DIR/type-alias-free-regions.rs:27:16
@@ -36,17 +44,25 @@ LL | / fn from_tuple(b: (B,)) -> Self {
36LL | | C { f: Box::new(b.0) } 44LL | | C { f: Box::new(b.0) }
37LL | | } 45LL | | }
38 | |_____^ 46 | |_____^
39 = note: ...so that the expression is assignable: 47note: ...so that the expression is assignable
40 expected std::boxed::Box<&isize> 48 --> $DIR/type-alias-free-regions.rs:27:25
41 found std::boxed::Box<&isize> 49 |
50LL | C { f: Box::new(b.0) }
51 | ^^^
52 = note: expected `std::boxed::Box<&isize>`
53 found `std::boxed::Box<&isize>`
42note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6... 54note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6...
43 --> $DIR/type-alias-free-regions.rs:25:6 55 --> $DIR/type-alias-free-regions.rs:25:6
44 | 56 |
45LL | impl<'a> FromTuple<'a> for C<'a> { 57LL | impl<'a> FromTuple<'a> for C<'a> {
46 | ^^ 58 | ^^
47 = note: ...so that the expression is assignable: 59note: ...so that the expression is assignable
48 expected C<'a> 60 --> $DIR/type-alias-free-regions.rs:27:9
49 found C<'_> 61 |
62LL | C { f: Box::new(b.0) }
63 | ^^^^^^^^^^^^^^^^^^^^^^
64 = note: expected `C<'a>`
65 found `C<'_>`
50 66
51error: aborting due to 2 previous errors 67error: aborting due to 2 previous errors
52 68
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
index 4ebd991..37be450 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn foo<'a>(_: &'a u32) -> &'static u32 { 10LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'_> 13 --> $DIR/constant-in-expr-inherent-1.rs:8:5
14 found Foo<'a> 14 |
15LL | <Foo<'a>>::C
16 | ^^^^^^^^^^^^
17 = note: expected `Foo<'_>`
18 found `Foo<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that reference does not outlive borrowed content 20note: ...so that reference does not outlive borrowed content
17 --> $DIR/constant-in-expr-inherent-1.rs:8:5 21 --> $DIR/constant-in-expr-inherent-1.rs:8:5
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
index d61659e..4ee3284 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { 10LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'_> 13 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
14 found Foo<'a> 14 |
15LL | T::C
16 | ^^^^
17 = note: expected `Foo<'_>`
18 found `Foo<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that reference does not outlive borrowed content 20note: ...so that reference does not outlive borrowed content
17 --> $DIR/constant-in-expr-trait-item-3.rs:10:5 21 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
index d66322c..1952ee8 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
@@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
19 | 19 |
20LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { 20LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
21 | ^^ 21 | ^^
22 = note: ...so that the expression is assignable: 22note: ...so that the expression is assignable
23 expected &'b (dyn SomeTrait + 'b) 23 --> $DIR/object-lifetime-default-elision.rs:71:5
24 found &dyn SomeTrait 24 |
25LL | ss
26 | ^^
27 = note: expected `&'b (dyn SomeTrait + 'b)`
28 found `&dyn SomeTrait`
25 29
26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 30error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27 --> $DIR/object-lifetime-default-elision.rs:71:5 31 --> $DIR/object-lifetime-default-elision.rs:71:5
@@ -44,9 +48,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
44 | 48 |
45LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { 49LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
46 | ^^ 50 | ^^
47 = note: ...so that the expression is assignable: 51note: ...so that the expression is assignable
48 expected &'b (dyn SomeTrait + 'b) 52 --> $DIR/object-lifetime-default-elision.rs:71:5
49 found &dyn SomeTrait 53 |
54LL | ss
55 | ^^
56 = note: expected `&'b (dyn SomeTrait + 'b)`
57 found `&dyn SomeTrait`
50 58
51error: aborting due to 2 previous errors 59error: aborting due to 2 previous errors
52 60
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
index 14934d6..e889651 100644
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
+++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
@@ -34,17 +34,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
34 | 34 |
35LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> { 35LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
36 | ^^ 36 | ^^
37 = note: ...so that the expression is assignable: 37note: ...so that the expression is assignable
38 expected &[u8] 38 --> $DIR/region-object-lifetime-in-coercion.rs:26:14
39 found &'a [u8] 39 |
40LL | Box::new(v)
41 | ^
42 = note: expected `&[u8]`
43 found `&'a [u8]`
40note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9... 44note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9...
41 --> $DIR/region-object-lifetime-in-coercion.rs:25:9 45 --> $DIR/region-object-lifetime-in-coercion.rs:25:9
42 | 46 |
43LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> { 47LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
44 | ^^ 48 | ^^
45 = note: ...so that the expression is assignable: 49note: ...so that the expression is assignable
46 expected std::boxed::Box<(dyn Foo + 'b)> 50 --> $DIR/region-object-lifetime-in-coercion.rs:26:5
47 found std::boxed::Box<dyn Foo> 51 |
52LL | Box::new(v)
53 | ^^^^^^^^^^^
54 = note: expected `std::boxed::Box<(dyn Foo + 'b)>`
55 found `std::boxed::Box<dyn Foo>`
48 56
49error: aborting due to 4 previous errors 57error: aborting due to 4 previous errors
50 58
diff --git a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
index a636c9e..865e967 100644
--- a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
9 | 9 |
10LL | impl<'a> Foo<'static> for &'a i32 { 10LL | impl<'a> Foo<'static> for &'a i32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'static> 13 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
14 found Foo<'static> 14 |
15LL | impl<'a> Foo<'static> for &'a i32 {
16 | ^^^^^^^^^^^^
17 = note: expected `Foo<'static>`
18 found `Foo<'static>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that the type `&i32` will meet its required lifetime bounds 20note: ...so that the type `&i32` will meet its required lifetime bounds
17 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10 21 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
@@ -30,9 +34,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
30 | 34 |
31LL | impl<'a,'b> Foo<'b> for &'a i64 { 35LL | impl<'a,'b> Foo<'b> for &'a i64 {
32 | ^^ 36 | ^^
33 = note: ...so that the types are compatible: 37note: ...so that the types are compatible
34 expected Foo<'b> 38 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:13
35 found Foo<'_> 39 |
40LL | impl<'a,'b> Foo<'b> for &'a i64 {
41 | ^^^^^^^
42 = note: expected `Foo<'b>`
43 found `Foo<'_>`
36note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9... 44note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9...
37 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9 45 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9
38 | 46 |
diff --git a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
index 81256e3..6a34871 100644
--- a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
9 | 9 |
10LL | impl<'a> Foo for &'a i32 { 10LL | impl<'a> Foo for &'a i32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo 13 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10
14 found Foo 14 |
15LL | impl<'a> Foo for &'a i32 {
16 | ^^^
17 = note: expected `Foo`
18 found `Foo`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that the type `&i32` will meet its required lifetime bounds 20note: ...so that the type `&i32` will meet its required lifetime bounds
17 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10 21 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr
index 8e473da..28873ab 100644
--- a/src/test/ui/regions/regions-close-object-into-object-2.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `(dyn A<T> + 'a)` is not borrowed for too long
15LL | box B(&*v) as Box<dyn X> 15LL | box B(&*v) as Box<dyn X>
16 | ^^^ 16 | ^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn X + 'static)> 19 --> $DIR/regions-close-object-into-object-2.rs:10:5
20 found std::boxed::Box<dyn X> 20 |
21LL | box B(&*v) as Box<dyn X>
22 | ^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn X + 'static)>`
24 found `std::boxed::Box<dyn X>`
21 25
22error: aborting due to previous error 26error: aborting due to previous error
23 27
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr
index c80d13e..449a5b5 100644
--- a/src/test/ui/regions/regions-close-object-into-object-4.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `(dyn A<U> + 'a)` is not borrowed for too long
15LL | box B(&*v) as Box<dyn X> 15LL | box B(&*v) as Box<dyn X>
16 | ^^^ 16 | ^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn X + 'static)> 19 --> $DIR/regions-close-object-into-object-4.rs:10:5
20 found std::boxed::Box<dyn X> 20 |
21LL | box B(&*v) as Box<dyn X>
22 | ^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn X + 'static)>`
24 found `std::boxed::Box<dyn X>`
21 25
22error: aborting due to previous error 26error: aborting due to previous error
23 27
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
index ef21316..b2a7afa 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
+++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
@@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'c` as defined on the fu
19 | 19 |
20LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> { 20LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
21 | ^^ 21 | ^^
22 = note: ...so that the expression is assignable: 22note: ...so that the expression is assignable
23 expected std::boxed::Box<(dyn SomeTrait + 'c)> 23 --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5
24 found std::boxed::Box<dyn SomeTrait> 24 |
25LL | box v as Box<dyn SomeTrait + 'a>
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 = note: expected `std::boxed::Box<(dyn SomeTrait + 'c)>`
28 found `std::boxed::Box<dyn SomeTrait>`
25 29
26error: aborting due to previous error 30error: aborting due to previous error
27 31
diff --git a/src/test/ui/regions/regions-creating-enums4.stderr b/src/test/ui/regions/regions-creating-enums4.stderr
index 12b8978..58f74e4 100644
--- a/src/test/ui/regions/regions-creating-enums4.stderr
+++ b/src/test/ui/regions/regions-creating-enums4.stderr
@@ -9,17 +9,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { 10LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &Ast<'_> 13 --> $DIR/regions-creating-enums4.rs:7:14
14 found &Ast<'a> 14 |
15LL | Ast::Add(x, y)
16 | ^
17 = note: expected `&Ast<'_>`
18 found `&Ast<'a>`
15note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19... 19note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19...
16 --> $DIR/regions-creating-enums4.rs:6:19 20 --> $DIR/regions-creating-enums4.rs:6:19
17 | 21 |
18LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { 22LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
19 | ^^ 23 | ^^
20 = note: ...so that the expression is assignable: 24note: ...so that the expression is assignable
21 expected Ast<'b> 25 --> $DIR/regions-creating-enums4.rs:7:5
22 found Ast<'_> 26 |
27LL | Ast::Add(x, y)
28 | ^^^^^^^^^^^^^^
29 = note: expected `Ast<'b>`
30 found `Ast<'_>`
23 31
24error: aborting due to previous error 32error: aborting due to previous error
25 33
diff --git a/src/test/ui/regions/regions-escape-method.stderr b/src/test/ui/regions/regions-escape-method.stderr
index b93dd0d..ffc2a25 100644
--- a/src/test/ui/regions/regions-escape-method.stderr
+++ b/src/test/ui/regions/regions-escape-method.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | s.f(|p| p) 10LL | s.f(|p| p)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &i32 13 --> $DIR/regions-escape-method.rs:15:13
14 found &i32 14 |
15LL | s.f(|p| p)
16 | ^
17 = note: expected `&i32`
18 found `&i32`
15note: but, the lifetime must be valid for the method call at 15:5... 19note: but, the lifetime must be valid for the method call at 15:5...
16 --> $DIR/regions-escape-method.rs:15:5 20 --> $DIR/regions-escape-method.rs:15:5
17 | 21 |
diff --git a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
index a6b165e..9082346 100644
--- a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
+++ b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-escape-via-trait-or-not.rs:18:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the expression at 18:5... 19note: but, the lifetime must be valid for the expression at 18:5...
16 --> $DIR/regions-escape-via-trait-or-not.rs:18:5 20 --> $DIR/regions-escape-via-trait-or-not.rs:18:5
17 | 21 |
diff --git a/src/test/ui/regions/regions-nested-fns.stderr b/src/test/ui/regions/regions-nested-fns.stderr
index f4eb5c8..8fce160 100644
--- a/src/test/ui/regions/regions-nested-fns.stderr
+++ b/src/test/ui/regions/regions-nested-fns.stderr
@@ -29,9 +29,18 @@ LL | | if false { return ay; }
29LL | | return z; 29LL | | return z;
30LL | | })); 30LL | | }));
31 | |_____^ 31 | |_____^
32 = note: ...so that the types are compatible: 32note: ...so that the types are compatible
33 expected &isize 33 --> $DIR/regions-nested-fns.rs:13:76
34 found &isize 34 |
35LL | ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
36 | ____________________________________________________________________________^
37LL | | if false { return x; }
38LL | | if false { return ay; }
39LL | | return z;
40LL | | }));
41 | |_____^
42 = note: expected `&isize`
43 found `&isize`
35 44
36error[E0312]: lifetime of reference outlives lifetime of borrowed content... 45error[E0312]: lifetime of reference outlives lifetime of borrowed content...
37 --> $DIR/regions-nested-fns.rs:14:27 46 --> $DIR/regions-nested-fns.rs:14:27
diff --git a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
index d29fd80..8a600d2 100644
--- a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
+++ b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
@@ -17,9 +17,16 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on
17 | 17 |
18LL | fn bar<'a, 'b>() 18LL | fn bar<'a, 'b>()
19 | ^^ 19 | ^^
20 = note: ...so that the types are compatible: 20note: ...so that the types are compatible
21 expected Project<'a, 'b> 21 --> $DIR/regions-normalize-in-where-clause-list.rs:22:1
22 found Project<'_, '_> 22 |
23LL | / fn bar<'a, 'b>()
24LL | | where <() as Project<'a, 'b>>::Item : Eq
25LL | | {
26LL | | }
27 | |_^
28 = note: expected `Project<'a, 'b>`
29 found `Project<'_, '_>`
23 30
24error: aborting due to previous error 31error: aborting due to previous error
25 32
diff --git a/src/test/ui/regions/regions-ret-borrowed-1.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr
index 4907667..2895a0c 100644
--- a/src/test/ui/regions/regions-ret-borrowed-1.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed-1.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-ret-borrowed-1.rs:10:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14... 19note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14...
16 --> $DIR/regions-ret-borrowed-1.rs:9:14 20 --> $DIR/regions-ret-borrowed-1.rs:9:14
17 | 21 |
diff --git a/src/test/ui/regions/regions-ret-borrowed.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr
index eb1ade2..b74f10f 100644
--- a/src/test/ui/regions/regions-ret-borrowed.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-ret-borrowed.rs:13:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14... 19note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14...
16 --> $DIR/regions-ret-borrowed.rs:12:14 20 --> $DIR/regions-ret-borrowed.rs:12:14
17 | 21 |
diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr
index ef69f25..58b79d2 100644
--- a/src/test/ui/regions/regions-trait-object-subtyping.stderr
+++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr
@@ -36,9 +36,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
36 | 36 |
37LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { 37LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
38 | ^^ 38 | ^^
39 = note: ...so that the expression is assignable: 39note: ...so that the expression is assignable
40 expected &'b mut (dyn Dummy + 'b) 40 --> $DIR/regions-trait-object-subtyping.rs:15:5
41 found &mut (dyn Dummy + 'b) 41 |
42LL | x
43 | ^
44 = note: expected `&'b mut (dyn Dummy + 'b)`
45 found `&mut (dyn Dummy + 'b)`
42 46
43error[E0308]: mismatched types 47error[E0308]: mismatched types
44 --> $DIR/regions-trait-object-subtyping.rs:22:5 48 --> $DIR/regions-trait-object-subtyping.rs:22:5
diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr
index e55f023..527babb 100644
--- a/src/test/ui/reject-specialized-drops-8142.stderr
+++ b/src/test/ui/reject-specialized-drops-8142.stderr
@@ -105,9 +105,13 @@ note: ...but the lifetime must also be valid for the lifetime `'l2` as defined o
105 | 105 |
106LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } 106LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
107 | ^^^ 107 | ^^^
108 = note: ...so that the types are compatible: 108note: ...so that the types are compatible
109 expected W<'l1, 'l2> 109 --> $DIR/reject-specialized-drops-8142.rs:54:1
110 found W<'_, '_> 110 |
111LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 = note: expected `W<'l1, 'l2>`
114 found `W<'_, '_>`
111 115
112error: aborting due to 8 previous errors 116error: aborting due to 8 previous errors
113 117
diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
index 88c9c47..9fdcd4d 100644
--- a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
+++ b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
@@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on
14 | 14 |
15LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { 15LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
16 | ^^ 16 | ^^
17 = note: ...so that the types are compatible: 17note: ...so that the types are compatible
18 expected T1<'a> 18 --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13
19 found T1<'_> 19 |
20LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
21 | ^^^^^^^^^^
22 = note: expected `T1<'a>`
23 found `T1<'_>`
20 24
21error: aborting due to previous error 25error: aborting due to previous error
22 26
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
index d0475bf..e6029e0d 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
@@ -18,9 +18,13 @@ note: ...so that reference does not outlive borrowed content
18LL | Box::new(items.iter()) 18LL | Box::new(items.iter())
19 | ^^^^^ 19 | ^^^^^
20 = note: but, the lifetime must be valid for the static lifetime... 20 = note: but, the lifetime must be valid for the static lifetime...
21 = note: ...so that the expression is assignable: 21note: ...so that the expression is assignable
22 expected std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)> 22 --> $DIR/dyn-trait-underscore.rs:8:5
23 found std::boxed::Box<dyn std::iter::Iterator<Item = &T>> 23 |
24LL | Box::new(items.iter())
25 | ^^^^^^^^^^^^^^^^^^^^^^
26 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)>`
27 found `std::boxed::Box<dyn std::iter::Iterator<Item = &T>>`
24 28
25error: aborting due to previous error 29error: aborting due to previous error
26 30