-
Notifications
You must be signed in to change notification settings - Fork 13k
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 bb583f7
Showing
2 changed files
with
41 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,20 @@ | ||
#![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 | ||
|
||
struct Bar { | ||
foo: Foo, | ||
} | ||
|
||
fn bar() -> Bar { | ||
Bar { foo: "foo" } | ||
//~^ ERROR: mismatched types [E0308] | ||
} | ||
|
||
fn main() {} |
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,21 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/field-types.rs:16:16 | ||
| | ||
LL | type Foo = impl Debug; | ||
| ---------- the expected opaque type | ||
... | ||
LL | Bar { foo: "foo" } | ||
| ^^^^^ expected opaque type, found `&str` | ||
| | ||
= note: expected opaque type `impl Debug` | ||
found reference `&'static str` | ||
|
||
error: could not find defining uses | ||
--> $DIR/field-types.rs:8:12 | ||
| | ||
LL | type Foo = impl Debug; | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |