apply review
This commit is contained in:
parent
cac95ee11c
commit
ad4cea408d
9 changed files with 77 additions and 55 deletions
18
src/test/ui/issues/issue-45829/issue-45829.rs
Normal file
18
src/test/ui/issues/issue-45829/issue-45829.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
mod foo {
|
||||
pub struct A;
|
||||
pub struct B;
|
||||
}
|
||||
|
||||
use foo::{A, B as A};
|
||||
|
||||
fn main() {}
|
||||
17
src/test/ui/issues/issue-45829/issue-45829.stderr
Normal file
17
src/test/ui/issues/issue-45829/issue-45829.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error[E0252]: the name `A` is defined multiple times
|
||||
--> $DIR/issue-45829.rs:16:14
|
||||
|
|
||||
LL | use foo::{A, B as A};
|
||||
| - ^^^^^^ `A` reimported here
|
||||
| |
|
||||
| previous import of the type `A` here
|
||||
|
|
||||
= note: `A` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | use foo::{A, B as OtherA};
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0252`.
|
||||
|
|
@ -10,7 +10,11 @@
|
|||
|
||||
// aux-build:issue_45829_b.rs
|
||||
|
||||
use std;
|
||||
extern crate issue_45829_b as std;
|
||||
mod foo {
|
||||
pub mod bar {}
|
||||
}
|
||||
|
||||
use foo::bar;
|
||||
extern crate issue_45829_b as bar;
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,17 @@
|
|||
error[E0259]: the name `std` is defined multiple times
|
||||
--> $DIR/rename-extern-vs-use.rs:14:1
|
||||
error[E0254]: the name `bar` is defined multiple times
|
||||
--> $DIR/rename-extern-vs-use.rs:18:1
|
||||
|
|
||||
LL | extern crate issue_45829_b as std;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `std` reimported here
|
||||
| You can use `as` to change the binding name of the import
|
||||
LL | use foo::bar;
|
||||
| -------- previous import of the module `bar` here
|
||||
LL | extern crate issue_45829_b as bar;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `bar` reimported here
|
||||
|
|
||||
= note: `bar` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | extern crate issue_45829_b as other_bar;
|
||||
|
|
||||
= note: `std` must be defined only once in the type namespace of this module
|
||||
|
||||
error[E0254]: the name `std` is defined multiple times
|
||||
--> $DIR/rename-extern-vs-use.rs:13:5
|
||||
|
|
||||
LL | use std;
|
||||
| ^^^ `std` reimported here
|
||||
|
|
||||
= note: `std` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | use std as other_std;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
error: aborting due to previous error
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors occurred: E0254, E0259.
|
||||
For more information about an error, try `rustc --explain E0254`.
|
||||
For more information about this error, try `rustc --explain E0254`.
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0259]: the name `issue_45829_a` is defined multiple times
|
|||
LL | extern crate issue_45829_a;
|
||||
| --------------------------- previous import of the extern crate `issue_45829_a` here
|
||||
LL | extern crate issue_45829_b as issue_45829_a;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `issue_45829_a` reimported here
|
||||
| You can use `as` to change the binding name of the import
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `issue_45829_a` reimported here
|
||||
|
|
||||
= note: `issue_45829_a` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | extern crate issue_45829_b as other_issue_45829_a;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | use std as issue_45829_b;
|
|||
| ^^^^^^^^^^^^^^^^^^^^ `issue_45829_b` reimported here
|
||||
|
|
||||
= note: `issue_45829_b` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | use std as other_issue_45829_b;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | use std::{collections::HashMap as A, sync::Arc as A};
|
|||
| previous import of the type `A` here
|
||||
|
|
||||
= note: `A` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | use std::{collections::HashMap as A, sync::Arc as OtherA};
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | use std as core;
|
|||
| ^^^^^^^^^^^ `core` reimported here
|
||||
|
|
||||
= note: `core` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | use std as other_core;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue