Skip to content

Commit e629079

Browse files
committed
---
yaml --- r: 151391 b: refs/heads/try2 c: 1a989d6 h: refs/heads/master i: 151389: 2324f82 151387: f6af7c6 151383: 0c10b17 151375: 49ce33f 151359: b27e23f v: v3
1 parent b7bcd80 commit e629079

File tree

2 files changed

+40
-37
lines changed

2 files changed

+40
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 54b81997f367e8963d722c5e23bd7a877d0273cd
8+
refs/heads/try2: 1a989d67697fe33e51e7209511e89ba7faaba21d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/clone.rs

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -126,46 +126,49 @@ extern_fn_clone!(A, B, C, D, E, F)
126126
extern_fn_clone!(A, B, C, D, E, F, G)
127127
extern_fn_clone!(A, B, C, D, E, F, G, H)
128128

129-
#[test]
130-
fn test_owned_clone() {
131-
let a = box 5i;
132-
let b: Box<int> = a.clone();
133-
assert_eq!(a, b);
134-
}
129+
#[cfg(test)]
130+
mod test {
131+
#[test]
132+
fn test_owned_clone() {
133+
let a = box 5i;
134+
let b: Box<int> = a.clone();
135+
assert_eq!(a, b);
136+
}
135137

136-
#[test]
137-
fn test_managed_clone() {
138-
let a = @5i;
139-
let b: @int = a.clone();
140-
assert_eq!(a, b);
141-
}
138+
#[test]
139+
fn test_managed_clone() {
140+
let a = @5i;
141+
let b: @int = a.clone();
142+
assert_eq!(a, b);
143+
}
142144

143-
#[test]
144-
fn test_borrowed_clone() {
145-
let x = 5i;
146-
let y: &int = &x;
147-
let z: &int = (&y).clone();
148-
assert_eq!(*z, 5);
149-
}
145+
#[test]
146+
fn test_borrowed_clone() {
147+
let x = 5i;
148+
let y: &int = &x;
149+
let z: &int = (&y).clone();
150+
assert_eq!(*z, 5);
151+
}
150152

151-
#[test]
152-
fn test_clone_from() {
153-
let a = box 5;
154-
let mut b = box 10;
155-
b.clone_from(&a);
156-
assert_eq!(*b, 5);
157-
}
153+
#[test]
154+
fn test_clone_from() {
155+
let a = ~5;
156+
let mut b = ~10;
157+
b.clone_from(&a);
158+
assert_eq!(*b, 5);
159+
}
158160

159-
#[test]
160-
fn test_extern_fn_clone() {
161-
trait Empty {}
162-
impl Empty for int {}
161+
#[test]
162+
fn test_extern_fn_clone() {
163+
trait Empty {}
164+
impl Empty for int {}
163165

164-
fn test_fn_a() -> f64 { 1.0 }
165-
fn test_fn_b<T: Empty>(x: T) -> T { x }
166-
fn test_fn_c(_: int, _: f64, _: ~[int], _: int, _: int, _: int) {}
166+
fn test_fn_a() -> f64 { 1.0 }
167+
fn test_fn_b<T: Empty>(x: T) -> T { x }
168+
fn test_fn_c(_: int, _: f64, _: ~[int], _: int, _: int, _: int) {}
167169

168-
let _ = test_fn_a.clone();
169-
let _ = test_fn_b::<int>.clone();
170-
let _ = test_fn_c.clone();
170+
let _ = test_fn_a.clone();
171+
let _ = test_fn_b::<int>.clone();
172+
let _ = test_fn_c.clone();
173+
}
171174
}

0 commit comments

Comments
 (0)