summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.rs
blob: 10588398c9d7f470bfb82bf6dbf86c09adbde47d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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}");
}