rust/tests/ui/mismatched_types/trait-bounds-cant-coerce.rs

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

17 lines
211 B
Rust
Raw Normal View History

trait Foo {
fn dummy(&self) { }
}
2019-05-28 18:46:13 +00:00
fn a(_x: Box<dyn Foo + Send>) {
}
2019-05-28 18:46:13 +00:00
fn c(x: Box<dyn Foo + Sync + Send>) {
2013-07-11 19:05:17 +00:00
a(x);
}
2019-05-28 18:46:13 +00:00
fn d(x: Box<dyn Foo>) {
2016-11-14 02:42:15 +00:00
a(x); //~ ERROR mismatched types [E0308]
}
fn main() { }