1 // Regression test for issue #87199, where attempting to relax a bound
2 // other than the only supported `?Sized` would still cause the compiler
3 // to assume that the `Sized` bound was relaxed.
7 // Check that these function definitions only emit warnings, not errors
8 fn arg<T: ?Send>(_: T) {}
9 //~^ warning: default bound relaxed for a type parameter, but this does nothing
10 fn ref_arg<T: ?Send>(_: &T) {}
11 //~^ warning: default bound relaxed for a type parameter, but this does nothing
12 fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
13 //~^ warning: default bound relaxed for a type parameter, but this does nothing
15 // Check that there's no `?Sized` relaxation!
18 ref_arg::<[i32]>(&[5]);
19 //~^ the size for values of type `[i32]` cannot be known