]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/imm-ref-trait-object-literal.rs
Rollup merge of #107632 - ameknite:issue-107622-fix, r=jyn514
[rust.git] / tests / ui / suggestions / imm-ref-trait-object-literal.rs
1 trait Trait {}
2
3 struct S;
4
5 impl<'a> Trait for &'a mut S {}
6
7 fn foo<X: Trait>(_: X) {}
8
9
10 fn main() {
11   let s = S;
12   foo(&s); //~ ERROR the trait bound `&S: Trait` is not satisfied
13   foo(s); //~ ERROR the trait bound `S: Trait` is not satisfied
14 }