aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1485.rs
blob: a0cd5a0f1f92140f86a0742237fe69b2c51db2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[lang = "sized"]
pub trait Sized {}

#[lang = "fn_once"]
pub trait FnOnce<Args> {
    #[lang = "fn_once_output"]
    type Output;

    extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
}

struct BinOpInvalid {
    lhs: i32,
    rhs: i32,
    f: impl FnOnce(i32) -> i32, // { dg-error ".impl Trait. not allowed outside of function and inherent method return types .E0562." }
}