Closed
Description
I tried this code:
#![feature(type_alias_impl_trait)]
pub type Foo = impl std::fmt::Debug;
pub const FOO: Foo = 5usize;
I expected to see this happen: successful compilation
Instead, this happened:
error[E0308]: mismatched types
--> src/lib.rs:4:22
|
3 | pub type Foo = impl std::fmt::Debug;
| -------------------- the expected opaque type
4 | pub const FOO: Foo = 5usize;
| ^^^^^^ expected opaque type, found `usize`
|
= note: expected opaque type `impl Debug`
found type `usize`
error: could not find defining uses
--> src/lib.rs:3:16
|
3 | pub type Foo = impl std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^
Meta
1.49.0-nightly (2020-10-12 8dae8cdcc8fa879cea6a)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done