diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index 2556397caf90..b5d0fad7f958 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -243,7 +243,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> { ast::sty_static => public_ty, _ => true, } && method.vis == ast::public; - if meth_public || public_trait { + if meth_public || tr.is_some() { self.exported_items.insert(method.id); } } diff --git a/src/test/auxiliary/priv-impl-prim-ty.rs b/src/test/auxiliary/priv-impl-prim-ty.rs new file mode 100644 index 000000000000..16d3ca8fa649 --- /dev/null +++ b/src/test/auxiliary/priv-impl-prim-ty.rs @@ -0,0 +1,19 @@ +// Copyright 2013 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. + +trait A { + fn frob(&self); +} + +impl A for int { fn frob(&self) {} } + +pub fn frob(t: T) { + t.frob(); +} diff --git a/src/test/run-pass/priv-impl-prim-ty.rs b/src/test/run-pass/priv-impl-prim-ty.rs new file mode 100644 index 000000000000..4439da4f6f51 --- /dev/null +++ b/src/test/run-pass/priv-impl-prim-ty.rs @@ -0,0 +1,19 @@ +// Copyright 2013 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. + +// xfail-fast +// aux-build:priv-impl-prim-ty.rs + +extern mod bar(name = "priv-impl-prim-ty"); + +fn main() { + bar::frob(1i); + +}