summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/normalize-hidden-types.current.stderr
blob: dd2737c706d6bb339be662d01b7153b6763160cb (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
error: concrete type differs from previous defining opaque type use
  --> $DIR/normalize-hidden-types.rs:25:20
   |
LL |     fn define() -> Opaque {
   |                    ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
   |
note: previous use here
  --> $DIR/normalize-hidden-types.rs:27:9
   |
LL |         dyn_hoops::<_>(0)
   |         ^^^^^^^^^^^^^^^^^

error: concrete type differs from previous defining opaque type use
  --> $DIR/normalize-hidden-types.rs:34:22
   |
LL |     fn define_1() -> Opaque { dyn_hoops::<_>(0) }
   |                      ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
   |
note: previous use here
  --> $DIR/normalize-hidden-types.rs:34:31
   |
LL |     fn define_1() -> Opaque { dyn_hoops::<_>(0) }
   |                               ^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> $DIR/normalize-hidden-types.rs:44:25
   |
LL |     type Opaque = impl Sized;
   |                   ---------- the expected opaque type
...
LL |         let _: Opaque = dyn_hoops::<u8>(0);
   |                ------   ^^^^^^^^^^^^^^^^^^ expected opaque type, found `*const dyn FnOnce(())`
   |                |
   |                expected due to this
   |
   = note: expected opaque type `typeck::Opaque`
              found raw pointer `*const (dyn FnOnce(()) + 'static)`
   = help: consider constraining the associated type `<u8 as Trait>::Gat<'_>` to `()` or calling a method that returns `<u8 as Trait>::Gat<'_>`
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: concrete type differs from previous defining opaque type use
  --> $DIR/normalize-hidden-types.rs:54:25
   |
LL |         let _: Opaque = dyn_hoops::<_>(0);
   |                         ^^^^^^^^^^^^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
   |
note: previous use here
  --> $DIR/normalize-hidden-types.rs:56:9
   |
LL |         None
   |         ^^^^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.