From 8b13912a839a5e0336fa285d9b62c1337e17b165 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 26 Sep 2012 14:23:27 -0700 Subject: [PATCH] Make impl of Add for @[] public It's not clear that impls should have to be public to be used from outside the crate; in particular, I don't know whether they have to be public to be used from other modules within the same crate. --- src/libcore/at_vec.rs | 6 ++---- src/rustc/middle/typeck/coherence.rs | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs index 535aa4e37ec..2c54ed7aaf3 100644 --- a/src/libcore/at_vec.rs +++ b/src/libcore/at_vec.rs @@ -134,9 +134,9 @@ pub pure fn from_elem(n_elts: uint, +t: T) -> @[T] { } #[cfg(notest)] -mod traits { +pub mod traits { #[legacy_exports]; - impl @[T] : Add<&[const T],@[T]> { + pub impl @[T] : Add<&[const T],@[T]> { #[inline(always)] pure fn add(rhs: & &[const T]) -> @[T] { append(self, (*rhs)) @@ -249,9 +249,7 @@ pub fn test() { assert from_elem(5, 3.14) == @[3.14, 3.14, 3.14, 3.14, 3.14]; } -/* #[test] pub fn append_test() { assert @[1,2,3] + @[4,5,6] == @[1,2,3,4,5,6]; } -*/ diff --git a/src/rustc/middle/typeck/coherence.rs b/src/rustc/middle/typeck/coherence.rs index 17d5f81993d..77c665755c3 100644 --- a/src/rustc/middle/typeck/coherence.rs +++ b/src/rustc/middle/typeck/coherence.rs @@ -654,6 +654,10 @@ impl CoherenceChecker { module_def_id, None); for (*implementations).each |implementation| { + debug!("coherence: adding impl from external crate: %s", + ty::item_path_str(self.crate_context.tcx, + implementation.did)); + // Make sure we don't visit the same implementation // multiple times. match impls_seen.find(implementation.did) {