Skip to content

Commit a25041f

Browse files
authored
Rollup merge of rust-lang#88348 - spastorino:field-types-tait-test, r=oli-obk
Add field types tait tests r? `@oli-obk` Related to rust-lang#86727
2 parents 7e83381 + bb583f7 commit a25041f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
struct Bar {
12+
foo: Foo,
13+
}
14+
15+
fn bar() -> Bar {
16+
Bar { foo: "foo" }
17+
//~^ ERROR: mismatched types [E0308]
18+
}
19+
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/field-types.rs:16:16
3+
|
4+
LL | type Foo = impl Debug;
5+
| ---------- the expected opaque type
6+
...
7+
LL | Bar { foo: "foo" }
8+
| ^^^^^ expected opaque type, found `&str`
9+
|
10+
= note: expected opaque type `impl Debug`
11+
found reference `&'static str`
12+
13+
error: could not find defining uses
14+
--> $DIR/field-types.rs:8:12
15+
|
16+
LL | type Foo = impl Debug;
17+
| ^^^^^^^^^^
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)