Do not add implied outlives bounds containing external regions/params only#153027
Do not add implied outlives bounds containing external regions/params only#153027ShoyuVanilla wants to merge 2 commits intorust-lang:mainfrom
Conversation
| // for it, we might fail with the type test for it, which contains the opaque type | ||
| // and therefore `'b` as well. The problem is that if the normalized opaque type doesn't | ||
| // mentions `'b`, we have no local free region constrained by it, and end up | ||
| // emitting a borrowck error instead of propagating the closure requirements. |
There was a problem hiding this comment.
Filtering external bounds here regresses this
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Do not add outlives implied bounds that contains external regions/params only
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (484ac15): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary 0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 481.498s -> 479.757s (-0.36%) |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
This doesn't feel correct. I think I should rather add implied bounds as before and directly propagate them again as requirements. |
|
🗑️ Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
hmm, I do feel like only having implied bounds involving the late-bound things from the closure signature seems correct to me 🤔 |
Yeah, only keeping bounds that involve late-bound params feels right to me, too. But more precisely, I’m currently leaning toward I'm a bit more inclined to: adding all the implied bounds as before, but gathering the implied bounds don't involve the late bounds and throwing them as propagated closure requirements to the parent body. I don't have a solid logical basis for this yet 😅, but:
|
|
Added a bit messy experimental PoC commit: 96312b1 😅 |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Fixes #151637
The actuall cause wasn't that the closure's return type is not being wf checked.
For example, the following code is errored out as intended:
The problem was that we are adding implied bound
T: 'staticeven when borrowck-ing the closures.