2019-12-26 06:43:33 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
#[allow(unused)]
|
|
|
|
use std::fmt::Debug;
|
|
|
|
// Rustfix should add this, or use `std::fmt::Debug` instead.
|
|
|
|
|
2019-12-26 06:43:33 -06:00
|
|
|
#[allow(dead_code)]
|
|
|
|
fn test_impl(t: impl Sized) {
|
|
|
|
println!("{:?}", t);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
fn test_no_bounds<T>(t: T) {
|
|
|
|
println!("{:?}", t);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
fn test_one_bound<T: Sized>(t: T) {
|
|
|
|
println!("{:?}", t);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
2020-05-28 18:31:48 -05:00
|
|
|
fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, {
|
2019-12-26 06:43:33 -06:00
|
|
|
println!("{:?} {:?}", x, y);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
fn test_one_bound_where<X>(x: X) where X: Sized {
|
|
|
|
println!("{:?}", x);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized {
|
|
|
|
println!("{:?}", x);
|
|
|
|
//~^ ERROR doesn't implement
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() { }
|