]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-84973-negative.rs
Rollup merge of #87596 - jesyspa:issue-87318-hidden-whitespace, r=estebank
[rust.git] / src / test / 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 }