Uh oh!
There was an error while loading. Please reload this page.
Handle regions equivalent to 'static in non_local_bounds - #139668
Conversation
rustbot
commented
Apr 11, 2025
r? @nnethercote rustbot has assigned @nnethercote. Use |
rustbot
commented
Apr 11, 2025
This PR changes a file inside |
compiler-errors
commented
Apr 11, 2025
r? types |
Uh oh!
There was an error while loading. Please reload this page.
| let mut external_parents = vec![]; | ||
| let mut queue = vec![fr0]; | ||
| let mut queue = vec![relation.scc_representative(fr0)]; |
There was a problem hiding this comment.
I'm not sure if you've explained why projecting the free region to its representative affects the set of non_local_bounds that we return. It's not obvious from the definition of TransitiveRelation::parents, at least.
Like, if these are actually SCC's then I'm not sure why shuffling around which element in that SCC fixes things.
Is there something subtle going on with the fact that 'static is the first first region vid we allocate?
There was a problem hiding this comment.
If it has to do with the fact that TransitiveRelation::parents requires for us to pass the minimal element for this while loop to actually reach all of the parents, then perhaps we should rename thatfunction to minimal_scc_representative 🤔
Or maybe I'm totally misleading myself.
There was a problem hiding this comment.
Hey @matthewjasper, did you mean to resolve this without actually answering the question?
There was a problem hiding this comment.
Your second comment was correct and I renamed scc_representative to minimal_scc_representative
compiler-errors
commented
Apr 13, 2025
@rustbot author (waiting on questions) |
rustbot
commented
Apr 13, 2025
Reminder, once the PR becomes ready for a review, use |
`non_local_bounds` would only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In this case we should return 'static.
73464a9 to
c57ef29Comparematthewjasper
commented
Apr 15, 2025
@rustbot ready |
compiler-errors
commented
May 22, 2025
@bors r+ |
bors
commented
May 22, 2025
compiler-errors
commented
May 22, 2025
@bors rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135562 (Add ignore value suggestion in closure body) - rust-lang#139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - rust-lang#139668 (Handle regions equivalent to 'static in non_local_bounds) - rust-lang#140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - rust-lang#140435 (use uX::from instead of _ as uX in non - const contexts) - rust-lang#141130 (rustc_on_unimplemented cleanups) - rust-lang#141286 (Querify `coroutine_hidden_types`) Failed merges: - rust-lang#140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139668 - matthewjasper:upper-bound-fix, r=compiler-errors Handle regions equivalent to 'static in non_local_bounds `non_local_bounds` would only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In this case we should return 'static. closesrust-lang#122704closesrust-lang#139004
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135562 (Add ignore value suggestion in closure body) - rust-lang#139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - rust-lang#139668 (Handle regions equivalent to 'static in non_local_bounds) - rust-lang#140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - rust-lang#140435 (use uX::from instead of _ as uX in non - const contexts) - rust-lang#141130 (rustc_on_unimplemented cleanups) - rust-lang#141286 (Querify `coroutine_hidden_types`) Failed merges: - rust-lang#140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
non_local_boundswould only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such asdyn Any + 'ain the tests added, is well-formed. In this case we should return 'static.closes#122704
closes#139004