]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/double-import.rs
New upstream version 1.12.0+dfsg1
[rustc.git] / src / test / compile-fail / double-import.rs
CommitLineData
c34b1796
AL
1// Copyright 2015 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
d9579d0f
AL
11// This tests that conflicting imports shows both `use` lines
12// when reporting the error.
c34b1796 13
d9579d0f 14mod sub1 {
54a0048b 15 pub fn foo() {} // implementation 1
d9579d0f 16}
c34b1796 17
d9579d0f 18mod sub2 {
54a0048b 19 pub fn foo() {} // implementation 2
c34b1796
AL
20}
21
d9579d0f
AL
22use sub1::foo; //~ NOTE previous import of `foo` here
23use sub2::foo; //~ ERROR a value named `foo` has already been imported in this module [E0252]
5bcae85e 24 //~| NOTE already imported
d9579d0f
AL
25
26fn main() {}