From 152cd6322655bb5173655cdf0781ca64c2a7602f Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 10 Aug 2022 21:31:26 +0200 Subject: Report duplicate definitions in trait impls during resolution. --- src/test/ui/error-codes/E0201.stderr | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr index 94e06894144..f72145a8244 100644 --- a/src/test/ui/error-codes/E0201.stderr +++ b/src/test/ui/error-codes/E0201.stderr @@ -1,27 +1,33 @@ -error[E0201]: duplicate definitions with name `bar`: - --> $DIR/E0201.rs:5:5 - | -LL | fn bar(&self) -> bool { self.0 > 5 } - | --------------------- previous definition of `bar` here -LL | fn bar() {} - | ^^^^^^^^ duplicate definition - error[E0201]: duplicate definitions with name `baz`: --> $DIR/E0201.rs:17:5 | +LL | fn baz(&self) -> bool; + | ---------------------- item in trait +... LL | fn baz(&self) -> bool { true } - | --------------------- previous definition of `baz` here + | ------------------------------ previous definition here LL | fn baz(&self) -> bool { self.0 > 5 } - | ^^^^^^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `Quux`: --> $DIR/E0201.rs:18:5 | +LL | type Quux; + | ---------- item in trait +... LL | type Quux = u32; - | --------- previous definition of `Quux` here + | ---------------- previous definition here ... LL | type Quux = u32; - | ^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^ duplicate definition + +error[E0201]: duplicate definitions with name `bar`: + --> $DIR/E0201.rs:5:5 + | +LL | fn bar(&self) -> bool { self.0 > 5 } + | --------------------- previous definition of `bar` here +LL | fn bar() {} + | ^^^^^^^^ duplicate definition error: aborting due to 3 previous errors -- cgit 1.4.1-3-g733a5