rust/tests/ui/suggestions/issue-84973-2.rs
2023-01-11 09:32:08 +00:00

14 lines
295 B
Rust

// A slight variation of issue-84973.rs. Here, a mutable borrow is
// required (and the obligation kind is different).
trait Tr {}
impl Tr for &mut i32 {}
fn foo<T: Tr>(i: T) {}
fn main() {
let a: i32 = 32;
foo(a);
//~^ ERROR: the trait bound `i32: Tr` is not satisfied [E0277]
}