1
Fork 0

reworded message

This commit is contained in:
Esteban Küber 2021-03-03 12:15:26 -08:00
parent 5824917dbb
commit 5d0697b1be
2 changed files with 11 additions and 5 deletions

View file

@ -1674,10 +1674,14 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
); );
} else if suggest_note { } else if suggest_note {
suggest_note = false; // Avoid displaying the same help multiple times. suggest_note = false; // Avoid displaying the same help multiple times.
err.help(&format!( err.span_label(
"consider introducing lifetime `{}` to the item's generics", span,
lifetime_ref, &format!(
)); "lifetime `{}` is missing in item created through this procedural \
macro",
lifetime_ref,
),
);
} }
} }
MissingLifetimeSpot::HigherRanked { span, span_type } => { MissingLifetimeSpot::HigherRanked { span, span_type } => {

View file

@ -27,10 +27,12 @@ LL | a: &'b str,
error[E0261]: use of undeclared lifetime name `'b` error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9 --> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9
| |
LL | #[derive(Eq, PartialEq)]
| -- lifetime `'b` is missing in item created through this procedural macro
LL | struct Test {
LL | a: &'b str, LL | a: &'b str,
| ^^ undeclared lifetime | ^^ undeclared lifetime
| |
= help: consider introducing lifetime `'b` to the item's generics
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes = help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
error: aborting due to 3 previous errors error: aborting due to 3 previous errors