Skip to content

Commit 6d489dc

Browse files
---
yaml --- r: 116687 b: refs/heads/snap-stage3 c: 0a98a4e h: refs/heads/master i: 116685: 99b8283 116683: 248424a 116679: 7a7d185 116671: 9ee6fce v: v3
1 parent 99e2a3a commit 6d489dc

File tree

9 files changed

+721
-182
lines changed

9 files changed

+721
-182
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: bee4e6adac17f87b1cdc26ab69f8c0f5d82575a3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7c7f4b0e0baac739c12080dcbf83ed04c11e9a89
4+
refs/heads/snap-stage3: 0a98a4e422bd2d80ee7910b00c0286f1eefde9c5
55
refs/heads/try: 009d898a9422ac04c1aa60c0e9aff3abc5fa4672
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/doc/guide-lifetimes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ invalidate the pointer `owner_age`.
275275

276276
# Borrowing and enums
277277

278-
The previous example showed that the type system forbids any mutations
279-
of owned boxed values while they are being borrowed. In general, the type
280-
system also forbids borrowing a value as mutable if it is already being
281-
borrowed - either as a mutable reference or an immutable one. This restriction
278+
The previous example showed that the type system forbids any borrowing
279+
of owned boxes found in aliasable, mutable memory. This restriction
282280
prevents pointers from pointing into freed memory. There is one other
283281
case where the compiler must be very careful to ensure that pointers
284282
remain valid: pointers into the interior of an `enum`.

branches/snap-stage3/src/libcore/cell.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ impl<'b, T> DerefMut<T> for RefMut<'b, T> {
385385
#[cfg(test)]
386386
mod test {
387387
use super::*;
388-
use mem::drop;
389388

390389
#[test]
391390
fn smoketest_cell() {
@@ -413,22 +412,6 @@ mod test {
413412
assert!(format!("{}", x).as_slice().contains(x.get()));
414413
}
415414

416-
#[test]
417-
fn ref_and_refmut_have_sensible_show() {
418-
use str::StrSlice;
419-
use realstd::str::Str;
420-
421-
let refcell = RefCell::new("foo");
422-
423-
let refcell_refmut = refcell.borrow_mut();
424-
assert!(format!("{}", refcell_refmut).as_slice().contains("foo"));
425-
drop(refcell_refmut);
426-
427-
let refcell_ref = refcell.borrow();
428-
assert!(format!("{}", refcell_ref).as_slice().contains("foo"));
429-
drop(refcell_ref);
430-
}
431-
432415
#[test]
433416
fn double_imm_borrow() {
434417
let x = RefCell::new(0);

branches/snap-stage3/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
#![allow(unused_variable)]
1414

1515
use any;
16-
use cell::{Cell, Ref, RefMut};
16+
use cell::Cell;
1717
use char::Char;
1818
use collections::Collection;
1919
use iter::{Iterator, range};
2020
use kinds::Copy;
2121
use mem;
2222
use option::{Option, Some, None};
23-
use ops::Deref;
2423
use result::{Ok, Err};
2524
use result;
2625
use slice::{Vector, ImmutableVector};
@@ -841,17 +840,5 @@ impl<T: Copy + Show> Show for Cell<T> {
841840
}
842841
}
843842

844-
impl<'b, T: Show> Show for Ref<'b, T> {
845-
fn fmt(&self, f: &mut Formatter) -> Result {
846-
(**self).fmt(f)
847-
}
848-
}
849-
850-
impl<'b, T: Show> Show for RefMut<'b, T> {
851-
fn fmt(&self, f: &mut Formatter) -> Result {
852-
(*(self.deref())).fmt(f)
853-
}
854-
}
855-
856843
// If you expected tests to be here, look instead at the run-pass/ifmt.rs test,
857844
// it's a lot easier than creating all of the rt::Piece structures here.

0 commit comments

Comments
 (0)