Skip to content

Commit 2e7b416

Browse files
committed
---
yaml --- r: 42975 b: refs/heads/try c: e72c917 h: refs/heads/master i: 42973: 96a7b36 42971: 8e77cc3 42967: 0e9891e 42959: b70071c 42943: cede17b v: v3
1 parent e1588a6 commit 2e7b416

File tree

141 files changed

+823
-873
lines changed

Some content is hidden

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

141 files changed

+823
-873
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: abd29e5eadb46ec7d7126fa0438c1c52c4ace00f
5+
refs/heads/try: e72c917f7120eef8f7b2e18537a8b9589fb21b10
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ then
515515
| cut -d ' ' -f 2)
516516

517517
case $CFG_CLANG_VERSION in
518-
(3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1*)
518+
(3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1* | 4.2*)
519519
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
520520
CFG_C_COMPILER="clang"
521521
;;

branches/try/doc/rust.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,15 +1719,12 @@ vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
17191719

17201720
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
17211721
more comma-separated expressions of uniform type in square brackets.
1722-
The keyword `mut` can be written after the opening bracket to
1723-
indicate that the elements of the resulting vector may be mutated.
1724-
When no mutability is specified, the vector is immutable.
17251722

17261723
~~~~
17271724
[1, 2, 3, 4];
17281725
["a", "b", "c", "d"];
17291726
[0, ..128]; // vector with 128 zeros
1730-
[mut 0u8, 0u8, 0u8, 0u8];
1727+
[0u8, 0u8, 0u8, 0u8];
17311728
~~~~
17321729

17331730
### Index expressions
@@ -1749,7 +1746,6 @@ task in a _failing state_.
17491746
# do task::spawn_unlinked {
17501747
17511748
([1, 2, 3, 4])[0];
1752-
([mut 'x', 'y'])[1] = 'z';
17531749
(["a", "b"])[10]; // fails
17541750
17551751
# }
@@ -1912,8 +1908,8 @@ No allocation or destruction is entailed.
19121908
An example of three different swap expressions:
19131909

19141910
~~~~~~~~
1915-
# let mut x = &[mut 0];
1916-
# let mut a = &[mut 0];
1911+
# let mut x = &mut [0];
1912+
# let mut a = &mut [0];
19171913
# let i = 0;
19181914
# let y = {mut z: 0};
19191915
# let b = {mut c: 0};
@@ -2008,11 +2004,11 @@ the unary copy operator is typically only used to cause an argument to a functio
20082004
An example of a copy expression:
20092005

20102006
~~~~
2011-
fn mutate(vec: ~[mut int]) {
2007+
fn mutate(mut vec: ~[int]) {
20122008
vec[0] = 10;
20132009
}
20142010
2015-
let v = ~[mut 1,2,3];
2011+
let v = ~[1,2,3];
20162012
20172013
mutate(copy v); // Pass a copy
20182014

branches/try/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ Generic `type`, `struct`, and `enum` declarations follow the same pattern:
17951795
type Set<T> = HashMap<T, ()>;
17961796
17971797
struct Stack<T> {
1798-
elements: ~[mut T]
1798+
elements: ~[T]
17991799
}
18001800
18011801
enum Option<T> {

branches/try/src/libcargo/cargo.rc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ pub fn configure(opts: Options) -> Cargo {
731731
need_dir(&c.bindir);
732732

733733
for sources.each_key_ref |&k| {
734-
let mut s = sources.get(k);
734+
let mut s = sources.get(&k);
735735
load_source_packages(&c, s);
736736
sources.insert(k, s);
737737
}
@@ -981,7 +981,7 @@ pub fn install_named(c: &mut Cargo, wd: &Path, name: ~str) {
981981

982982
pub fn install_uuid_specific(c: &mut Cargo, wd: &Path, src: ~str,
983983
uuid: ~str) {
984-
match c.sources.find(src) {
984+
match c.sources.find(&src) {
985985
Some(s) => {
986986
for s.packages.each |p| {
987987
if p.uuid == uuid {
@@ -997,7 +997,7 @@ pub fn install_uuid_specific(c: &mut Cargo, wd: &Path, src: ~str,
997997

998998
pub fn install_named_specific(c: &mut Cargo, wd: &Path, src: ~str,
999999
name: ~str) {
1000-
match c.sources.find(src) {
1000+
match c.sources.find(&src) {
10011001
Some(s) => {
10021002
for s.packages.each |p| {
10031003
if p.name == name {
@@ -1064,7 +1064,7 @@ pub fn cmd_uninstall(c: &Cargo) {
10641064
}
10651065

10661066
pub fn install_query(c: &mut Cargo, wd: &Path, target: ~str) {
1067-
match c.dep_cache.find(target) {
1067+
match c.dep_cache.find(&target) {
10681068
Some(inst) => {
10691069
if inst {
10701070
return;
@@ -1156,7 +1156,7 @@ pub fn cmd_install(c: &mut Cargo) {
11561156

11571157
pub fn sync(c: &Cargo) {
11581158
for c.sources.each_key_ref |&k| {
1159-
let mut s = c.sources.get(k);
1159+
let mut s = c.sources.get(&k);
11601160
sync_one(c, s);
11611161
c.sources.insert(k, s);
11621162
}
@@ -1558,7 +1558,7 @@ pub fn cmd_list(c: &Cargo) {
15581558
if !valid_pkg_name(*name) {
15591559
error(fmt!("'%s' is an invalid source name", *name));
15601560
} else {
1561-
match c.sources.find(*name) {
1561+
match c.sources.find(name) {
15621562
Some(source) => {
15631563
print_source(source);
15641564
}
@@ -1754,7 +1754,7 @@ pub fn cmd_sources(c: &Cargo) {
17541754
return;
17551755
}
17561756

1757-
match c.sources.find(name) {
1757+
match c.sources.find(&name) {
17581758
Some(source) => {
17591759
let old = copy source.url;
17601760
let method = assume_source_method(url);
@@ -1785,7 +1785,7 @@ pub fn cmd_sources(c: &Cargo) {
17851785
return;
17861786
}
17871787

1788-
match c.sources.find(name) {
1788+
match c.sources.find(&name) {
17891789
Some(source) => {
17901790
let old = copy source.method;
17911791

@@ -1823,7 +1823,7 @@ pub fn cmd_sources(c: &Cargo) {
18231823
return;
18241824
}
18251825

1826-
match c.sources.find(name) {
1826+
match c.sources.find(&name) {
18271827
Some(source) => {
18281828
c.sources.remove(&name);
18291829
c.sources.insert(newn, source);

branches/try/src/libcore/either.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
150150
}
151151

152152
impl<T, U> Either<T, U> {
153+
#[inline(always)]
154+
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
155+
either(f_left, f_right, self)
156+
}
157+
158+
#[inline(always)]
159+
fn flip(self) -> Either<U, T> { flip(self) }
160+
161+
#[inline(always)]
162+
fn to_result(self) -> Result<U, T> { to_result(self) }
163+
164+
#[inline(always)]
165+
fn is_left(&self) -> bool { is_left(self) }
166+
167+
#[inline(always)]
168+
fn is_right(&self) -> bool { is_right(self) }
169+
153170
#[inline(always)]
154171
fn unwrap_left(self) -> T { unwrap_left(self) }
155172

branches/try/src/libcore/io.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,25 +490,25 @@ pub fn FILERes(f: *libc::FILE) -> FILERes {
490490
}
491491
}
492492

493-
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> Reader {
493+
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
494494
if cleanup {
495-
Wrapper { base: f, cleanup: FILERes(f) } as Reader
495+
@Wrapper { base: f, cleanup: FILERes(f) } as @Reader
496496
} else {
497-
f as Reader
497+
@f as @Reader
498498
}
499499
}
500500

501501
// FIXME (#2004): this should either be an trait-less impl, a set of
502502
// top-level functions that take a reader, or a set of default methods on
503503
// reader (which can then be called reader)
504504

505-
pub fn stdin() -> Reader {
505+
pub fn stdin() -> @Reader {
506506
unsafe {
507-
rustrt::rust_get_stdin() as Reader
507+
rustrt::rust_get_stdin() as @Reader
508508
}
509509
}
510510

511-
pub fn file_reader(path: &Path) -> Result<Reader, ~str> {
511+
pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
512512
unsafe {
513513
let f = os::as_c_charp(path.to_str(), |pathbuf| {
514514
os::as_c_charp("r", |modebuf|
@@ -555,11 +555,11 @@ impl BytesReader: Reader {
555555
fn tell(&self) -> uint { self.pos }
556556
}
557557
558-
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
559-
f(BytesReader { bytes: bytes, pos: 0u } as Reader)
558+
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(@Reader) -> t) -> t {
559+
f(@BytesReader { bytes: bytes, pos: 0u } as @Reader)
560560
}
561561
562-
pub pure fn with_str_reader<T>(s: &str, f: fn(Reader) -> T) -> T {
562+
pub pure fn with_str_reader<T>(s: &str, f: fn(@Reader) -> T) -> T {
563563
str::byte_slice(s, |bytes| with_bytes_reader(bytes, f))
564564
}
565565

branches/try/src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ pub pure fn to_str_digits(num: f32, dig: uint) -> ~str {
439439

440440
impl f32: to_str::ToStr {
441441
#[inline(always)]
442-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
442+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
443443
}
444444

445445
impl f32: num::ToStrRadix {

branches/try/src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ pub pure fn to_str_digits(num: f64, dig: uint) -> ~str {
463463

464464
impl f64: to_str::ToStr {
465465
#[inline(always)]
466-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
466+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
467467
}
468468

469469
impl f64: num::ToStrRadix {

branches/try/src/libcore/num/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub pure fn to_str_digits(num: float, digits: uint) -> ~str {
206206
207207
impl float: to_str::ToStr {
208208
#[inline(always)]
209-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
209+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
210210
}
211211
212212
impl float: num::ToStrRadix {

branches/try/src/libcore/num/int-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ pub pure fn str(i: T) -> ~str { to_str(i) }
287287
288288
impl T : ToStr {
289289
#[inline(always)]
290-
pure fn to_str() -> ~str {
291-
to_str(self)
290+
pure fn to_str(&self) -> ~str {
291+
to_str(*self)
292292
}
293293
}
294294

branches/try/src/libcore/num/uint-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ pub pure fn str(i: T) -> ~str { to_str(i) }
249249
250250
impl T : ToStr {
251251
#[inline(always)]
252-
pure fn to_str() -> ~str {
253-
to_str(self)
252+
pure fn to_str(&self) -> ~str {
253+
to_str(*self)
254254
}
255255
}
256256

branches/try/src/libcore/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl Path {
368368
}
369369

370370
impl PosixPath : ToStr {
371-
pure fn to_str() -> ~str {
371+
pure fn to_str(&self) -> ~str {
372372
let mut s = ~"";
373373
if self.is_absolute {
374374
s += "/";
@@ -531,7 +531,7 @@ impl PosixPath : GenericPath {
531531

532532

533533
impl WindowsPath : ToStr {
534-
pure fn to_str() -> ~str {
534+
pure fn to_str(&self) -> ~str {
535535
let mut s = ~"";
536536
match self.host {
537537
Some(ref h) => { s += "\\\\"; s += *h; }

branches/try/src/libcore/prelude.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,37 @@
1212

1313
/* Reexported core operators */
1414

15+
pub use either::{Either, Left, Right};
1516
pub use kinds::{Const, Copy, Owned, Durable};
16-
pub use ops::{Drop};
1717
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
1818
pub use ops::{BitAnd, BitOr, BitXor};
19+
pub use ops::{Drop};
1920
pub use ops::{Shl, Shr, Index};
2021
pub use option::{Option, Some, None};
2122
pub use result::{Result, Ok, Err};
2223

2324
/* Reexported types and traits */
2425

25-
pub use path::Path;
26+
pub use clone::Clone;
27+
pub use cmp::{Eq, Ord};
28+
pub use container::{Container, Mutable, Map, Set};
29+
pub use hash::Hash;
30+
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
31+
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
32+
pub use num::Num;
2633
pub use path::GenericPath;
27-
pub use path::WindowsPath;
34+
pub use path::Path;
2835
pub use path::PosixPath;
29-
30-
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
36+
pub use path::WindowsPath;
37+
pub use pipes::{GenericChan, GenericPort};
38+
pub use ptr::Ptr;
3139
pub use str::{StrSlice, Trimmable};
32-
pub use container::{Container, Mutable};
40+
pub use to_bytes::IterBytes;
41+
pub use to_str::ToStr;
42+
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
3343
pub use vec::{CopyableVector, ImmutableVector};
3444
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
3545
pub use vec::{OwnedVector, OwnedCopyableVector};
36-
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
37-
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
38-
pub use container::{Container, Mutable, Map, Set};
39-
pub use pipes::{GenericChan, GenericPort};
40-
41-
pub use num::Num;
42-
pub use ptr::Ptr;
43-
pub use to_str::ToStr;
44-
pub use clone::Clone;
45-
46-
pub use cmp::{Eq, Ord};
47-
pub use hash::Hash;
48-
pub use to_bytes::IterBytes;
4946

5047
/* Reexported modules */
5148

branches/try/src/libcore/private.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ pub mod tests {
486486
res.recv();
487487
}
488488
489-
#[test] #[should_fail] #[ignore(cfg(windows))]
489+
#[test] #[should_fail] #[ignore(reason = "random red")]
490490
pub fn exclusive_unwrap_conflict() {
491491
let x = exclusive(~~"hello");
492492
let x2 = ~mut Some(x.clone());

0 commit comments

Comments
 (0)