Skip to content

Commit

Permalink
Make impl of Add for @[] public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikomatsakis committed Sep 26, 2012
1 parent 264e1b2 commit 8b13912
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libcore/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, +t: T) -> @[T] {
}

#[cfg(notest)]
mod traits {
pub mod traits {
#[legacy_exports];
impl<T: Copy> @[T] : Add<&[const T],@[T]> {
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
#[inline(always)]
pure fn add(rhs: & &[const T]) -> @[T] {
append(self, (*rhs))
Expand Down Expand Up @@ -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];
}
*/
4 changes: 4 additions & 0 deletions src/rustc/middle/typeck/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b13912

Please sign in to comment.