summaryrefslogtreecommitdiff
path: root/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr
blob: 1097cd0f452a870b542c43fbcb91c52708641eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
error[E0271]: type mismatch resolving `<Option<<() as Trait>::Ty::{opaque#0}> as IntoIterator>::Item == ()`
  --> $DIR/in-assoc-type-unconstrained.rs:8:19
   |
LL |         type Ty = Option<impl Sized>;
   |                   ^^^^^^^^^^^^^^^^^^ expected `()`, found opaque type
   |
   = note: expected unit type `()`
            found opaque type `<() as compare_ty::Trait>::Ty::{opaque#0}`
note: required by a bound in `compare_ty::Trait::Ty`
  --> $DIR/in-assoc-type-unconstrained.rs:5:31
   |
LL |         type Ty: IntoIterator<Item = ()>;
   |                               ^^^^^^^^^ required by this bound in `Trait::Ty`

error: unconstrained opaque type
  --> $DIR/in-assoc-type-unconstrained.rs:8:26
   |
LL |         type Ty = Option<impl Sized>;
   |                          ^^^^^^^^^^
   |
   = note: `Ty` must be used in combination with a concrete type within the same impl

error[E0053]: method `method` has an incompatible type for trait
  --> $DIR/in-assoc-type-unconstrained.rs:22:24
   |
LL |         type Ty = impl Sized;
   |                   ---------- the expected opaque type
LL |
LL |         fn method() -> () {}
   |                        ^^
   |                        |
   |                        expected opaque type, found `()`
   |                        help: change the output type to match the trait: `<() as compare_method::Trait>::Ty`
   |
note: type in trait
  --> $DIR/in-assoc-type-unconstrained.rs:17:24
   |
LL |         fn method() -> Self::Ty;
   |                        ^^^^^^^^
   = note: expected signature `fn() -> <() as compare_method::Trait>::Ty`
              found signature `fn()`
note: this item must have the opaque type in its signature in order to be able to register hidden types
  --> $DIR/in-assoc-type-unconstrained.rs:22:9
   |
LL |         fn method() -> () {}
   |         ^^^^^^^^^^^^^^^^^

error: unconstrained opaque type
  --> $DIR/in-assoc-type-unconstrained.rs:20:19
   |
LL |         type Ty = impl Sized;
   |                   ^^^^^^^^^^
   |
   = note: `Ty` must be used in combination with a concrete type within the same impl

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0053, E0271.
For more information about an error, try `rustc --explain E0053`.