-
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
Add hint for missing lifetime bound on trait object when type alias is used #105345
Conversation
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
r? types |
e1d7c5d
to
b2c3f4c
Compare
b2c3f4c
to
b5f6978
Compare
☔ The latest upstream changes (presumably #106432) made this pull request unmergeable. Please resolve the merge conflicts. |
b5f6978
to
1e1c473
Compare
☔ The latest upstream changes (presumably #105805) made this pull request unmergeable. Please resolve the merge conflicts. |
1e1c473
to
facbe28
Compare
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.
Here's how I would clean this up
11eba40
to
1c2f6bb
Compare
a08afc0
to
40b7613
Compare
☔ The latest upstream changes (presumably #107021) made this pull request unmergeable. Please resolve the merge conflicts. |
40b7613
to
18502ce
Compare
18502ce
to
62a1e76
Compare
@bors r+ |
…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.
…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.
…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
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.