-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Remove the CoroutineWitness
type
#144157
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
base: master
Are you sure you want to change the base?
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.
@@ -905,6 +905,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { | |||
} | |||
} else { | |||
p!(print_def_path(did, args)); | |||
// TODO: Restore witness types? |
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.
I'll probably leave these out. Otherwise we could have query cycles here.
} else { | ||
// TODO: We could still recurse into upvars and the resume here. |
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.
This is definitely a FIXME for later. I don't think this has any side effect.
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.
I don't think we should 😁 you could even inline always_drop_component
to just return Err(AlwaysRequiresDrop)
here
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 |
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
Outdated
Show resolved
Hide resolved
}) | ||
} else { | ||
unreachable!( | ||
"tried to assemble `Sized` for coroutine without enabled feature" |
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.
why does the copy_clone_conditions
talk about Sized
in the ICE msg xd
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.
Copy paste mistake
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.
still talks about Sized
:3
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.
general question: do we need to stall on CoroutineClosure
as well?
No, coroutine-closures don't actually really "contain" a witness, and don't use it in their copy/clone and auto trait impls anyways. The fact it stores a witness in its vars is kinda just for convenience for constructing the coroutine type when computing the return type. |
a25d83f
to
56c25c2
Compare
This comment has been minimized.
This comment has been minimized.
56c25c2
to
4625cb5
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.
gamer!
r=me, unsure whether to block on #144156. Waiting on crater seems fine, wouldn't expect there to be any issues though :3
I'll land this after #144156, unless you expect that PR to be blocked for some reason. In that case, I'd prefer if we invert the stack of these and land this PR without the first commit, and then rebase THAT one to use the new logic for checking the drop-ness of the interior types. |
I'll take this out of draft for the pings and to mark it as blocked. |
Some changes occurred in compiler/rustc_sanitizers cc @rcvalle Some changes occurred to the CTFE machinery changes to the core type system Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in exhaustiveness checking cc @Nadrieril This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_codegen_ssa |
@rustbot blocked |
4625cb5
to
4f96428
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
It's no longer needed, since it always just matches the def id and substs of 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.
This luckily was very easy to do because of the setup work in:
CoroutineWitness
sooner 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)