mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
![]() Allow defining opaques in `check_coroutine_obligations` In the new trait solver, when an obligation stalls on an unresolved coroutine witness, we will stash away the *root* obligation, even if the stalled obligation is only a distant descendent of the root obligation, since the new solver is purely recursive. This means that we may need to reprocess alias-relate obligations (and others) which may define opaque types in the new solver. Currently, we use the coroutine's def id as the defining anchor in `check_coroutine_obligations`, which will allow defining no opaque types, resulting in errors like: ``` error[E0271]: type mismatch resolving `{coroutine@<source>:6:5: 6:17} <: impl Clone` --> <source>:6:5 | 6 | / move |_: ()| { 7 | | let () = yield (); 8 | | } | |_____^ types differ ``` So this PR fixes the defining anchor and does the same trick as `check_opaque_well_formed`, where we manually compare opaques that were defined against their hidden types to make sure they weren't defined differently when processing these stalled coroutine obligations. r? `@lcnr` cc `@cjgillot` |
||
---|---|---|
.. | ||
astconv | ||
check | ||
coherence | ||
collect | ||
impl_wf_check | ||
outlives | ||
structured_errors | ||
variance | ||
autoderef.rs | ||
bounds.rs | ||
check_unused.rs | ||
collect.rs | ||
constrained_generic_params.rs | ||
errors.rs | ||
hir_wf_check.rs | ||
impl_wf_check.rs | ||
lib.rs | ||
structured_errors.rs |