forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b0e554
commit 4fcae2c
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![feature(type_alias_impl_trait)] | ||
#![allow(dead_code)] | ||
|
||
// FIXME: This should compile, but it currently doesn't | ||
|
||
use std::fmt::Debug; | ||
|
||
type Foo = impl Debug; | ||
//~^ ERROR: could not find defining uses | ||
|
||
static FOO1: Foo = 22_u32; | ||
//~^ ERROR: mismatched types [E0308] | ||
const FOO2: Foo = 22_u32; | ||
//~^ ERROR: mismatched types [E0308] | ||
|
||
fn main() {} |
33 changes: 33 additions & 0 deletions
33
src/test/ui/type-alias-impl-trait/static-const-types.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/static-const-types.rs:11:20 | ||
| | ||
LL | type Foo = impl Debug; | ||
| ---------- the expected opaque type | ||
... | ||
LL | static FOO1: Foo = 22_u32; | ||
| ^^^^^^ expected opaque type, found `u32` | ||
| | ||
= note: expected opaque type `impl Debug` | ||
found type `u32` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/static-const-types.rs:13:19 | ||
| | ||
LL | type Foo = impl Debug; | ||
| ---------- the expected opaque type | ||
... | ||
LL | const FOO2: Foo = 22_u32; | ||
| ^^^^^^ expected opaque type, found `u32` | ||
| | ||
= note: expected opaque type `impl Debug` | ||
found type `u32` | ||
|
||
error: could not find defining uses | ||
--> $DIR/static-const-types.rs:8:12 | ||
| | ||
LL | type Foo = impl Debug; | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |