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:
Dylan DPC 2022-10-14 16:19:12 +05:30 committed by GitHub
commit b4906acbce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 66 additions and 74 deletions

View file

@ -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`.

View file

@ -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() {}

View 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`.

View file

@ -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 {

View file

@ -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`.

View file

@ -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`.

View file

@ -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`.

View file

@ -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`.