Skip to content
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

Recover most impl Trait and dyn Trait lifetime bound suggestions under NLL #96385

Merged

Conversation

marmeladema
Copy link
Contributor

This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from NiceRegionError::try_report_static_impl_trait and by re-using suggest_new_region_bound.

Fixes #96277

r? @jackh726

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2022
// i32, which is the type of y but with the anonymous region replaced
// with 'a, the corresponding bound region and is_first which is true if
// the hir::Param is the first parameter in the function declaration.
pub fn find_param_with_region<'tcx>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has just been split out from NiceRegionError::find_param_with_region as a free standing function.

@jackh726
Copy link
Member

Good job on this :) Did you bless with compare-mode=nll? (CI will catch it, but figured I would bring it up if you didn't and there's potentially anything that changes)

@bors r+

@bors
Copy link
Contributor

bors commented Apr 25, 2022

📌 Commit e1b074a has been approved by jackh726

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2022
@marmeladema
Copy link
Contributor Author

Did you bless with compare-mode=nll?

Yep, I did it properly this time 👍

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 26, 2022
…bound-suggestions, r=jackh726

Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL

This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`.

Fixes rust-lang#96277

r? `@jackh726`
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 26, 2022
…bound-suggestions, r=jackh726

Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL

This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`.

Fixes rust-lang#96277

r? ``@jackh726``
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#92569 (Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts)
 - rust-lang#96370 (Cleanup `report_method_error` a bit)
 - rust-lang#96383 (Fix erased region escaping into wfcheck due to rust-lang#95395)
 - rust-lang#96385 (Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL)
 - rust-lang#96410 (rustdoc: do not write `{{root}}` in `pub use ::foo` docs)
 - rust-lang#96430 (Fix handling of `!` in rustdoc search)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dc1f98c into rust-lang:master Apr 27, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 27, 2022
@marmeladema marmeladema deleted the nll-fix-trait-lifetime-bound-suggestions branch April 27, 2022 20:19
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 28, 2022
…-lifetime-suggestion, r=jackh726

Recover suggestions to introduce named lifetime under NLL

Fixes rust-lang#96157

r? `@jackh726`

Built on top of rust-lang#96385 so only the second commit is relevant
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 28, 2022
…-lifetime-suggestion, r=jackh726

Recover suggestions to introduce named lifetime under NLL

Fixes rust-lang#96157

r? ``@jackh726``

Built on top of rust-lang#96385 so only the second commit is relevant
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 28, 2022
…-lifetime-suggestion, r=jackh726

Recover suggestions to introduce named lifetime under NLL

Fixes rust-lang#96157

r? ```@jackh726```

Built on top of rust-lang#96385 so only the second commit is relevant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NLL] Loss of suggestions to change/fix trait object lifetime bound
5 participants