We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cbf092 commit f5f11e1Copy full SHA for f5f11e1
tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.rs
@@ -0,0 +1,28 @@
1
+//! This test demonstrates a bug where we accidentally
2
+//! detected opaque types in struct fields, but only if nested
3
+//! in projections of another opaque type.
4
+//@ check-pass
5
+
6
+#![feature(impl_trait_in_assoc_type)]
7
8
+struct Bar;
9
10
+trait Trait: Sized {
11
+ type Assoc2;
12
+ type Assoc;
13
+ fn foo() -> Self::Assoc;
14
+}
15
16
+impl Trait for Bar {
17
+ type Assoc2 = impl std::fmt::Debug;
18
+ type Assoc = impl Iterator<Item = Foo>;
19
+ fn foo() -> Self::Assoc {
20
+ vec![Foo { field: () }].into_iter()
21
+ }
22
23
24
+struct Foo {
25
+ field: <Bar as Trait>::Assoc2,
26
27
28
+fn main() {}
0 commit comments