Account for macros when suggesting adding lifetime#82717
Merged
bors merged 2 commits intorust-lang:masterfrom Mar 4, 2021
Merged
Account for macros when suggesting adding lifetime#82717bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
lcnr
reviewed
Mar 3, 2021
| suggest_note = false; // Avoid displaying the same help multiple times. | ||
| err.help(&format!( | ||
| "consider introducing lifetime `{}` to the item's generics", | ||
| lifetime_ref, |
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
What do you think about rewriting this to "lifetime {} is missing in an item created through a proc macro"?
Contributor
Author
There was a problem hiding this comment.
Check out the new output
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit 5d0697b has been approved by |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Mar 4, 2021
Account for macros when suggesting adding lifetime Fix rust-lang#70152.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 4, 2021
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #70152.