Add additional test
This commit is contained in:
parent
7db5f81853
commit
6875589924
@ -0,0 +1,21 @@
|
||||
// issue: 113314
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type Op = impl std::fmt::Display;
|
||||
fn foo() -> Op { &"hello world" }
|
||||
|
||||
fn transform<S>() -> impl std::fmt::Display {
|
||||
&0usize
|
||||
}
|
||||
fn bad() -> Op {
|
||||
transform::<Op>()
|
||||
//~^ ERROR concrete type differs from previous defining opaque type use
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut x = foo();
|
||||
println!("{x}");
|
||||
x = bad();
|
||||
println!("{x}");
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
error: concrete type differs from previous defining opaque type use
|
||||
--> $DIR/recursive-tait-conflicting-defn-2.rs:12:5
|
||||
|
|
||||
LL | transform::<Op>()
|
||||
| ^^^^^^^^^^^^^^^^^ expected `&'static &'static str`, got `impl std::fmt::Display`
|
||||
|
|
||||
note: previous use here
|
||||
--> $DIR/recursive-tait-conflicting-defn-2.rs:6:18
|
||||
|
|
||||
LL | fn foo() -> Op { &"hello world" }
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user