Skip to content

Commit 04749ec

Browse files
author
joaoxsouls
committed
---
yaml --- r: 148879 b: refs/heads/try2 c: b69c81c h: refs/heads/master i: 148877: 34b365f 148875: ddc5f9f 148871: a5441fe 148863: 8e5fac5 v: v3
1 parent 473e71d commit 04749ec

File tree

15 files changed

+108
-124
lines changed

15 files changed

+108
-124
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: 2877928b22c239849a79b48d07139104ff144cd4
8+
refs/heads/try2: b69c81c9e0ad3ad1f38ba1874c3252d9c561b331
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate arena glob term semver
52+
TARGET_CRATES := std extra green rustuv native flate arena glob term
5353
HOST_CRATES := syntax rustc rustdoc
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustdoc rustc
@@ -66,7 +66,6 @@ DEPS_flate := std native:miniz
6666
DEPS_arena := std extra
6767
DEPS_glob := std
6868
DEPS_term := std
69-
DEPS_semver := std
7069

7170
TOOL_DEPS_compiletest := extra green rustuv
7271
TOOL_DEPS_rustdoc := rustdoc green rustuv

branches/try2/src/doc/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ li {list-style-type: none; }
4040
* [The `arena` allocation library](arena/index.html)
4141
* [The `flate` compression library](flate/index.html)
4242
* [The `glob` file path matching library](glob/index.html)
43-
* [The `semver` version collation library](semver/index.html)
4443
* [The `term` terminal-handling library](term/index.html)
4544

4645
# Tooling

branches/try2/src/doc/rust.md

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,9 +2426,9 @@ before the expression they apply to.
24262426
: Logical negation. On the boolean type, this flips between `true` and
24272427
`false`. On integer types, this inverts the individual bits in the
24282428
two's complement representation of the value.
2429-
`@` and `~`
2429+
`~`
24302430
: [Boxing](#pointer-types) operators. Allocate a box to hold the value they are applied to,
2431-
and store the value in it. `@` creates a managed box, whereas `~` creates an owned box.
2431+
and store the value in it. `~` creates an owned box.
24322432
`&`
24332433
: Borrow operator. Returns a reference, pointing to its operand.
24342434
The operand of a borrow is statically proven to outlive the resulting pointer.
@@ -3203,16 +3203,6 @@ All pointers in Rust are explicit first-class values.
32033203
They can be copied, stored into data structures, and returned from functions.
32043204
There are four varieties of pointer in Rust:
32053205

3206-
Managed pointers (`@`)
3207-
: These point to managed heap allocations (or "boxes") in the task-local, managed heap.
3208-
Managed pointers are written `@content`,
3209-
for example `@int` means a managed pointer to a managed box containing an integer.
3210-
Copying a managed pointer is a "shallow" operation:
3211-
it involves only copying the pointer itself
3212-
(as well as any reference-count or GC-barriers required by the managed heap).
3213-
Dropping a managed pointer does not necessarily release the box it points to;
3214-
the lifecycles of managed boxes are subject to an unspecified garbage collection algorithm.
3215-
32163206
Owning pointers (`~`)
32173207
: These point to owned heap allocations (or "boxes") in the shared, inter-task heap.
32183208
Each owned box has a single owning pointer; pointer and pointee retain a 1:1 relationship at all times.
@@ -3521,63 +3511,28 @@ state. Subsequent statements within a function may or may not initialize the
35213511
local variables. Local variables can be used only after they have been
35223512
initialized; this is enforced by the compiler.
35233513

3524-
### Memory boxes
3525-
3526-
A _box_ is a reference to a heap allocation holding another value. There
3527-
are two kinds of boxes: *managed boxes* and *owned boxes*.
3528-
3529-
A _managed box_ type or value is constructed by the prefix *at* sigil `@`.
3530-
3531-
An _owned box_ type or value is constructed by the prefix *tilde* sigil `~`.
3514+
### Owned boxes
35323515

3533-
Multiple managed box values can point to the same heap allocation; copying a
3534-
managed box value makes a shallow copy of the pointer (optionally incrementing
3535-
a reference count, if the managed box is implemented through
3536-
reference-counting).
3516+
An _owned box_ is a reference to a heap allocation holding another value, which is constructed
3517+
by the prefix *tilde* sigil `~`
35373518

3538-
Owned box values exist in 1:1 correspondence with their heap allocation.
3539-
3540-
An example of constructing one managed box type and value, and one owned box
3541-
type and value:
3519+
An example of an owned box type and value:
35423520

35433521
~~~~
3544-
let x: @int = @10;
35453522
let x: ~int = ~10;
35463523
~~~~
35473524

3548-
Some operations (such as field selection) implicitly dereference boxes. An
3549-
example of an _implicit dereference_ operation performed on box values:
3525+
Owned box values exist in 1:1 correspondence with their heap allocation
3526+
copying an owned box value makes a shallow copy of the pointer
3527+
Rust will consider a shallow copy of an owned box to move ownership of the value. After a value has been moved, the source location cannot be used unless it is reinitialized.
35503528

35513529
~~~~
3552-
struct Foo { y: int }
3553-
let x = @Foo{y: 10};
3554-
assert!(x.y == 10);
3555-
~~~~
3556-
3557-
Other operations act on box values as single-word-sized address values. For
3558-
these operations, to access the value held in the box requires an explicit
3559-
dereference of the box value. Explicitly dereferencing a box is indicated with
3560-
the unary *star* operator `*`. Examples of such _explicit dereference_
3561-
operations are:
3562-
3563-
* copying box values (`x = y`)
3564-
* passing box values to functions (`f(x,y)`)
3565-
3566-
An example of an explicit-dereference operation performed on box values:
3567-
3530+
let x: ~int = ~10;
3531+
let y = x;
3532+
// attempting to use `x` will result in an error here
35683533
~~~~
3569-
fn takes_boxed(b: @int) {
3570-
}
35713534

3572-
fn takes_unboxed(b: int) {
3573-
}
35743535

3575-
fn main() {
3576-
let x: @int = @10;
3577-
takes_boxed(x);
3578-
takes_unboxed(*x);
3579-
}
3580-
~~~~
35813536

35823537
## Tasks
35833538

branches/try2/src/libextra/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ pub mod rational;
8383
#[path="num/complex.rs"]
8484
pub mod complex;
8585
pub mod stats;
86+
pub mod semver;
8687
pub mod hex;
8788
pub mod uuid;
8889

branches/try2/src/libsemver/lib.rs renamed to branches/try2/src/libextra/semver.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
//! An example version number with all five components is
2929
//! `0.8.1-rc.3.0+20130922.linux`.
3030
31-
#[crate_id = "semver#0.10-pre"];
32-
#[crate_type = "rlib"];
33-
#[crate_type = "dylib"];
34-
#[license = "MIT/ASL2"];
35-
3631
use std::char;
3732
use std::cmp;
3833
use std::option::{Option, Some, None};

branches/try2/src/libextra/sync/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
use std::cast;
2121
use std::comm;
22-
use std::kinds::marker;
2322
use std::sync::arc::UnsafeArc;
2423
use std::sync::atomics;
2524
use std::unstable::finally::Finally;
2625
use std::util;
26+
use std::util::NonCopyable;
2727

2828
use arc::MutexArc;
2929

@@ -191,7 +191,7 @@ pub struct Condvar<'a> {
191191
// See the comment in write_cond for more detail.
192192
priv order: ReacquireOrderLock<'a>,
193193
// Make sure condvars are non-copyable.
194-
priv nopod: marker::NoPod,
194+
priv token: util::NonCopyable,
195195
}
196196

197197
impl<'a> Condvar<'a> {
@@ -334,7 +334,7 @@ impl Sem<~[WaitQueue]> {
334334
blk(&Condvar {
335335
sem: self,
336336
order: Nothing,
337-
nopod: marker::NoPod
337+
token: NonCopyable
338338
})
339339
})
340340
}
@@ -574,7 +574,7 @@ impl RWLock {
574574
(&self.order_lock).release();
575575
let opt_lock = Just(&self.order_lock);
576576
blk(&Condvar { sem: cond.sem, order: opt_lock,
577-
nopod: marker::NoPod })
577+
token: NonCopyable })
578578
})
579579
}
580580

@@ -609,7 +609,7 @@ impl RWLock {
609609
(&self.access_lock).acquire();
610610
(&self.order_lock).release();
611611
(|| {
612-
blk(RWLockWriteMode { lock: self, nopod: marker::NoPod })
612+
blk(RWLockWriteMode { lock: self, token: NonCopyable })
613613
}).finally(|| {
614614
let writer_or_last_reader;
615615
// Check if we're releasing from read mode or from write mode.
@@ -662,16 +662,16 @@ impl RWLock {
662662
(&self.access_lock).release();
663663
}
664664
}
665-
RWLockReadMode { lock: token.lock, nopod: marker::NoPod }
665+
RWLockReadMode { lock: token.lock, token: NonCopyable }
666666
}
667667
}
668668

669669
/// The "write permission" token used for rwlock.write_downgrade().
670670
671-
pub struct RWLockWriteMode<'a> { priv lock: &'a RWLock, priv nopod: marker::NoPod }
671+
pub struct RWLockWriteMode<'a> { priv lock: &'a RWLock, priv token: NonCopyable }
672672
/// The "read permission" token used for rwlock.write_downgrade().
673673
pub struct RWLockReadMode<'a> { priv lock: &'a RWLock,
674-
priv nopod: marker::NoPod }
674+
priv token: NonCopyable }
675675

676676
impl<'a> RWLockWriteMode<'a> {
677677
/// Access the pre-downgrade rwlock in write mode.
@@ -682,7 +682,7 @@ impl<'a> RWLockWriteMode<'a> {
682682
// access lock. See comment in RWLock::write_cond for why.
683683
blk(&Condvar { sem: &self.lock.access_lock,
684684
order: Just(&self.lock.order_lock),
685-
nopod: marker::NoPod })
685+
token: NonCopyable })
686686
}
687687
}
688688

branches/try2/src/libstd/cell.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
1313
use prelude::*;
1414
use cast;
15-
use kinds::{marker, Pod};
15+
use util::NonCopyable;
16+
use kinds::{marker,Pod};
1617

1718
/// A mutable memory location that admits only `Pod` data.
1819
pub struct Cell<T> {
@@ -56,9 +57,9 @@ impl<T:Pod> Clone for Cell<T> {
5657
pub struct RefCell<T> {
5758
priv value: T,
5859
priv borrow: BorrowFlag,
60+
priv nc: NonCopyable,
5961
priv marker1: marker::InvariantType<T>,
6062
priv marker2: marker::NoFreeze,
61-
priv marker3: marker::NoPod,
6263
}
6364

6465
// Values [1, MAX-1] represent the number of `Ref` active
@@ -73,9 +74,9 @@ impl<T> RefCell<T> {
7374
RefCell {
7475
marker1: marker::InvariantType::<T>,
7576
marker2: marker::NoFreeze,
76-
marker3: marker::NoPod,
7777
value: value,
7878
borrow: UNUSED,
79+
nc: NonCopyable
7980
}
8081
}
8182

branches/try2/src/libstd/option.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ mod tests {
481481
use iter::range;
482482
use str::StrSlice;
483483
use util;
484-
use kinds::marker;
485484
use vec::ImmutableVector;
486485

487486
#[test]
@@ -552,7 +551,7 @@ mod tests {
552551

553552
#[test] #[should_fail]
554553
fn test_option_too_much_dance() {
555-
let mut y = Some(marker::NoPod);
554+
let mut y = Some(util::NonCopyable);
556555
let _y2 = y.take_unwrap();
557556
let _y3 = y.take_unwrap();
558557
}

0 commit comments

Comments
 (0)