about summary refs log tree commit diff
path: root/tests/incremental/define-opaques.rs
blob: d6eae23834122437da4bc5b29ab4b0e6031cbbe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ revisions: rpass1 cfail2

#![feature(type_alias_impl_trait)]

pub type Foo = impl Sized;

#[cfg_attr(rpass1, define_opaque())]
#[cfg_attr(cfail2, define_opaque(Foo))]
fn a() {
    //[cfail2]~^ ERROR item does not constrain `Foo::{opaque#0}`
    let _: Foo = b();
}

#[define_opaque(Foo)]
fn b() -> Foo {
    ()
}

fn main() {}