rust/tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs

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

12 lines
225 B
Rust
Raw Normal View History

2015-01-03 09:45:00 -06:00
struct X<F> where F: FnOnce() + 'static + Send {
field: F,
}
2015-01-03 09:45:00 -06:00
fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
//~^ ERROR `F` cannot be sent between threads safely
2015-01-03 09:45:00 -06:00
return X { field: blk };
}
fn main() {
}