Skip to content

Commit 6be16ba

Browse files
committed
Remove primary label for more readable output
1 parent 82d3a49 commit 6be16ba

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
3535
let return_sp = sub_origin.span();
3636
let mut err = self.tcx.sess.struct_span_err(
3737
sp,
38-
"can't infer an appropriate lifetime",
38+
"cannot infer an appropriate lifetime",
3939
);
40-
err.span_label(sp, "can't infer an appropriate lifetime");
4140
err.span_label(
4241
return_sp,
4342
"this return type evaluates to the `'static` lifetime...",

src/test/ui/impl-trait/static-return-lifetime-infered.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ impl A {
1616
fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
1717
self.x.iter().map(|a| a.0)
1818
}
19-
//~^^^ ERROR can't infer an appropriate lifetime
19+
//~^^ ERROR cannot infer an appropriate lifetime
2020
fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
2121
self.x.iter().map(|a| a.0)
2222
}
23-
//~^^^ ERROR can't infer an appropriate lifetime
23+
//~^^ ERROR cannot infer an appropriate lifetime
2424
}
2525

2626
fn main() {}

src/test/ui/impl-trait/static-return-lifetime-infered.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: can't infer an appropriate lifetime
1+
error: cannot infer an appropriate lifetime
22
--> $DIR/static-return-lifetime-infered.rs:17:16
33
|
44
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
55
| ----------------------- this return type evaluates to the `'static` lifetime...
66
LL | self.x.iter().map(|a| a.0)
7-
| ------ ^^^^ can't infer an appropriate lifetime
7+
| ------ ^^^^
88
| |
99
| ...but this borrow...
1010
|
@@ -20,13 +20,13 @@ help: you can add a constraint to the return type to make it last less than `'st
2020
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

23-
error: can't infer an appropriate lifetime
23+
error: cannot infer an appropriate lifetime
2424
--> $DIR/static-return-lifetime-infered.rs:21:16
2525
|
2626
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
2727
| ----------------------- this return type evaluates to the `'static` lifetime...
2828
LL | self.x.iter().map(|a| a.0)
29-
| ------ ^^^^ can't infer an appropriate lifetime
29+
| ------ ^^^^
3030
| |
3131
| ...but this borrow...
3232
|

0 commit comments

Comments
 (0)