about summary refs log tree commit diff
path: root/tests/rustdoc/issue-118180-empty-tuple-struct.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-11-22 09:28:52 -0800
committerGitHub <noreply@github.com>2023-11-22 09:28:52 -0800
commit4ec548afbe27589f6542f11c81b93f2931d1c811 (patch)
tree509623e62b89d684a363ad19391d6ae5c8962138 /tests/rustdoc/issue-118180-empty-tuple-struct.rs
parent040151a4be145871ef15e333d94f84d9039a5e0c (diff)
parent4f958a4802c1c29b804db34d53297504da555d02 (diff)
downloadrust-4ec548afbe27589f6542f11c81b93f2931d1c811.tar.gz
rust-4ec548afbe27589f6542f11c81b93f2931d1c811.zip
Rollup merge of #118161 - compiler-errors:coroutine-obligation-opaques, r=lcnr
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`
Diffstat (limited to 'tests/rustdoc/issue-118180-empty-tuple-struct.rs')
0 files changed, 0 insertions, 0 deletions