Remove the CoroutineWitness type#144157
Conversation
|
@bors2 try @rust-timer queue (and crater when it's ready) |
This comment has been minimized.
This comment has been minimized.
Remove the `CoroutineWitness` type It's no longer needed, since it just always the `Coroutine` that it's contained within. This PR reworks a bit of obligation stalling logic and dtorck constraint behavior, but otherwise it's pretty straightforward. r? `@lcnr` or reassign (e.g. to oli, who probably would also be down to review)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0282016): comparison URL. Overall result: ✅ improvements - 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 countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -3.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.0%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 465.311s -> 466.27s (0.21%) |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
| }) | ||
| } else { | ||
| unreachable!( | ||
| "tried to assemble `Sized` for coroutine without enabled feature" |
There was a problem hiding this comment.
why does the copy_clone_conditions talk about Sized in the ICE msg xd
There was a problem hiding this comment.
Copy paste mistake
| if self.reveal_coroutine_witnesses { | ||
| queue_type(self, args.as_coroutine().witness()); | ||
| ty::Coroutine(def_id, args) => { | ||
| if self.exhaustive { |
There was a problem hiding this comment.
preexisting vibe: exhaustive is confusing and misleading to me 🤔 I would like us to maybe change this to a mode: NeedsDropMode or sth like that where we've got NeedsDropMode::CollectAllSignificantDrops to make it clear why we're walking into coroutines here even though it doesn't matter for "should we drop this coroutine".
Tbh, I kinda feel like "get all types for which we execute drop glue" and "does this need to execute drop glue" are different enough that splitting them and having the second one be something only intended for diagnostics would probably be better.
idk what do to about this and don't think it should be done in this PR, but pls add a FIXME to the exhaustive field or sth :3
There was a problem hiding this comment.
I'll add a FIXME
4f96428 to
2aba321
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
🎉 Experiment
|
This ends up causing an overflow in fulfillment because of a recursive trait goal modulo placeholders. We end up checking that |
|
And we currently go through the witness which does not reference the upvars, so we get an actual cycle instead of overflow? |
|
and the reason the nested coroutine type is already instantiated is that to prove |
|
if we remove this eager instantiate, could we avoid the overflow? |
|
We'd have to revert #138915 and figure out what to do for #143545 instead. I am torn here 🤔 In the new solver this just works (modulo rust-lang/trait-system-refactor-initiative#209) and I really want to remove the As a temporary change, could we remove the witness field from coroutines but still have structural builtin impls go through an on-the-fly created alternatively, I would be open to support changing predicates to contain a |
|
☔ The latest upstream changes (presumably #144440) made this pull request unmergeable. Please resolve the merge conflicts. |
Yes, this was my thought as well. This is implemented in #144458. Fully removing coroutine witnesses is going to be really invasive regardless. I think it's probably best to block that on the new trait solver. |
|
Anyone is welcome to pick this back up. |
It's no longer needed, since it always just matches the def id and substs of the
Coroutinethat it's contained within.This PR reworks a bit of obligation stalling logic and dtorck constraint behavior, but otherwise it's pretty straightforward.
This luckily was very easy to do because of the setup work in:
CoroutineWitnesssooner in typeck, and stall coroutine obligations based off ofTypingEnv#141762r? @lcnr or reassign (e.g. to oli, who probably would also be down to review)