File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
src/test/ui/type-alias-impl-trait Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( type_alias_impl_trait) ]
2+ #![ allow( dead_code) ]
3+
4+ // FIXME: This should compile, but it currently doesn't
5+
6+ use std:: fmt:: Debug ;
7+
8+ type Foo = impl Debug ;
9+ //~^ ERROR: could not find defining uses
10+
11+ static FOO1 : Foo = 22_u32 ;
12+ //~^ ERROR: mismatched types [E0308]
13+ const FOO2 : Foo = 22_u32 ;
14+ //~^ ERROR: mismatched types [E0308]
15+
16+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0308]: mismatched types
2+ --> $DIR/static-const-types.rs:11:20
3+ |
4+ LL | type Foo = impl Debug;
5+ | ---------- the expected opaque type
6+ ...
7+ LL | static FOO1: Foo = 22_u32;
8+ | ^^^^^^ expected opaque type, found `u32`
9+ |
10+ = note: expected opaque type `impl Debug`
11+ found type `u32`
12+
13+ error[E0308]: mismatched types
14+ --> $DIR/static-const-types.rs:13:19
15+ |
16+ LL | type Foo = impl Debug;
17+ | ---------- the expected opaque type
18+ ...
19+ LL | const FOO2: Foo = 22_u32;
20+ | ^^^^^^ expected opaque type, found `u32`
21+ |
22+ = note: expected opaque type `impl Debug`
23+ found type `u32`
24+
25+ error: could not find defining uses
26+ --> $DIR/static-const-types.rs:8:12
27+ |
28+ LL | type Foo = impl Debug;
29+ | ^^^^^^^^^^
30+
31+ error: aborting due to 3 previous errors
32+
33+ For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments