]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-84973-negative.rs
Auto merge of #106914 - matthiaskrgr:rollup-yh0x4gq, r=matthiaskrgr
[rust.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 }