From 2ff14448863ac1a1dd9533461708e29aae170c2d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:31 +0200 Subject: Adding debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- .../move-generic-to-trait-in-method-with-params.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs (limited to 'src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs') diff --git a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs new file mode 100644 index 000000000..2f540060a --- /dev/null +++ b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs @@ -0,0 +1,18 @@ +// Generalizes the suggestion introduced in #100838 + +trait Foo { + fn bar(&self, _: T); +} + +impl Foo for i32 { + fn bar(&self, x: i32) { + println!("{}", self + x); + } +} + +fn main() { + 1.bar::(0); + //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied + //~| HELP consider moving this generic argument to the `Foo` trait, which takes up to 1 argument + //~| HELP remove these generics +} -- cgit v1.2.3