diff --git a/src/libcore/core.rc b/src/libcore/core.rc index e2c43bf81219..4cc6ff8a259e 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -39,6 +39,9 @@ Implicitly, all crates behave as if they included the following prologue: #[legacy_modes]; #[legacy_exports]; +#[warn(deprecated_mode)]; +#[warn(deprecated_pattern)]; + #[warn(vecs_implicitly_copyable)]; #[deny(non_camel_case_types)]; diff --git a/src/libcore/tuple.rs b/src/libcore/tuple.rs index 50f55383167f..43df1bc4bbcd 100644 --- a/src/libcore/tuple.rs +++ b/src/libcore/tuple.rs @@ -78,14 +78,10 @@ impl (~[A], ~[B]): ExtendedTupleOps { impl (A, B) : Eq { pure fn eq(other: &(A, B)) -> bool { - // XXX: This would be a lot less wordy with ref bindings, but I don't - // trust that they work yet. match self { - (self_a, self_b) => { - match (*other) { - (ref other_a, ref other_b) => { - self_a.eq(other_a) && self_b.eq(other_b) - } + (ref self_a, ref self_b) => match other { + &(ref other_a, ref other_b) => { + (*self_a).eq(other_a) && (*self_b).eq(other_b) } } } @@ -115,16 +111,11 @@ impl (A, B) : Ord { impl (A, B, C) : Eq { pure fn eq(other: &(A, B, C)) -> bool { - // XXX: This would be a lot less wordy with ref bindings, but I don't - // trust that they work yet. match self { - (self_a, self_b, self_c) => { - match (*other) { - (ref other_a, ref other_b, ref other_c) => { - self_a.eq(other_a) && - self_b.eq(other_b) && - self_c.eq(other_c) - } + (ref self_a, ref self_b, ref self_c) => match other { + &(ref other_a, ref other_b, ref other_c) => { + (*self_a).eq(other_a) && (*self_b).eq(other_b) + && (*self_c).eq(other_c) } } }