rust/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
547 B
Rust
Raw Normal View History

//@ 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() {
}