From 76f0b1ad1fb314199b6db61df753d6757dee3b77 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 20 Mar 2014 22:06:51 -0700 Subject: [PATCH] test: Fix fallout of removing get() --- src/test/auxiliary/cci_nested_lib.rs | 4 ++-- src/test/compile-fail/issue-7013.rs | 2 +- src/test/compile-fail/mut-cant-alias.rs | 4 ++-- src/test/compile-fail/mut-ptr-cant-outlive-ref.rs | 2 +- src/test/run-pass/format-ref-cell.rs | 2 +- src/test/run-pass/trait-cast.rs | 6 +++--- src/test/run-pass/uniq-cc-generic.rs | 2 +- src/test/run-pass/uniq-cc.rs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index a9be1e62195..146ed261811 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -24,7 +24,7 @@ pub struct alist { pub fn alist_add(lst: &alist, k: A, v: B) { let mut data = lst.data.borrow_mut(); - data.get().push(Entry{key:k, value:v}); + (*data).push(Entry{key:k, value:v}); } pub fn alist_get B { let eq_fn = lst.eq_fn; let data = lst.data.borrow(); - for entry in data.get().iter() { + for entry in (*data).iter() { if eq_fn(entry.key.clone(), k.clone()) { return entry.value.clone(); } diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index 800549b7737..a3354e230c6 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -42,5 +42,5 @@ fn main() let w = v.clone(); let b = v.deref(); let mut b = b.borrow_mut(); - b.get().v.set(w.clone()); + b.v.set(w.clone()); } diff --git a/src/test/compile-fail/mut-cant-alias.rs b/src/test/compile-fail/mut-cant-alias.rs index e3e2ace71ad..99d7258477a 100644 --- a/src/test/compile-fail/mut-cant-alias.rs +++ b/src/test/compile-fail/mut-cant-alias.rs @@ -13,6 +13,6 @@ use std::cell::RefCell; fn main() { let m = RefCell::new(0); let mut b = m.borrow_mut(); - let b1 = b.get(); - let b2 = b.get(); //~ ERROR cannot borrow + let b1 = &mut *b; + let b2 = &mut *b; //~ ERROR cannot borrow } diff --git a/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs b/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs index 2e5cf1b504b..8e968d90a2f 100644 --- a/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs +++ b/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs @@ -15,6 +15,6 @@ fn main() { let p; { let b = m.borrow(); - p = b.get(); //~ ERROR `b` does not live long enough + p = &*b; //~ ERROR `b` does not live long enough } } diff --git a/src/test/run-pass/format-ref-cell.rs b/src/test/run-pass/format-ref-cell.rs index 6428d496382..0926e640bc1 100644 --- a/src/test/run-pass/format-ref-cell.rs +++ b/src/test/run-pass/format-ref-cell.rs @@ -13,6 +13,6 @@ use std::cell::RefCell; pub fn main() { let name = RefCell::new("rust"); let what = RefCell::new("rocks"); - let msg = format!("{name:?} {:?}", what.borrow().get(), name=name.borrow().get()); + let msg = format!("{name:?} {:?}", &*what.borrow(), name=&*name.borrow()); assert_eq!(msg, ~"&\"rust\" &\"rocks\""); } diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs index 339afb47fa6..490c77d98cd 100644 --- a/src/test/run-pass/trait-cast.rs +++ b/src/test/run-pass/trait-cast.rs @@ -42,8 +42,8 @@ impl to_str for Tree { fn to_str_(&self) -> ~str { let Tree(t) = *self; let this = t.borrow(); - let (l, r) = (this.get().left, this.get().right); - let val = &this.get().val; + let (l, r) = (this.left, this.right); + let val = &this.val; format!("[{}, {}, {}]", val.to_str_(), l.to_str_(), r.to_str_()) } } @@ -64,6 +64,6 @@ pub fn main() { { let Tree(t1_) = t1; let mut t1 = t1_.borrow_mut(); - t1.get().left = Some(t2); // create cycle + t1.left = Some(t2); // create cycle } } diff --git a/src/test/run-pass/uniq-cc-generic.rs b/src/test/run-pass/uniq-cc-generic.rs index 9efa6c1b964..41e921ff6e4 100644 --- a/src/test/run-pass/uniq-cc-generic.rs +++ b/src/test/run-pass/uniq-cc-generic.rs @@ -38,6 +38,6 @@ pub fn main() { let v = empty_pointy(); { let mut vb = v.borrow_mut(); - vb.get().a = p(v); + vb.a = p(v); } } diff --git a/src/test/run-pass/uniq-cc.rs b/src/test/run-pass/uniq-cc.rs index 23a27dece46..57fc9ac6773 100644 --- a/src/test/run-pass/uniq-cc.rs +++ b/src/test/run-pass/uniq-cc.rs @@ -35,6 +35,6 @@ pub fn main() { let v = empty_pointy(); { let mut vb = v.borrow_mut(); - vb.get().a = p(v); + vb.a = p(v); } }