about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2014-07-17 13:50:54 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2014-07-17 13:50:54 +0900
commit99bd9265d98b74283ee2fa7fa45782e83e5bb79c (patch)
treef60b4513e090af2b8c119f7c7aeff3107e1f8a31 /src/test
parent058242141b54bf9e9b82caf02a39c4b9083023c1 (diff)
downloadrust-99bd9265d98b74283ee2fa7fa45782e83e5bb79c.tar.gz
rust-99bd9265d98b74283ee2fa7fa45782e83e5bb79c.zip
Disallow importing from types when reexport is involved
Diffstat (limited to 'src/test')
-rw-r--r--src/test/auxiliary/use_from_trait_xc.rs10
-rw-r--r--src/test/compile-fail/use-from-trait-xc.rs3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/test/auxiliary/use_from_trait_xc.rs b/src/test/auxiliary/use_from_trait_xc.rs
index 19e53fcc61a..8c547c28002 100644
--- a/src/test/auxiliary/use_from_trait_xc.rs
+++ b/src/test/auxiliary/use_from_trait_xc.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+pub use self::sub::Bar;
+
 pub trait Trait {
     fn foo();
 }
@@ -17,3 +19,11 @@ struct Foo;
 impl Foo {
     pub fn new() {}
 }
+
+mod sub {
+    pub struct Bar;
+
+    impl Bar {
+        pub fn new() {}
+    }
+}
diff --git a/src/test/compile-fail/use-from-trait-xc.rs b/src/test/compile-fail/use-from-trait-xc.rs
index 8e197b901e6..cea85955d37 100644
--- a/src/test/compile-fail/use-from-trait-xc.rs
+++ b/src/test/compile-fail/use-from-trait-xc.rs
@@ -18,4 +18,7 @@ use use_from_trait_xc::Trait::foo;
 use use_from_trait_xc::Foo::new;
 //~^ ERROR unresolved import `use_from_trait_xc::Foo::new`. Cannot import from a trait or type imple
 
+use use_from_trait_xc::Bar::new;
+//~^ ERROR unresolved import `use_from_trait_xc::Bar::new`. Cannot import from a trait or type
+
 fn main() {}