Update core::cell for isize/usize transition.

This commit is contained in:
Felix S. Klock II 2015-02-16 14:41:33 +01:00
parent a97588c34b
commit 480ea5ac55

View File

@ -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
//! {
@ -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![] }
//! }
//! ```
//!
@ -125,7 +125,7 @@
//!
//! struct RcBox<T> {
//! value: T,
//! refcount: Cell<uint>
//! refcount: Cell<usize>
//! }
//!
//! impl<T> Clone for Rc<T> {
@ -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;