]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/issue-84973-negative.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / suggestions / issue-84973-negative.rs
1 // Checks that we only suggest borrowing if &T actually implements the trait.
2
3 trait Tr {}
4 impl Tr for &f32 {}
5 fn bar<T: Tr>(t: T) {}
6
7 fn main() {
8 let a = 0i32;
9 let b = 0.0f32;
10 bar(a); //~ ERROR: the trait bound `i32: Tr` is not satisfied [E0277]
11 bar(b); //~ ERROR: the trait bound `f32: Tr` is not satisfied [E0277]
12 }