Skip to content

Commit 8b13912

Browse files
committed
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.
1 parent 264e1b2 commit 8b13912

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/libcore/at_vec.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, +t: T) -> @[T] {
134134
}
135135

136136
#[cfg(notest)]
137-
mod traits {
137+
pub mod traits {
138138
#[legacy_exports];
139-
impl<T: Copy> @[T] : Add<&[const T],@[T]> {
139+
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
140140
#[inline(always)]
141141
pure fn add(rhs: & &[const T]) -> @[T] {
142142
append(self, (*rhs))
@@ -249,9 +249,7 @@ pub fn test() {
249249
assert from_elem(5, 3.14) == @[3.14, 3.14, 3.14, 3.14, 3.14];
250250
}
251251

252-
/*
253252
#[test]
254253
pub fn append_test() {
255254
assert @[1,2,3] + @[4,5,6] == @[1,2,3,4,5,6];
256255
}
257-
*/

src/rustc/middle/typeck/coherence.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ impl CoherenceChecker {
654654
module_def_id,
655655
None);
656656
for (*implementations).each |implementation| {
657+
debug!("coherence: adding impl from external crate: %s",
658+
ty::item_path_str(self.crate_context.tcx,
659+
implementation.did));
660+
657661
// Make sure we don't visit the same implementation
658662
// multiple times.
659663
match impls_seen.find(implementation.did) {

0 commit comments

Comments
 (0)