rust/tests/ui/error-codes/E0277.rs

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

18 lines
257 B
Rust
Raw Normal View History

use std::path::Path;
2016-08-06 04:18:01 +08:00
trait Foo {
fn bar(&self);
}
fn some_func<T: Foo>(foo: T) {
foo.bar();
}
fn f(p: Path) { }
2018-07-11 05:10:13 +08:00
//~^ ERROR the size for values of type
2016-08-06 04:18:01 +08:00
fn main() {
some_func(5i32);
//~^ ERROR the trait bound `i32: Foo` is not satisfied
2016-08-06 04:18:01 +08:00
}