Skip to content

Commit 76f0b1a

Browse files
committed
test: Fix fallout of removing get()
1 parent 6a7fd8c commit 76f0b1a

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

src/test/auxiliary/cci_nested_lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct alist<A,B> {
2424

2525
pub fn alist_add<A:'static,B:'static>(lst: &alist<A,B>, k: A, v: B) {
2626
let mut data = lst.data.borrow_mut();
27-
data.get().push(Entry{key:k, value:v});
27+
(*data).push(Entry{key:k, value:v});
2828
}
2929

3030
pub fn alist_get<A:Clone + 'static,
@@ -34,7 +34,7 @@ pub fn alist_get<A:Clone + 'static,
3434
-> B {
3535
let eq_fn = lst.eq_fn;
3636
let data = lst.data.borrow();
37-
for entry in data.get().iter() {
37+
for entry in (*data).iter() {
3838
if eq_fn(entry.key.clone(), k.clone()) {
3939
return entry.value.clone();
4040
}

src/test/compile-fail/issue-7013.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ fn main()
4242
let w = v.clone();
4343
let b = v.deref();
4444
let mut b = b.borrow_mut();
45-
b.get().v.set(w.clone());
45+
b.v.set(w.clone());
4646
}

src/test/compile-fail/mut-cant-alias.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ use std::cell::RefCell;
1313
fn main() {
1414
let m = RefCell::new(0);
1515
let mut b = m.borrow_mut();
16-
let b1 = b.get();
17-
let b2 = b.get(); //~ ERROR cannot borrow
16+
let b1 = &mut *b;
17+
let b2 = &mut *b; //~ ERROR cannot borrow
1818
}

src/test/compile-fail/mut-ptr-cant-outlive-ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fn main() {
1515
let p;
1616
{
1717
let b = m.borrow();
18-
p = b.get(); //~ ERROR `b` does not live long enough
18+
p = &*b; //~ ERROR `b` does not live long enough
1919
}
2020
}

src/test/run-pass/format-ref-cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ use std::cell::RefCell;
1313
pub fn main() {
1414
let name = RefCell::new("rust");
1515
let what = RefCell::new("rocks");
16-
let msg = format!("{name:?} {:?}", what.borrow().get(), name=name.borrow().get());
16+
let msg = format!("{name:?} {:?}", &*what.borrow(), name=&*name.borrow());
1717
assert_eq!(msg, ~"&\"rust\" &\"rocks\"");
1818
}

src/test/run-pass/trait-cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ impl to_str for Tree {
4242
fn to_str_(&self) -> ~str {
4343
let Tree(t) = *self;
4444
let this = t.borrow();
45-
let (l, r) = (this.get().left, this.get().right);
46-
let val = &this.get().val;
45+
let (l, r) = (this.left, this.right);
46+
let val = &this.val;
4747
format!("[{}, {}, {}]", val.to_str_(), l.to_str_(), r.to_str_())
4848
}
4949
}
@@ -64,6 +64,6 @@ pub fn main() {
6464
{
6565
let Tree(t1_) = t1;
6666
let mut t1 = t1_.borrow_mut();
67-
t1.get().left = Some(t2); // create cycle
67+
t1.left = Some(t2); // create cycle
6868
}
6969
}

src/test/run-pass/uniq-cc-generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ pub fn main() {
3838
let v = empty_pointy();
3939
{
4040
let mut vb = v.borrow_mut();
41-
vb.get().a = p(v);
41+
vb.a = p(v);
4242
}
4343
}

src/test/run-pass/uniq-cc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ pub fn main() {
3535
let v = empty_pointy();
3636
{
3737
let mut vb = v.borrow_mut();
38-
vb.get().a = p(v);
38+
vb.a = p(v);
3939
}
4040
}

0 commit comments

Comments
 (0)