Skip to content

Commit c2ae4de

Browse files
authored
Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril
Print lifetimes with backticks Fixes #65287 r? @varkor
2 parents 1ac0028 + 2ae5e34 commit c2ae4de

File tree

115 files changed

+260
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+260
-260
lines changed

src/librustc/infer/error_reporting/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'tcx> TyCtxt<'tcx> {
200200
{
201201
sp = param.span;
202202
}
203-
(format!("the lifetime {} as defined on", br.name), sp)
203+
(format!("the lifetime `{}` as defined on", br.name), sp)
204204
}
205205
ty::ReFree(ty::FreeRegion {
206206
bound_region: ty::BoundRegion::BrNamed(_, name),
@@ -213,15 +213,15 @@ impl<'tcx> TyCtxt<'tcx> {
213213
{
214214
sp = param.span;
215215
}
216-
(format!("the lifetime {} as defined on", name), sp)
216+
(format!("the lifetime `{}` as defined on", name), sp)
217217
}
218218
ty::ReFree(ref fr) => match fr.bound_region {
219219
ty::BrAnon(idx) => (
220220
format!("the anonymous lifetime #{} defined on", idx + 1),
221221
self.hir().span(node),
222222
),
223223
_ => (
224-
format!("the lifetime {} as defined on", region),
224+
format!("the lifetime `{}` as defined on", region),
225225
cm.def_span(self.hir().span(node)),
226226
),
227227
},

src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const NAME: &'a str = "unit";
66
|
77
= note: expected type `&'static str`
88
found type `&'a str`
9-
note: the lifetime 'a as defined on the impl at 6:6...
9+
note: the lifetime `'a` as defined on the impl at 6:6...
1010
--> $DIR/associated-const-impl-wrong-lifetime.rs:6:6
1111
|
1212
LL | impl<'a> Foo for &'a () {

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
44
LL | bar(foo, x)
55
| ^^^
66
|
7-
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8...
7+
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 37:8...
88
--> $DIR/project-fn-ret-contravariant.rs:37:8
99
|
1010
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
44
LL | bar(foo, x)
55
| ^^^
66
|
7-
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8...
7+
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 44:8...
88
--> $DIR/project-fn-ret-invariant.rs:44:8
99
|
1010
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {

src/test/ui/async-await/issues/issue-63388-2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ LL | foo: &dyn Foo, bar: &'a dyn Foo
1515
LL | foo
1616
| --- this return type evaluates to the `'static` lifetime...
1717
|
18-
note: ...can't outlive the lifetime '_ as defined on the method body at 11:14
18+
note: ...can't outlive the lifetime `'_` as defined on the method body at 11:14
1919
--> $DIR/issue-63388-2.rs:11:14
2020
|
2121
LL | foo: &dyn Foo, bar: &'a dyn Foo
2222
| ^
23-
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime '_ as defined on the method body at 11:14
23+
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime `'_` as defined on the method body at 11:14
2424
|
2525
LL | foo + '_
2626
|

src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d
2424
|
2525
= note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)`
2626
found type `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)`
27-
note: the lifetime 'c as defined on the method body at 27:24...
27+
note: the lifetime `'c` as defined on the method body at 27:24...
2828
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
2929
|
3030
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
3131
| ^^
32-
note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 27:24
32+
note: ...does not necessarily outlive the lifetime `'c` as defined on the method body at 27:24
3333
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
3434
|
3535
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {

src/test/ui/c-variadic/variadic-ffi-4.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<
1414
LL | | ap
1515
LL | | }
1616
| |_^
17-
note: ...does not necessarily outlive the lifetime 'f as defined on the function body at 7:37
17+
note: ...does not necessarily outlive the lifetime `'f` as defined on the function body at 7:37
1818
--> $DIR/variadic-ffi-4.rs:7:37
1919
|
2020
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {

src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: the anonymous lifetime #2 defined on the body at 14:48...
1111
|
1212
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
1313
| ^^^^^^^^^^^^^^^^^^^^^^
14-
note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 11:36
14+
note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 11:36
1515
--> $DIR/expect-fn-supply-fn.rs:11:36
1616
|
1717
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
@@ -25,7 +25,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
2525
|
2626
= note: expected type `fn(&u32)`
2727
found type `fn(&'x u32)`
28-
note: the lifetime 'x as defined on the function body at 11:36...
28+
note: the lifetime `'x` as defined on the function body at 11:36...
2929
--> $DIR/expect-fn-supply-fn.rs:11:36
3030
|
3131
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {

src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ LL | |
3838
LL | |
3939
LL | | });
4040
| |_____^
41-
note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 32:30
41+
note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 32:30
4242
--> $DIR/expect-region-supply-region.rs:32:30
4343
|
4444
LL | fn expect_bound_supply_named<'x>() {
@@ -52,7 +52,7 @@ LL | closure_expecting_bound(|x: &'x u32| {
5252
|
5353
= note: expected type `&u32`
5454
found type `&'x u32`
55-
note: the lifetime 'x as defined on the function body at 32:30...
55+
note: the lifetime `'x` as defined on the function body at 32:30...
5656
--> $DIR/expect-region-supply-region.rs:32:30
5757
|
5858
LL | fn expect_bound_supply_named<'x>() {

src/test/ui/error-codes/E0478.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ error[E0478]: lifetime bound not satisfied
44
LL | child: Box<dyn Wedding<'kiss> + 'SnowWhite>,
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: lifetime parameter instantiated with the lifetime 'SnowWhite as defined on the struct at 3:22
7+
note: lifetime parameter instantiated with the lifetime `'SnowWhite` as defined on the struct at 3:22
88
--> $DIR/E0478.rs:3:22
99
|
1010
LL | struct Prince<'kiss, 'SnowWhite> {
1111
| ^^^^^^^^^^
12-
note: but lifetime parameter must outlive the lifetime 'kiss as defined on the struct at 3:15
12+
note: but lifetime parameter must outlive the lifetime `'kiss` as defined on the struct at 3:15
1313
--> $DIR/E0478.rs:3:15
1414
|
1515
LL | struct Prince<'kiss, 'SnowWhite> {

0 commit comments

Comments
 (0)