Skip to content

Commit 61396a8

Browse files
committed
Add UI test
1 parent ff83240 commit 61396a8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub mod extension1 {
12+
pub trait ConstructorExtension {}
13+
}
14+
15+
pub mod extension2 {
16+
pub trait ConstructorExtension {}
17+
}
18+
19+
use extension1::ConstructorExtension;
20+
use extension2::ConstructorExtension;
21+
22+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0252]: the name `ConstructorExtension` is defined multiple times
2+
--> $DIR/issue-32354-suggest-import-rename.rs:20:5
3+
|
4+
19 | use extension1::ConstructorExtension;
5+
| -------------------------------- previous import of the trait `ConstructorExtension` here
6+
20 | use extension2::ConstructorExtension;
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ConstructorExtension` reimported here
8+
|
9+
= note: `ConstructorExtension` must be defined only once in the type namespace of this module
10+
help: You can use `as` to change the binding name of the import
11+
|
12+
20 | use extension2::ConstructorExtension as OtherConstructorExtension;
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
15+
error: aborting due to previous error
16+

0 commit comments

Comments
 (0)