-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account for macros when suggesting adding lifetime #82717
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
suggest_note = false; // Avoid displaying the same help multiple times. | ||
err.help(&format!( | ||
"consider introducing lifetime `{}` to the item's generics", | ||
lifetime_ref, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a note here mentioning that we're inside of an expansion?
I think otherwise these two nearly identical error messages in the added test case might be confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about rewriting this to "lifetime {}
is missing in an item created through a proc macro"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the new output
@bors r+ rollup |
📌 Commit 5d0697b has been approved by |
Account for macros when suggesting adding lifetime Fix rust-lang#70152.
Rollup of 8 pull requests Successful merges: - rust-lang#80527 (Make rustdoc lints a tool lint instead of built-in) - rust-lang#82310 (Load rustdoc's JS search index on-demand.) - rust-lang#82315 (Improve page load performance in rustdoc) - rust-lang#82564 (Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation) - rust-lang#82697 (Fix stabilization version of move_ref_pattern) - rust-lang#82717 (Account for macros when suggesting adding lifetime) - rust-lang#82740 (Fix commit detected when using `download-rustc`) - rust-lang#82744 (Pass `CrateNum` by value instead of by reference) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fix #70152.