Skip to content

Commit f4de619

Browse files
committed
---
yaml --- r: 160666 b: refs/heads/master c: 985acfd h: refs/heads/master v: v3
1 parent 39264a0 commit f4de619

Some content is hidden

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

79 files changed

+469
-2720
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0e06f71747749e33ca590c334658bddde97a7e54
2+
refs/heads/master: 985acfdb67d550d0259fcdcfbeed0a86ec3da9d0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c9f6d696420107f82304b992cf623b806995fe18
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe

trunk/mk/crates.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
################################################################################
5151

5252
TARGET_CRATES := libc std flate arena term \
53-
serialize sync getopts collections test time rand \
53+
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
@@ -63,7 +63,7 @@ DEPS_libc := core
6363
DEPS_unicode := core
6464
DEPS_alloc := core libc native:jemalloc
6565
DEPS_rustrt := alloc core libc collections native:rustrt_native
66-
DEPS_std := core libc rand alloc collections rustrt sync unicode \
66+
DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
@@ -81,7 +81,6 @@ DEPS_glob := std
8181
DEPS_serialize := std log
8282
DEPS_rbml := std log serialize
8383
DEPS_term := std log
84-
DEPS_sync := core alloc rustrt collections
8584
DEPS_getopts := std
8685
DEPS_collections := core alloc unicode
8786
DEPS_num := std

trunk/src/compiletest/errors.rs

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
use self::WhichLine::*;
1110

1211
use std::ascii::AsciiExt;
1312
use std::io::{BufferedReader, File};
@@ -19,74 +18,28 @@ pub struct ExpectedError {
1918
pub msg: String,
2019
}
2120

22-
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
23-
/// The former is a "follow" that inherits its target from the preceding line;
24-
/// the latter is an "adjusts" that goes that many lines up.
25-
///
26-
/// Goal is to enable tests both like: //~^^^ ERROR go up three
27-
/// and also //~^ ERROR message one for the preceding line, and
28-
/// //~| ERROR message two for that same line.
29-
30-
pub static EXPECTED_PATTERN : &'static str =
31-
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
32-
33-
#[deriving(PartialEq, Show)]
34-
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
21+
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
3522

3623
// Load any test directives embedded in the file
3724
pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3825
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
3926

40-
// `last_nonfollow_error` tracks the most recently seen
41-
// line with an error template that did not use the
42-
// follow-syntax, "//~| ...".
43-
//
44-
// (pnkfelix could not find an easy way to compose Iterator::scan
45-
// and Iterator::filter_map to pass along this information into
46-
// `parse_expected`. So instead I am storing that state here and
47-
// updating it in the map callback below.)
48-
let mut last_nonfollow_error = None;
49-
5027
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
51-
parse_expected(last_nonfollow_error,
52-
line_no + 1,
53-
ln.unwrap().as_slice(), re)
54-
.map(|(which, error)| {
55-
match which {
56-
FollowPrevious(_) => {}
57-
_ => last_nonfollow_error = Some(error.line),
58-
}
59-
error
60-
})
28+
parse_expected(line_no + 1, ln.unwrap().as_slice(), re)
6129
}).collect()
6230
}
6331

64-
fn parse_expected(last_nonfollow_error: Option<uint>,
65-
line_num: uint,
66-
line: &str,
67-
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
32+
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
6833
re.captures(line).and_then(|caps| {
6934
let adjusts = caps.name("adjusts").len();
7035
let kind = caps.name("kind").to_ascii_lower();
7136
let msg = caps.name("msg").trim().to_string();
72-
let follow = caps.name("follow").len() > 0;
73-
74-
let (which, line) = if follow {
75-
assert!(adjusts == 0, "use either //~| or //~^, not both.");
76-
let line = last_nonfollow_error.unwrap_or_else(|| {
77-
panic!("encountered //~| without preceding //~^ line.")
78-
});
79-
(FollowPrevious(line), line)
80-
} else {
81-
let which =
82-
if adjusts > 0 { AdjustBackward(adjusts) } else { ThisLine };
83-
let line = line_num - adjusts;
84-
(which, line)
85-
};
8637

87-
debug!("line={} which={} kind={} msg={}", line_num, which, kind, msg);
88-
Some((which, ExpectedError { line: line,
89-
kind: kind,
90-
msg: msg, }))
38+
debug!("line={} kind={} msg={}", line_num, kind, msg);
39+
Some(ExpectedError {
40+
line: line_num - adjusts,
41+
kind: kind,
42+
msg: msg,
43+
})
9144
})
9245
}

trunk/src/doc/reference.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,20 +1689,7 @@ methods in such an implementation can only be used as direct calls on the
16891689
values of the type that the implementation targets. In such an implementation,
16901690
the trait type and `for` after `impl` are omitted. Such implementations are
16911691
limited to nominal types (enums, structs), and the implementation must appear
1692-
in the same module or a sub-module as the `self` type:
1693-
1694-
```
1695-
struct Point {x: int, y: int}
1696-
1697-
impl Point {
1698-
fn log(&self) {
1699-
println!("Point is at ({}, {})", self.x, self.y);
1700-
}
1701-
}
1702-
1703-
let my_point = Point {x: 10, y:11};
1704-
my_point.log();
1705-
```
1692+
in the same module or a sub-module as the `self` type.
17061693

17071694
When a trait _is_ specified in an `impl`, all methods declared as part of the
17081695
trait must be implemented, with matching types and type parameter counts.

trunk/src/etc/emacs/rust-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34+
;; _ is a word-char
35+
(modify-syntax-entry ?_ "w" table)
36+
3437
;; Comments
3538
(modify-syntax-entry ?/ ". 124b" table)
3639
(modify-syntax-entry ?* ". 23" table)
@@ -394,7 +397,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust.
394397
Don't move to the beginning of the line. `beginning-of-defun',
395398
which calls this, does that afterwards."
396399
(interactive "p")
397-
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>")
400+
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b")
398401
nil 'move (or arg 1)))
399402

400403
(defun rust-end-of-defun ()

trunk/src/etc/licenseck.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libsync/mpsc_queue.rs", # BSD
42-
"libsync/spsc_queue.rs", # BSD
43-
"libsync/mpmc_bounded_queue.rs", # BSD
44-
"libsync/mpsc_intrusive.rs", # BSD
41+
"libstd/sync/mpsc_queue.rs", # BSD
42+
"libstd/sync/spsc_queue.rs", # BSD
43+
"libstd/sync/mpmc_bounded_queue.rs", # BSD
4544
"test/bench/shootout-binarytrees.rs", # BSD
4645
"test/bench/shootout-chameneos-redux.rs", # BSD
4746
"test/bench/shootout-fannkuch-redux.rs", # BSD

trunk/src/libcollections/vec.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,18 +1248,14 @@ pub struct MoveItems<T> {
12481248
impl<T> MoveItems<T> {
12491249
#[inline]
12501250
/// Drops all items that have not yet been moved and returns the empty vector.
1251-
pub fn into_inner(mut self) -> Vec<T> {
1251+
pub fn unwrap(mut self) -> Vec<T> {
12521252
unsafe {
12531253
for _x in self { }
12541254
let MoveItems { allocation, cap, ptr: _ptr, end: _end } = self;
12551255
mem::forget(self);
12561256
Vec { ptr: allocation, cap: cap, len: 0 }
12571257
}
12581258
}
1259-
1260-
/// Deprecated, use into_inner() instead
1261-
#[deprecated = "renamed to into_inner()"]
1262-
pub fn unwrap(self) -> Vec<T> { self.into_inner() }
12631259
}
12641260

12651261
impl<T> Iterator<T> for MoveItems<T> {

trunk/src/libcore/cell.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,15 @@ impl<T> RefCell<T> {
256256
}
257257

258258
/// Consumes the `RefCell`, returning the wrapped value.
259-
#[unstable = "recently renamed per RFC 430"]
260-
pub fn into_inner(self) -> T {
259+
#[unstable = "may be renamed, depending on global conventions"]
260+
pub fn unwrap(self) -> T {
261261
// Since this function takes `self` (the `RefCell`) by value, the
262262
// compiler statically verifies that it is not currently borrowed.
263263
// Therefore the following assertion is just a `debug_assert!`.
264264
debug_assert!(self.borrow.get() == UNUSED);
265-
unsafe { self.value.into_inner() }
265+
unsafe{self.value.unwrap()}
266266
}
267267

268-
/// Deprecated, use into_inner() instead
269-
#[deprecated = "renamed to into_inner()"]
270-
pub fn unwrap(self) -> T { self.into_inner() }
271-
272268
/// Attempts to immutably borrow the wrapped value.
273269
///
274270
/// The borrow lasts until the returned `Ref` exits scope. Multiple
@@ -522,9 +518,5 @@ impl<T> UnsafeCell<T> {
522518
#[inline]
523519
#[unstable = "conventions around the name `unwrap` are still under \
524520
development"]
525-
pub unsafe fn into_inner(self) -> T { self.value }
526-
527-
/// Deprecated, use into_inner() instead
528-
#[deprecated = "renamed to into_inner()"]
529-
pub unsafe fn unwrap(self) -> T { self.into_inner() }
521+
pub unsafe fn unwrap(self) -> T { self.value }
530522
}

trunk/src/libcore/slice.rs

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,21 +1104,6 @@ macro_rules! iterator {
11041104
}
11051105
}
11061106

1107-
macro_rules! make_slice {
1108-
($t: ty -> $result: ty: $start: expr, $end: expr) => {{
1109-
let diff = $end as uint - $start as uint;
1110-
let len = if mem::size_of::<T>() == 0 {
1111-
diff
1112-
} else {
1113-
diff / mem::size_of::<$t>()
1114-
};
1115-
unsafe {
1116-
transmute::<_, $result>(RawSlice { data: $start as *const T, len: len })
1117-
}
1118-
}}
1119-
}
1120-
1121-
11221107
/// Immutable slice iterator
11231108
#[experimental = "needs review"]
11241109
pub struct Items<'a, T: 'a> {
@@ -1127,36 +1112,6 @@ pub struct Items<'a, T: 'a> {
11271112
marker: marker::ContravariantLifetime<'a>
11281113
}
11291114

1130-
#[experimental]
1131-
impl<'a, T> ops::Slice<uint, [T]> for Items<'a, T> {
1132-
fn as_slice_(&self) -> &[T] {
1133-
self.as_slice()
1134-
}
1135-
fn slice_from_or_fail<'b>(&'b self, from: &uint) -> &'b [T] {
1136-
use ops::Slice;
1137-
self.as_slice().slice_from_or_fail(from)
1138-
}
1139-
fn slice_to_or_fail<'b>(&'b self, to: &uint) -> &'b [T] {
1140-
use ops::Slice;
1141-
self.as_slice().slice_to_or_fail(to)
1142-
}
1143-
fn slice_or_fail<'b>(&'b self, from: &uint, to: &uint) -> &'b [T] {
1144-
use ops::Slice;
1145-
self.as_slice().slice_or_fail(from, to)
1146-
}
1147-
}
1148-
1149-
impl<'a, T> Items<'a, T> {
1150-
/// View the underlying data as a subslice of the original data.
1151-
///
1152-
/// This has the same lifetime as the original slice, and so the
1153-
/// iterator can continue to be used while this exists.
1154-
#[experimental]
1155-
pub fn as_slice(&self) -> &'a [T] {
1156-
make_slice!(T -> &'a [T]: self.ptr, self.end)
1157-
}
1158-
}
1159-
11601115
iterator!{struct Items -> *const T, &'a T}
11611116

11621117
#[experimental = "needs review"]
@@ -1201,57 +1156,6 @@ pub struct MutItems<'a, T: 'a> {
12011156
marker2: marker::NoCopy
12021157
}
12031158

1204-
#[experimental]
1205-
impl<'a, T> ops::Slice<uint, [T]> for MutItems<'a, T> {
1206-
fn as_slice_<'b>(&'b self) -> &'b [T] {
1207-
make_slice!(T -> &'b [T]: self.ptr, self.end)
1208-
}
1209-
fn slice_from_or_fail<'b>(&'b self, from: &uint) -> &'b [T] {
1210-
use ops::Slice;
1211-
self.as_slice_().slice_from_or_fail(from)
1212-
}
1213-
fn slice_to_or_fail<'b>(&'b self, to: &uint) -> &'b [T] {
1214-
use ops::Slice;
1215-
self.as_slice_().slice_to_or_fail(to)
1216-
}
1217-
fn slice_or_fail<'b>(&'b self, from: &uint, to: &uint) -> &'b [T] {
1218-
use ops::Slice;
1219-
self.as_slice_().slice_or_fail(from, to)
1220-
}
1221-
}
1222-
1223-
#[experimental]
1224-
impl<'a, T> ops::SliceMut<uint, [T]> for MutItems<'a, T> {
1225-
fn as_mut_slice_<'b>(&'b mut self) -> &'b mut [T] {
1226-
make_slice!(T -> &'b mut [T]: self.ptr, self.end)
1227-
}
1228-
fn slice_from_or_fail_mut<'b>(&'b mut self, from: &uint) -> &'b mut [T] {
1229-
use ops::SliceMut;
1230-
self.as_mut_slice_().slice_from_or_fail_mut(from)
1231-
}
1232-
fn slice_to_or_fail_mut<'b>(&'b mut self, to: &uint) -> &'b mut [T] {
1233-
use ops::SliceMut;
1234-
self.as_mut_slice_().slice_to_or_fail_mut(to)
1235-
}
1236-
fn slice_or_fail_mut<'b>(&'b mut self, from: &uint, to: &uint) -> &'b mut [T] {
1237-
use ops::SliceMut;
1238-
self.as_mut_slice_().slice_or_fail_mut(from, to)
1239-
}
1240-
}
1241-
1242-
impl<'a, T> MutItems<'a, T> {
1243-
/// View the underlying data as a subslice of the original data.
1244-
///
1245-
/// To avoid creating `&mut` references that alias, this is forced
1246-
/// to consume the iterator. Consider using the `Slice` and
1247-
/// `SliceMut` implementations for obtaining slices with more
1248-
/// restricted lifetimes that do not consume the iterator.
1249-
#[experimental]
1250-
pub fn into_slice(self) -> &'a mut [T] {
1251-
make_slice!(T -> &'a mut [T]: self.ptr, self.end)
1252-
}
1253-
}
1254-
12551159
iterator!{struct MutItems -> *mut T, &'a mut T}
12561160

12571161
#[experimental = "needs review"]

0 commit comments

Comments
 (0)