]> git.lizzy.rs Git - rust.git/commit
Auto merge of #37447 - estebank:non-duplicate-definition-error, r=nrc
authorbors <bors@rust-lang.org>
Fri, 11 Nov 2016 13:55:04 +0000 (05:55 -0800)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2016 13:55:04 +0000 (05:55 -0800)
commitba2e892249d51cce0980e95e0b4daabb7710ad82
treecccda5050f72382601cc98c141ab6e2b260dd813
parent4da129d98419733bb408141ca53610bb77368cf0
parent43aed325aacfbe592fef2acffcf4f888155fb9bf
Auto merge of #37447 - estebank:non-duplicate-definition-error, r=nrc

Show one error for duplicated type definitions

For the following code:

``` rustc
struct Bar;
struct Bar;

fn main () {
}
```

show

``` nocode
error[E0428]: a type named `Bar` has already been defined in this module
  --> src/test/compile-fail/E0428.rs:12:1
   |
11 | struct Bar;
   | ----------- previous definition of `Bar` here
12 | struct Bar;
   | ^^^^^^^^^^^

error: aborting due to previous error
```

instead of

``` nocode
error[E0428]: a type named `Bar` has already been defined in this module
  --> src/test/compile-fail/E0428.rs:12:1
   |
11 | struct Bar;
   | ----------- previous definition of `Bar` here
12 | struct Bar;
   | ^^^^^^^^^^^

error[E0428]: a value named `Bar` has already been defined in this module
  --> src/test/compile-fail/E0428.rs:12:1
   |
11 | struct Bar;
   | ----------- previous definition of `Bar` here
12 | struct Bar;
   | ^^^^^^^^^^^

error: aborting due to 2 previous errors
```

Fixes #35767.
src/librustc_resolve/lib.rs