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
This commit is contained in:
bors 2015-10-27 01:04:14 +00:00
commit 95fb8d1c87
2 changed files with 19 additions and 14 deletions

View file

@ -8,20 +8,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use outer::Foo;
mod outer {
pub use self::inner::Foo;
mod inner {
pub trait Foo {
fn bar(&self) {}
}
impl Foo for i32 {}
mod m {
trait Priv {
fn f(&self) {}
}
impl Priv for super::S {}
pub trait Pub: Priv {}
}
struct S;
impl m::Pub for S {}
fn g<T: m::Pub>(arg: T) {
arg.f(); //~ ERROR: source trait is private
}
fn main() {
let x: i32 = 0;
x.bar();
g(S);
}