Rollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkov
Only test duplicate inherent impl items in a single place Based on https://github.com/rust-lang/rust/pull/100387 r? ``@petrochenkov``
This commit is contained in:
commit
b4906acbce
10 changed files with 66 additions and 74 deletions
|
|
@ -1,11 +1,11 @@
|
|||
error[E0201]: duplicate definitions with name `bar`:
|
||||
error[E0592]: duplicate definitions with name `bar`
|
||||
--> $DIR/associated-item-duplicate-names-2.rs:5:5
|
||||
|
|
||||
LL | const bar: bool = true;
|
||||
| --------------- previous definition of `bar` here
|
||||
| --------------- other definition for `bar`
|
||||
LL | fn bar() {}
|
||||
| ^^^^^^^^ duplicate definition
|
||||
| ^^^^^^^^ duplicate definitions for `bar`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0201`.
|
||||
For more information about this error, try `rustc --explain E0592`.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ struct Foo;
|
|||
impl Foo {
|
||||
fn orange(&self) {}
|
||||
fn orange(&self) {}
|
||||
//~^ ERROR duplicate definition
|
||||
//~^ ERROR duplicate definitions with name `orange` [E0592]
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
11
src/test/ui/associated-item/impl-duplicate-methods.stderr
Normal file
11
src/test/ui/associated-item/impl-duplicate-methods.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
error[E0592]: duplicate definitions with name `orange`
|
||||
--> $DIR/impl-duplicate-methods.rs:5:5
|
||||
|
|
||||
LL | fn orange(&self) {}
|
||||
| ---------------- other definition for `orange`
|
||||
LL | fn orange(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^ duplicate definitions for `orange`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0592`.
|
||||
|
|
@ -2,7 +2,7 @@ struct Foo(u8);
|
|||
|
||||
impl Foo {
|
||||
fn bar(&self) -> bool { self.0 > 5 }
|
||||
fn bar() {} //~ ERROR E0201
|
||||
fn bar() {} //~ ERROR E0592
|
||||
}
|
||||
|
||||
trait Baz {
|
||||
|
|
|
|||
|
|
@ -21,14 +21,15 @@ LL | type Quux = u32;
|
|||
LL | type Quux = u32;
|
||||
| ^^^^^^^^^^^^^^^^ duplicate definition
|
||||
|
||||
error[E0201]: duplicate definitions with name `bar`:
|
||||
error[E0592]: duplicate definitions with name `bar`
|
||||
--> $DIR/E0201.rs:5:5
|
||||
|
|
||||
LL | fn bar(&self) -> bool { self.0 > 5 }
|
||||
| --------------------- previous definition of `bar` here
|
||||
| --------------------- other definition for `bar`
|
||||
LL | fn bar() {}
|
||||
| ^^^^^^^^ duplicate definition
|
||||
| ^^^^^^^^ duplicate definitions for `bar`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0201`.
|
||||
Some errors have detailed explanations: E0201, E0592.
|
||||
For more information about an error, try `rustc --explain E0201`.
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0201]: duplicate definitions with name `orange`:
|
||||
--> $DIR/impl-duplicate-methods.rs:5:5
|
||||
|
|
||||
LL | fn orange(&self) {}
|
||||
| ---------------- previous definition of `orange` here
|
||||
LL | fn orange(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^ duplicate definition
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0201`.
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
error[E0201]: duplicate definitions with name `bar`:
|
||||
error[E0592]: duplicate definitions with name `bar`
|
||||
--> $DIR/issue-4265.rs:10:5
|
||||
|
|
||||
LL | fn bar() {
|
||||
| -------- previous definition of `bar` here
|
||||
| -------- other definition for `bar`
|
||||
...
|
||||
LL | fn bar() {
|
||||
| ^^^^^^^^ duplicate definition
|
||||
| ^^^^^^^^ duplicate definitions for `bar`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0201`.
|
||||
For more information about this error, try `rustc --explain E0592`.
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0201]: duplicate definitions with name `bar`:
|
||||
error[E0592]: duplicate definitions with name `bar`
|
||||
--> $DIR/method-macro-backtrace.rs:22:5
|
||||
|
|
||||
LL | fn bar(&self) { }
|
||||
| ------------- previous definition of `bar` here
|
||||
| ------------- other definition for `bar`
|
||||
LL | fn bar(&self) { }
|
||||
| ^^^^^^^^^^^^^ duplicate definition
|
||||
| ^^^^^^^^^^^^^ duplicate definitions for `bar`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0201`.
|
||||
For more information about this error, try `rustc --explain E0592`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue