coercion ?0: Sized
check, rewrite to not rely on fulfill internals
#104490
Labels
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
WG-trait-system-refactor
The Rustc Trait System Refactor Initiative (-Znext-solver)
The behavior of
fn coerce_unsized
for some inference variable?0
changes depending on whether there's a pending?0: Sized
obligation in the fulfillment context:rust/compiler/rustc_hir_typeck/src/coercion.rs
Lines 672 to 682 in 63c748e
This pending obligation can be a nested obligation, e.g. we may have only added a
Vec<?0>: Debug
obligation to the fulfillment context. But proving that adds a nested?0: Sized
obligation from the impl candidate to theFulfillmentContext
, which then influences coercion.As our new solver should try to fully prove obligations instead of selecting a candidate and adding nested obligations to the root, this has to change.
cc @rust-lang/initiative-trait-system-refactor
The text was updated successfully, but these errors were encountered: