mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
15 lines
245 B
Rust
15 lines
245 B
Rust
trait Trait {}
|
|
|
|
struct S;
|
|
|
|
impl<'a> Trait for &'a mut S {}
|
|
|
|
fn foo<X: Trait>(_: X) {}
|
|
|
|
|
|
fn main() {
|
|
let s = S;
|
|
foo(&s); //~ ERROR the trait bound `&S: Trait` is not satisfied
|
|
foo(s); //~ ERROR the trait bound `S: Trait` is not satisfied
|
|
}
|