From 1fd491c3b436753c25c153f24b95a481a36c4804 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 22 Dec 2014 21:20:31 -0800 Subject: [PATCH] Regression test for #14386 Closes #14386. --- src/test/compile-fail/double-type-import.rs | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/compile-fail/double-type-import.rs diff --git a/src/test/compile-fail/double-type-import.rs b/src/test/compile-fail/double-type-import.rs new file mode 100644 index 00000000000..923f95e69d1 --- /dev/null +++ b/src/test/compile-fail/double-type-import.rs @@ -0,0 +1,24 @@ +// Copyright 2014 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod foo { + pub use self::bar::X; + use self::bar::X; + //~^ ERROR a value named `X` has already been imported in this module + //~| ERROR a type named `X` has already been imported in this module + + mod bar { + pub struct X; + } +} + +fn main() { + let _ = foo::X; +}