rust/tests/ui/suggestions/imm-ref-trait-object-literal.rs

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

15 lines
245 B
Rust
Raw Normal View History

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
}