Skip to content

Commit a207f54

Browse files
authored
Rollup merge of #91096 - compiler-errors:elaborate_opaque_trait, r=estebank
Print associated types on opaque `impl Trait` types This PR generalizes #91021, printing associated types for all opaque `impl Trait` types instead of just special-casing for future. before: ``` error[E0271]: type mismatch resolving `<impl Iterator as Iterator>::Item == u32` ``` after: ``` error[E0271]: type mismatch resolving `<impl Iterator<Item = usize> as Iterator>::Item == u32` ``` --- Questions: 1. I'm kinda lost in binders hell with this one. Is all of the `rebind`ing necessary? 2. Is there a map collection type that will give me a stable iteration order? Doesn't seem like TraitRef is Ord, so I can't just sort later.. 3. I removed the logic that suppresses printing generator projection types. It creates outputs like this [gist](https://gist.github.com/compiler-errors/d6f12fb30079feb1ad1d5f1ab39a3a8d). Should I put that back? 4. I also added spaces between traits, `impl A+B` -> `impl A + B`. I quite like this change, but is there a good reason to keep it like that? r? ````@estebank````
2 parents 922d5d8 + 20645ca commit a207f54

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/ops/generator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ pub trait Generator<R = ()> {
8282
/// `return` statement or implicitly as the last expression of a generator
8383
/// literal. For example futures would use this as `Result<T, E>` as it
8484
/// represents a completed future.
85+
#[cfg_attr(not(bootstrap), lang = "generator_return")]
8586
type Return;
8687

8788
/// Resumes the execution of this generator.

0 commit comments

Comments
 (0)