]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | // run-rustfix |
2 | ||
1b1a35ee XL |
3 | #[allow(unused)] |
4 | use std::fmt::Debug; | |
5 | // Rustfix should add this, or use `std::fmt::Debug` instead. | |
6 | ||
74b04a01 | 7 | #[allow(dead_code)] |
1b1a35ee | 8 | fn test_impl(t: impl Sized + Debug) { |
74b04a01 XL |
9 | println!("{:?}", t); |
10 | //~^ ERROR doesn't implement | |
11 | } | |
12 | ||
13 | #[allow(dead_code)] | |
1b1a35ee | 14 | fn test_no_bounds<T: Debug>(t: T) { |
74b04a01 XL |
15 | println!("{:?}", t); |
16 | //~^ ERROR doesn't implement | |
17 | } | |
18 | ||
19 | #[allow(dead_code)] | |
1b1a35ee | 20 | fn test_one_bound<T: Sized + Debug>(t: T) { |
74b04a01 XL |
21 | println!("{:?}", t); |
22 | //~^ ERROR doesn't implement | |
23 | } | |
24 | ||
25 | #[allow(dead_code)] | |
1b1a35ee | 26 | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: Debug { |
74b04a01 XL |
27 | println!("{:?} {:?}", x, y); |
28 | //~^ ERROR doesn't implement | |
29 | } | |
30 | ||
31 | #[allow(dead_code)] | |
1b1a35ee | 32 | fn test_one_bound_where<X>(x: X) where X: Sized + Debug { |
74b04a01 XL |
33 | println!("{:?}", x); |
34 | //~^ ERROR doesn't implement | |
35 | } | |
36 | ||
37 | #[allow(dead_code)] | |
1b1a35ee | 38 | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: Debug { |
74b04a01 XL |
39 | println!("{:?}", x); |
40 | //~^ ERROR doesn't implement | |
41 | } | |
42 | ||
43 | pub fn main() { } |