Auto merge of #24818 - tbelaire:double-import, r=nrc

This isn't quite right, but it's interesting.
This commit is contained in:
bors 2015-05-12 08:54:40 +00:00
commit feac9f1c7b
2 changed files with 46 additions and 12 deletions

View file

@ -0,0 +1,27 @@
// Copyright 2015 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.
#![feature(no_std)]
#![no_std]
// This tests that conflicting imports shows both `use` lines
// when reporting the error.
mod sub1 {
fn foo() {} // implementation 1
}
mod sub2 {
fn foo() {} // implementation 2
}
use sub1::foo; //~ NOTE previous import of `foo` here
use sub2::foo; //~ ERROR a value named `foo` has already been imported in this module [E0252]
fn main() {}