Add hint for missing lifetime bound on trait object when type alias is used#105345
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 26, 2023
Merged
Add hint for missing lifetime bound on trait object when type alias is used#105345bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
5a0a242 to
e1d7c5d
Compare
Contributor
|
r? types |
lcnr
reviewed
Dec 6, 2022
e1d7c5d to
b2c3f4c
Compare
jackh726
requested changes
Dec 26, 2022
b2c3f4c to
b5f6978
Compare
Collaborator
|
☔ The latest upstream changes (presumably #106432) made this pull request unmergeable. Please resolve the merge conflicts. |
b5f6978 to
1e1c473
Compare
Collaborator
|
☔ The latest upstream changes (presumably #105805) made this pull request unmergeable. Please resolve the merge conflicts. |
1e1c473 to
facbe28
Compare
jackh726
reviewed
Jan 7, 2023
Member
jackh726
left a comment
There was a problem hiding this comment.
Here's how I would clean this up
11eba40 to
1c2f6bb
Compare
jackh726
requested changes
Jan 12, 2023
a08afc0 to
40b7613
Compare
Collaborator
|
☔ The latest upstream changes (presumably #107021) made this pull request unmergeable. Please resolve the merge conflicts. |
40b7613 to
18502ce
Compare
18502ce to
62a1e76
Compare
Member
|
@bors r+ |
Collaborator
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jan 24, 2023
…ckh726 Add hint for missing lifetime bound on trait object when type alias is used Fix issue rust-lang#103582. The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl. The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 25, 2023
…ckh726 Add hint for missing lifetime bound on trait object when type alias is used Fix issue rust-lang#103582. The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl. The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.
This was referenced Jan 25, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 25, 2023
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#105345 (Add hint for missing lifetime bound on trait object when type alias is used) - rust-lang#106897 (Tweak E0597) - rust-lang#106944 (Suggest using a lock for `*Cell: Sync` bounds) - rust-lang#107239 (Bring tests back into rustc source tarball) - rust-lang#107244 (rustdoc: rearrange HTML in primitive reference links) - rust-lang#107255 (add test where we ignore hr implied bounds) - rust-lang#107256 (Delete `SimplifyArmIdentity` and `SimplifyBranchSame` mir opts) - rust-lang#107266 (rustdoc: prohibit scroll bar on source viewer in Safari) - rust-lang#107282 (erica solver: implement builtin `Pointee` trait impl candidates) 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 issue #103582.
The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl.
The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.