about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.rs
blob: 7803b3b78db833803aa540829f32aef4a04128f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// issue: 113314

#![feature(type_alias_impl_trait)]

type Op = impl std::fmt::Display;
#[define_opaque(Op)]
fn foo() -> Op {
    &"hello world"
}

fn transform<S>() -> impl std::fmt::Display {
    &0usize
}
#[define_opaque(Op)]
fn bad() -> Op {
    //~^ ERROR cannot resolve opaque type
    transform::<Op>()
}

fn main() {
    let mut x = foo();
    println!("{x}");
    x = bad();
    println!("{x}");
}