diff options
Diffstat (limited to 'tests/ui/trait-impl-bound-suggestions.rs')
-rw-r--r-- | tests/ui/trait-impl-bound-suggestions.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/trait-impl-bound-suggestions.rs b/tests/ui/trait-impl-bound-suggestions.rs new file mode 100644 index 000000000..bf7517517 --- /dev/null +++ b/tests/ui/trait-impl-bound-suggestions.rs @@ -0,0 +1,20 @@ +// run-rustfix + +#[allow(unused)] +use std::fmt::Debug; +// Rustfix should add this, or use `std::fmt::Debug` instead. + +#[allow(dead_code)] +struct ConstrainedStruct<X: Copy> { + x: X +} + +#[allow(dead_code)] +trait InsufficientlyConstrainedGeneric<X=()> { + fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> { + //~^ ERROR the trait bound `X: Copy` is not satisfied + ConstrainedStruct { x } + } +} + +pub fn main() { } |