Skip to content

Commit

Permalink
Update core::cell for isize/usize transition.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Feb 16, 2015
1 parent a97588c commit 480ea5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libcore/cell.rs
Expand Up @@ -78,12 +78,12 @@
//! use std::cell::RefCell;
//!
//! struct Graph {
//! edges: Vec<(uint, uint)>,
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
//! edges: Vec<(i32, i32)>,
//! span_tree_cache: RefCell<Option<Vec<(i32, i32)>>>
//! }
//!
//! impl Graph {
//! fn minimum_spanning_tree(&self) -> Vec<(uint, uint)> {
//! fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> {
//! // Create a new scope to contain the lifetime of the
//! // dynamic borrow
//! {
Expand All @@ -104,7 +104,7 @@
//! // This is the major hazard of using `RefCell`.
//! self.minimum_spanning_tree()
//! }
//! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec![] }
//! # fn calc_span_tree(&self) -> Vec<(i32, i32)> { vec![] }
//! }
//! ```
//!
Expand All @@ -125,7 +125,7 @@
//!
//! struct RcBox<T> {
//! value: T,
//! refcount: Cell<uint>
//! refcount: Cell<usize>
//! }
//!
//! impl<T> Clone for Rc<T> {
Expand Down Expand Up @@ -279,8 +279,8 @@ pub enum BorrowState {
}

// Values [1, MAX-1] represent the number of `Ref` active
// (will not outgrow its range since `uint` is the size of the address space)
type BorrowFlag = uint;
// (will not outgrow its range since `usize` is the size of the address space)
type BorrowFlag = usize;
const UNUSED: BorrowFlag = 0;
const WRITING: BorrowFlag = -1;

Expand Down

0 comments on commit 480ea5a

Please sign in to comment.