summaryrefslogtreecommitdiffstats
path: root/tests/ui/lang-items/lang-item-missing-generator.rs
blob: 9b9aff38e524ee3ba6ac99920b2bd04dd10105fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// error-pattern: requires `generator` lang_item
#![feature(no_core, lang_items, unboxed_closures, tuple_trait)]
#![no_core]

#[lang = "sized"] pub trait Sized { }

#[lang = "tuple_trait"] pub trait Tuple { }

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

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

pub fn abc() -> impl FnOnce(f32) {
    |_| {}
}

fn main() {}