Skip to content

Commit 242b0cc

Browse files
committed
---
yaml --- r: 156227 b: refs/heads/snap-stage3 c: 5653b4d h: refs/heads/master i: 156225: 45664e5 156223: 6703f27 v: v3
1 parent 4e99a2a commit 242b0cc

File tree

279 files changed

+4170
-5914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+4170
-5914
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: c29a7520e7fb4a5b4d4eccfc594e05793ef6688d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1add4dedc131d5f98d82feafe80d92ed1f3f6d49
4+
refs/heads/snap-stage3: 5653b4da17446dd2b4862c03a434b76c3e30946c
55
refs/heads/try: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/man/rustc.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTC "1" "March 2014" "rustc 0.13.0" "User Commands"
1+
.TH RUSTC "1" "March 2014" "rustc 0.12.0" "User Commands"
22
.SH NAME
33
rustc \- The Rust compiler
44
.SH SYNOPSIS
@@ -125,8 +125,8 @@ is invoked.
125125
Selects a target processor. If the value is 'help', then a list of available
126126
CPUs is printed.
127127
.TP
128-
\fBtarget-feature\fR='+feature1,-feature2'
129-
A comma-separated list of features to enable or disable for the target. A
128+
\fBtarget-feature\fR='+feature1 -feature2'
129+
A space-separated list of features to enable or disable for the target. A
130130
preceding '+' enables a feature while a preceding '-' disables it. Available
131131
features can be discovered through target-cpu=help.
132132
.TP

branches/snap-stage3/man/rustdoc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTDOC "1" "March 2014" "rustdoc 0.13.0" "User Commands"
1+
.TH RUSTDOC "1" "March 2014" "rustdoc 0.12.0" "User Commands"
22
.SH NAME
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS

branches/snap-stage3/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=0.13.0
16+
CFG_RELEASE_NUM=0.12.0
1717

1818
CFG_FILENAME_EXTRA=4e7c5e5c
1919

branches/snap-stage3/src/doc/reference.md

Lines changed: 19 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,87 +1383,44 @@ a = Cat { name: "Spotty".to_string(), weight: 2.7 };
13831383
In this example, `Cat` is a _struct-like enum variant_,
13841384
whereas `Dog` is simply called an enum variant.
13851385

1386-
### Constant items
1386+
### Static items
13871387

13881388
```{.ebnf .gram}
1389-
const_item : "const" ident ':' type '=' expr ';' ;
1389+
static_item : "static" ident ':' type '=' expr ';' ;
13901390
```
13911391

1392-
A *constant item* is a named _constant value_ which is not associated with a
1393-
specific memory location in the program. Constants are essentially inlined
1394-
wherever they are used, meaning that they are copied directly into the relevant
1395-
context when used. References to the same constant are not necessarily
1396-
guaranteed to refer to the same memory address.
1397-
1398-
Constant values must not have destructors, and otherwise permit most forms of
1399-
data. Constants may refer to the address of other constants, in which case the
1400-
address will have the `static` lifetime. The compiler is, however, still at
1401-
liberty to translate the constant many times, so the address referred to may not
1402-
be stable.
1392+
A *static item* is a named _constant value_ stored in the global data section
1393+
of a crate. Immutable static items are stored in the read-only data section.
1394+
The constant value bound to a static item is, like all constant values,
1395+
evaluated at compile time. Static items have the `static` lifetime, which
1396+
outlives all other lifetimes in a Rust program. Only values stored in the
1397+
global data section (such as string constants and static items) can have the
1398+
`static` lifetime; dynamically constructed values cannot safely be assigned the
1399+
`static` lifetime. Static items are declared with the `static` keyword. A
1400+
static item must have a _constant expression_ giving its definition.
14031401

1404-
Constants must be explicitly typed. The type may be `bool`, `char`, a number, or
1405-
a type derived from those primitive types. The derived types are references with
1406-
the `static` lifetime, fixed-size arrays, tuples, enum variants, and structs.
1402+
Static items must be explicitly typed. The type may be `bool`, `char`,
1403+
a number, or a type derived from those primitive types. The derived types are
1404+
references with the `static` lifetime, fixed-size arrays, tuples, and structs.
14071405

14081406
```
1409-
const BIT1: uint = 1 << 0;
1410-
const BIT2: uint = 1 << 1;
1407+
static BIT1: uint = 1 << 0;
1408+
static BIT2: uint = 1 << 1;
14111409
1412-
const BITS: [uint, ..2] = [BIT1, BIT2];
1413-
const STRING: &'static str = "bitstring";
1410+
static BITS: [uint, ..2] = [BIT1, BIT2];
1411+
static STRING: &'static str = "bitstring";
14141412
14151413
struct BitsNStrings<'a> {
14161414
mybits: [uint, ..2],
14171415
mystring: &'a str
14181416
}
14191417
1420-
const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
1418+
static BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
14211419
mybits: BITS,
14221420
mystring: STRING
14231421
};
14241422
```
14251423

1426-
### Static items
1427-
1428-
```{.ebnf .gram}
1429-
static_item : "static" ident ':' type '=' expr ';' ;
1430-
```
1431-
1432-
A *static item* is similar to a *constant*, except that it represents a precise
1433-
memory location in the program. A static is never "inlined" at the usage site,
1434-
and all references to it refer to the same memory location. Static items have
1435-
the `static` lifetime, which outlives all other lifetimes in a Rust program.
1436-
Static items may be placed in read-only memory if they do not contain any
1437-
interior mutability.
1438-
1439-
Statics may contain interior mutability through the `UnsafeCell` language item.
1440-
All access to a static is safe, but there are a number of restrictions on
1441-
statics:
1442-
1443-
* Statics may not contain any destructors.
1444-
* The types of static values must ascribe to `Sync` to allow threadsafe access.
1445-
* Statics may not refer to other statics by value, only by reference.
1446-
* Constants cannot refer to statics.
1447-
1448-
Constants should in general be preferred over statics, unless large amounts of
1449-
data are being stored, or single-address and mutability properties are required.
1450-
1451-
```
1452-
use std::sync::atomic;
1453-
1454-
// Note that INIT_ATOMIC_UINT is a *const*, but it may be used to initialize a
1455-
// static. This static can be modified, so it is not placed in read-only memory.
1456-
static COUNTER: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
1457-
1458-
// This table is a candidate to be placed in read-only memory.
1459-
static TABLE: &'static [uint] = &[1, 2, 3, /* ... */];
1460-
1461-
for slot in TABLE.iter() {
1462-
println!("{}", slot);
1463-
}
1464-
COUNTER.fetch_add(1, atomic::SeqCst);
1465-
```
1466-
14671424
#### Mutable statics
14681425

14691426
If a static item is declared with the `mut` keyword, then it is allowed to
@@ -1498,9 +1455,6 @@ unsafe fn bump_levels_unsafe2() -> uint {
14981455
}
14991456
```
15001457

1501-
Mutable statics have the same restrictions as normal statics, except that the
1502-
type of the value is not required to ascribe to `Sync`.
1503-
15041458
### Traits
15051459

15061460
A _trait_ describes a set of method types.

branches/snap-stage3/src/etc/kate/rust.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
88
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
99
]>
10-
<language name="Rust" version="0.13.0" kateversion="2.4" section="Sources" extensions="*.rs" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.12.0" kateversion="2.4" section="Sources" extensions="*.rs" mimetype="text/x-rust" priority="15">
1111
<highlighting>
1212
<list name="fn">
1313
<item> fn </item>

branches/snap-stage3/src/etc/unicode.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,14 @@ def emit_property_module(f, mod, tbl, emit_fn):
333333
def emit_regex_module(f, cats, w_data):
334334
f.write("pub mod regex {\n")
335335
regex_class = "&'static [(char, char)]"
336-
class_table = "&'static [(&'static str, &'static %s)]" % regex_class
336+
class_table = "&'static [(&'static str, %s)]" % regex_class
337337

338338
emit_table(f, "UNICODE_CLASSES", cats, class_table,
339-
pfun=lambda x: "(\"%s\",&super::%s::%s_table)" % (x[0], x[1], x[0]))
339+
pfun=lambda x: "(\"%s\",super::%s::%s_table)" % (x[0], x[1], x[0]))
340340

341-
f.write(" pub static PERLD: &'static %s = &super::general_category::Nd_table;\n\n"
341+
f.write(" pub static PERLD: %s = super::general_category::Nd_table;\n\n"
342342
% regex_class)
343-
f.write(" pub static PERLS: &'static %s = &super::property::White_Space_table;\n\n"
343+
f.write(" pub static PERLS: %s = super::property::White_Space_table;\n\n"
344344
% regex_class)
345345

346346
emit_table(f, "PERLW", w_data, regex_class)

branches/snap-stage3/src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn stats_print() {
8585
///
8686
/// This preserves the non-null invariant for types like `Box<T>`. The address may overlap with
8787
/// non-zero-size memory allocations.
88-
pub const EMPTY: *mut () = 0x1 as *mut ();
88+
pub static EMPTY: *mut () = 0x1 as *mut ();
8989

9090
/// The allocator for unique pointers.
9191
#[cfg(not(test))]

branches/snap-stage3/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#![crate_type = "rlib"]
6767
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
6868
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
69-
html_root_url = "http://doc.rust-lang.org/nightly/")]
69+
html_root_url = "http://doc.rust-lang.org/")]
7070

7171
#![no_std]
7272
#![feature(lang_items, phase, unsafe_destructor)]

branches/snap-stage3/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#![license = "MIT/ASL2"]
2727
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2828
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
29-
html_root_url = "http://doc.rust-lang.org/nightly/")]
29+
html_root_url = "http://doc.rust-lang.org/0.12.0/")]
3030

3131
#![feature(unsafe_destructor)]
3232
#![allow(missing_doc)]

branches/snap-stage3/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#![license = "MIT/ASL2"]
2020
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2121
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
22-
html_root_url = "http://doc.rust-lang.org/nightly/",
22+
html_root_url = "http://doc.rust-lang.org/0.12.0/",
2323
html_playground_url = "http://play.rust-lang.org/")]
2424

2525
#![allow(unknown_features)]

branches/snap-stage3/src/libcollections/slice.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
8888
#![doc(primitive = "slice")]
8989

90-
use alloc::boxed::Box;
9190
use core::cmp;
9291
use core::mem::size_of;
9392
use core::mem;
@@ -299,23 +298,6 @@ impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
299298
fn into_vec(self) -> Vec<T> { self.to_vec() }
300299
}
301300

302-
#[experimental]
303-
pub trait BoxedSlice<T> {
304-
/// Convert `self` into a vector without clones or allocation.
305-
fn into_vec(self) -> Vec<T>;
306-
}
307-
308-
impl<T> BoxedSlice<T> for Box<[T]> {
309-
#[experimental]
310-
fn into_vec(mut self) -> Vec<T> {
311-
unsafe {
312-
let xs = Vec::from_raw_parts(self.len(), self.len(), self.as_mut_ptr());
313-
mem::forget(self);
314-
xs
315-
}
316-
}
317-
}
318-
319301
/// Extension methods for vectors containing `Clone` elements.
320302
pub trait ImmutableCloneableVector<T> {
321303
/// Partitions the vector into two vectors `(a, b)`, where all
@@ -2326,13 +2308,6 @@ mod tests {
23262308
let y: &mut [int] = [];
23272309
assert!(y.last_mut().is_none());
23282310
}
2329-
2330-
#[test]
2331-
fn test_into_vec() {
2332-
let xs = box [1u, 2, 3];
2333-
let ys = xs.into_vec();
2334-
assert_eq!(ys.as_slice(), [1u, 2, 3].as_slice());
2335-
}
23362311
}
23372312

23382313
#[cfg(test)]

branches/snap-stage3/src/libcollections/trie.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ use slice::{Items, MutItems};
3434
use slice;
3535

3636
// FIXME: #5244: need to manually update the TrieNode constructor
37-
const SHIFT: uint = 4;
38-
const SIZE: uint = 1 << SHIFT;
39-
const MASK: uint = SIZE - 1;
40-
const NUM_CHUNKS: uint = uint::BITS / SHIFT;
37+
static SHIFT: uint = 4;
38+
static SIZE: uint = 1 << SHIFT;
39+
static MASK: uint = SIZE - 1;
40+
static NUM_CHUNKS: uint = uint::BITS / SHIFT;
4141

4242
#[deriving(Clone)]
4343
enum Child<T> {

branches/snap-stage3/src/libcollections/vec.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
use core::prelude::*;
1616

17-
use alloc::boxed::Box;
1817
use alloc::heap::{EMPTY, allocate, reallocate, deallocate};
1918
use core::cmp::max;
2019
use core::default::Default;
@@ -758,20 +757,6 @@ impl<T> Vec<T> {
758757
}
759758
}
760759

761-
/// Convert the vector into Box<[T]>.
762-
///
763-
/// Note that this will drop any excess capacity. Calling this and converting back to a vector
764-
/// with `into_vec()` is equivalent to calling `shrink_to_fit()`.
765-
#[experimental]
766-
pub fn into_boxed_slice(mut self) -> Box<[T]> {
767-
self.shrink_to_fit();
768-
unsafe {
769-
let xs: Box<[T]> = mem::transmute(self.as_mut_slice());
770-
mem::forget(self);
771-
xs
772-
}
773-
}
774-
775760
/// Deprecated, call `push` instead
776761
#[inline]
777762
#[deprecated = "call .push() instead"]
@@ -1749,7 +1734,7 @@ impl<T> MutableSeq<T> for Vec<T> {
17491734
let size = max(old_size, 2 * mem::size_of::<T>()) * 2;
17501735
if old_size > size { fail!("capacity overflow") }
17511736
unsafe {
1752-
self.ptr = alloc_or_realloc(self.ptr, old_size, size);
1737+
self.ptr = alloc_or_realloc(self.ptr, self.cap * mem::size_of::<T>(), size);
17531738
}
17541739
self.cap = max(self.cap, 2) * 2;
17551740
}
@@ -1773,6 +1758,7 @@ impl<T> MutableSeq<T> for Vec<T> {
17731758
}
17741759
}
17751760
}
1761+
17761762
}
17771763

17781764
/// An iterator that moves out of a vector.
@@ -2646,13 +2632,6 @@ mod tests {
26462632
assert!(vec2 == vec!((), (), ()));
26472633
}
26482634

2649-
#[test]
2650-
fn test_into_boxed_slice() {
2651-
let xs = vec![1u, 2, 3];
2652-
let ys = xs.into_boxed_slice();
2653-
assert_eq!(ys.as_slice(), [1u, 2, 3].as_slice());
2654-
}
2655-
26562635
#[bench]
26572636
fn bench_new(b: &mut Bencher) {
26582637
b.iter(|| {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ pub enum Ordering {
7777

7878
/// An `AtomicBool` initialized to `false`
7979
#[unstable = "may be renamed, pending conventions for static initalizers"]
80-
pub const INIT_ATOMIC_BOOL: AtomicBool =
80+
pub static INIT_ATOMIC_BOOL: AtomicBool =
8181
AtomicBool { v: UnsafeCell { value: 0 }, nocopy: marker::NoCopy };
8282
/// An `AtomicInt` initialized to `0`
8383
#[unstable = "may be renamed, pending conventions for static initalizers"]
84-
pub const INIT_ATOMIC_INT: AtomicInt =
84+
pub static INIT_ATOMIC_INT: AtomicInt =
8585
AtomicInt { v: UnsafeCell { value: 0 }, nocopy: marker::NoCopy };
8686
/// An `AtomicUint` initialized to `0`
8787
#[unstable = "may be renamed, pending conventions for static initalizers"]
88-
pub const INIT_ATOMIC_UINT: AtomicUint =
88+
pub static INIT_ATOMIC_UINT: AtomicUint =
8989
AtomicUint { v: UnsafeCell { value: 0, }, nocopy: marker::NoCopy };
9090

9191
// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
92-
const UINT_TRUE: uint = -1;
92+
static UINT_TRUE: uint = -1;
9393

9494
#[stable]
9595
impl AtomicBool {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ pub struct RefCell<T> {
219219
// Values [1, MAX-1] represent the number of `Ref` active
220220
// (will not outgrow its range since `uint` is the size of the address space)
221221
type BorrowFlag = uint;
222-
const UNUSED: BorrowFlag = 0;
223-
const WRITING: BorrowFlag = -1;
222+
static UNUSED: BorrowFlag = 0;
223+
static WRITING: BorrowFlag = -1;
224224

225225
impl<T> RefCell<T> {
226226
/// Create a new `RefCell` containing `value`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static MAX_THREE_B: u32 = 0x10000u32;
6363
*/
6464

6565
/// The highest valid code point
66-
pub const MAX: char = '\U0010ffff';
66+
pub static MAX: char = '\U0010ffff';
6767

6868
/// Converts from `u32` to a `char`
6969
#[inline]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#![crate_type = "rlib"]
5454
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
5555
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
56-
html_root_url = "http://doc.rust-lang.org/nightly/",
56+
html_root_url = "http://doc.rust-lang.org/0.12.0/",
5757
html_playground_url = "http://play.rust-lang.org/")]
5858

5959
#![no_std]

0 commit comments

Comments
 (0)