about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-27 01:04:14 +0000
committerbors <bors@rust-lang.org>2015-10-27 01:04:14 +0000
commit95fb8d1c87907de61514a624ef62f6a6b463aefc (patch)
tree6b4cd2289bbccf96721d8a7a5186e72e1da39358 /src/test
parent05eb81ae11929438f2386d34113e45a5a2c3552b (diff)
parent31fa9167c0046b3f225864d3e7317120694bfb8f (diff)
downloadrust-95fb8d1c87907de61514a624ef62f6a6b463aefc.tar.gz
rust-95fb8d1c87907de61514a624ef62f6a6b463aefc.zip
Auto merge of #29325 - alexcrichton:revert-trait-accessibility, r=nrc
These commits revert https://github.com/rust-lang/rust/pull/28504 and add a regression test pointed out by @petrochenkov, it's not immediately clear with the regression that the accessibility check should be removed, so for now preserve the behavior on stable by default.

r? @nrc 
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/trait-not-accessible.rs (renamed from src/test/run-pass/issue-16264.rs)23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/test/run-pass/issue-16264.rs b/src/test/compile-fail/trait-not-accessible.rs
index 67701de6386..21668fcfeae 100644
--- a/src/test/run-pass/issue-16264.rs
+++ b/src/test/compile-fail/trait-not-accessible.rs
@@ -8,20 +8,21 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use outer::Foo;
+mod m {
+    trait Priv {
+        fn f(&self) {}
+    }
+    impl Priv for super::S {}
+    pub trait Pub: Priv {}
+}
 
-mod outer {
-    pub use self::inner::Foo;
+struct S;
+impl m::Pub for S {}
 
-    mod inner {
-        pub trait Foo {
-            fn bar(&self) {}
-        }
-        impl Foo for i32 {}
-    }
+fn g<T: m::Pub>(arg: T) {
+    arg.f(); //~ ERROR: source trait is private
 }
 
 fn main() {
-    let x: i32 = 0;
-    x.bar();
+    g(S);
 }