about summary refs log tree commit diff
path: root/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs
blob: 50851a5b0f84cb21d94cb406c95b564aa277a7ed (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
//@ edition: 2021

fn f<'a>(x: Box<dyn Fn() -> Option<usize + 'a>>) -> usize {
    //~^ ERROR expected trait, found builtin type `usize`
    //~| ERROR expected a type, found a trait [E0782]
    0
}

fn create_adder<'a>(x: i32) -> usize + 'a {
    //~^ ERROR expected trait, found builtin type `usize`
    //~| ERROR expected a type, found a trait [E0782]
    move |y| x + y
}

struct Struct<'a>{
    x: usize + 'a,
    //~^ ERROR expected trait, found builtin type `usize`
    //~| ERROR expected a type, found a trait [E0782]
}


fn main() {

}