Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid items with the same name from appearing in overlapping inherent impl blocks #31925

Merged
merged 5 commits into from
Mar 12, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust tests to new error message
  • Loading branch information
aturon committed Mar 11, 2016
commit 2234b557bbd049f6dcdde3c27b89939baa9a0573
2 changes: 1 addition & 1 deletion src/test/compile-fail/associated-item-duplicate-names-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Foo;

impl Foo {
const bar: bool = true;
fn bar() {} //~ ERROR duplicate associated function
fn bar() {} //~ ERROR duplicate definitions
}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/compile-fail/associated-item-duplicate-names-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Baz;

impl Foo for Baz {
type Bar = i16;
type Bar = u16; //~ ERROR duplicate associated type
type Bar = u16; //~ ERROR duplicate definitions
}

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/associated-item-duplicate-names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ trait Foo {

impl Foo for () {
type Ty = ();
type Ty = usize; //~ ERROR duplicate associated type
type Ty = usize; //~ ERROR duplicate definitions
const BAR: u32 = 7;
const BAR: u32 = 8; //~ ERROR duplicate associated constant
const BAR: u32 = 8; //~ ERROR duplicate definitions
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/impl-duplicate-methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
struct Foo;
impl Foo {
fn orange(&self){}
fn orange(&self){} //~ ERROR duplicate method
fn orange(&self){} //~ ERROR duplicate definitions
}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4265.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Foo {
Foo { baz: 0 }.bar();
}

fn bar() { //~ ERROR duplicate associated function
fn bar() { //~ ERROR duplicate definitions
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-8153.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait Bar {

impl Bar for Foo {
fn bar(&self) -> isize {1}
fn bar(&self) -> isize {2} //~ ERROR duplicate method
fn bar(&self) -> isize {2} //~ ERROR duplicate definitions
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/method-macro-backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl S {

// Cause an error. It shouldn't have any macro backtrace frames.
fn bar(&self) { }
fn bar(&self) { } //~ ERROR duplicate method
fn bar(&self) { } //~ ERROR duplicate definitions
}

fn main() { }