Skip to content

Commit d7f97e3

Browse files
committed
Rename std::borrow to std::reference.
Fixes #11814
1 parent f84b729 commit d7f97e3

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/libextra/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use sync::{Mutex, RWLock};
4747
use std::cast;
4848
use std::sync::arc::UnsafeArc;
4949
use std::task;
50-
use std::borrow;
50+
use std::reference;
5151

5252
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5353
pub struct Condvar<'a> {
@@ -465,7 +465,7 @@ impl<T:Freeze + Send> RWArc<T> {
465465
// of this cast is removing the mutability.)
466466
let new_data = data;
467467
// Downgrade ensured the token belonged to us. Just a sanity check.
468-
assert!(borrow::ref_eq(&(*state).data, new_data));
468+
assert!(reference::ref_eq(&(*state).data, new_data));
469469
// Produce new token
470470
RWReadMode {
471471
data: new_data,

src/libextra/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020

21-
use std::borrow;
21+
use std::reference;
2222
use std::comm;
2323
use std::unstable::sync::Exclusive;
2424
use std::sync::arc::UnsafeArc;
@@ -634,7 +634,7 @@ impl RWLock {
634634
/// To be called inside of the write_downgrade block.
635635
pub fn downgrade<'a>(&self, token: RWLockWriteMode<'a>)
636636
-> RWLockReadMode<'a> {
637-
if !borrow::ref_eq(self, token.lock) {
637+
if !reference::ref_eq(self, token.lock) {
638638
fail!("Can't downgrade() with a different rwlock's write_mode!");
639639
}
640640
unsafe {

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub mod send_str;
123123
pub mod ptr;
124124
pub mod owned;
125125
pub mod managed;
126-
pub mod borrow;
126+
pub mod reference;
127127
pub mod rc;
128128
pub mod gc;
129129

File renamed without changes.

src/libstd/rt/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! to implement this.
1515
1616
use any::AnyOwnExt;
17-
use borrow;
17+
use reference;
1818
use cast;
1919
use cleanup;
2020
use clone::Clone;
@@ -287,7 +287,7 @@ impl Task {
287287

288288
impl Drop for Task {
289289
fn drop(&mut self) {
290-
rtdebug!("called drop for a task: {}", borrow::to_uint(self));
290+
rtdebug!("called drop for a task: {}", reference::to_uint(self));
291291
rtassert!(self.destroyed);
292292
}
293293
}

src/test/run-pass/borrowck-borrow-from-expr-block.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -10,7 +10,7 @@
1010

1111
#[feature(managed_boxes)];
1212

13-
use std::borrow;
13+
use std::reference;
1414
use std::ptr;
1515

1616
fn borrow(x: &int, f: |x: &int|) {
@@ -20,7 +20,7 @@ fn borrow(x: &int, f: |x: &int|) {
2020
fn test1(x: @~int) {
2121
borrow(&*(*x).clone(), |p| {
2222
let x_a = ptr::to_unsafe_ptr(&**x);
23-
assert!((x_a as uint) != borrow::to_uint(p));
23+
assert!((x_a as uint) != reference::to_uint(p));
2424
assert_eq!(unsafe{*x_a}, *p);
2525
})
2626
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::borrow;
11+
use std::reference;
1212

1313
pub fn main() {
1414
let x = 3;
15-
info!("&x={:x}", borrow::to_uint(&x));
15+
info!("&x={:x}", reference::to_uint(&x));
1616
}

0 commit comments

Comments
 (0)