Implement assist to add missing lifetime to function#17265
Closed
ThouCheese wants to merge 3 commits into
Closed
Conversation
0cda9fc to
e1316eb
Compare
e1316eb to
36fb399
Compare
Member
|
This should ideally be a quickfix for an unresolved lifetime diagnostic. The origin for the diagnostic to emit would be here rust-analyzer/crates/hir-ty/src/lower.rs Line 1380 in 16fd9aa TyLoweringContext has no infrastructure for reporting diagnostics yet though so we'd need to add that as well, best would probably be via callback (Option<&'lt mut dyn FnMut(DiagnosticType)> or similar, Boxing for prototyping is probably better as that doesn't require fiddling with lifetimes first) that is stored in it and that can be set by the caller when creating a TyLoweringContext.
Ultimately it should make its way into the main diagnostics here rust-analyzer/crates/hir-ty/src/infer.rs Line 421 in 16fd9aa Also quoting the linked issue:
|
Member
|
I believe #18074 will make this easier and less messy (no callbacks), so I'll put this into draft until then |
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.
To address #11039