Skip to content

Commit 1d3ab9d

Browse files
---
yaml --- r: 152479 b: refs/heads/try2 c: 0a98a4e h: refs/heads/master i: 152477: 3f64b2d 152475: 78da99c 152471: a535b70 152463: 983cc2f 152447: 0489d45 v: v3
1 parent 043ca3f commit 1d3ab9d

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7c7f4b0e0baac739c12080dcbf83ed04c11e9a89
8+
refs/heads/try2: 0a98a4e422bd2d80ee7910b00c0286f1eefde9c5
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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/try2/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)