Skip to content

Commit 713572c

Browse files
committed
---
yaml --- r: 160070 b: refs/heads/try c: 5416901 h: refs/heads/master v: v3
1 parent f8895c3 commit 713572c

File tree

20 files changed

+144
-309
lines changed

20 files changed

+144
-309
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: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: c01c6e2cac7e75406f711c9c0344ab522421ce58
5+
refs/heads/try: 5416901ccad4550b6f7a6145de5dbbe94b98e309
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/guide-pointers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135135
```{notrust,ignore}
136-
func foo(x) {
136+
fn foo(x) {
137137
x = 5
138138
}
139139
140-
func main() {
140+
fn main() {
141141
i = 1
142142
foo(i)
143143
// what is the value of i here?
@@ -153,11 +153,11 @@ So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155155
```{notrust,ignore}
156-
func foo(&int x) {
156+
fn foo(&int x) {
157157
*x = 5
158158
}
159159
160-
func main() {
160+
fn main() {
161161
i = 1
162162
foo(&i)
163163
// what is the value of i here?
@@ -192,13 +192,13 @@ When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194194
```{notrust,ignore}
195-
func make_pointer(): &int {
195+
fn make_pointer(): &int {
196196
x = 5;
197197
198198
return &x;
199199
}
200200
201-
func main() {
201+
fn main() {
202202
&int i = make_pointer();
203203
*i = 5; // uh oh!
204204
}
@@ -214,11 +214,11 @@ issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216216
```{notrust,ignore}
217-
func mutate(&int i, int j) {
217+
fn mutate(&int i, int j) {
218218
*i = j;
219219
}
220220
221-
func main() {
221+
fn main() {
222222
x = 5;
223223
y = &x;
224224
z = &x; //y and z are aliased

branches/try/src/doc/po4a.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
[type: text] src/doc/guide-tasks.md $lang:doc/l10n/$lang/guide-tasks.md
2020
[type: text] src/doc/guide-testing.md $lang:doc/l10n/$lang/guide-testing.md
2121
[type: text] src/doc/guide-unsafe.md $lang:doc/l10n/$lang/guide-unsafe.md
22-
[type: text] src/doc/guide-crates.md $lang:doc/l10n/$lang/guide-crates.md
22+
[type: text] src/doc/guide-unsafe.md $lang:doc/l10n/$lang/guide-crates.md
2323
[type: text] src/doc/guide.md $lang:doc/l10n/$lang/guide.md
2424
[type: text] src/doc/index.md $lang:doc/l10n/$lang/index.md
2525
[type: text] src/doc/intro.md $lang:doc/l10n/$lang/intro.md

branches/try/src/doc/reference.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,10 +2653,9 @@ An expression may have two roles: it always produces a *value*, and it may have
26532653
value, and has effects during *evaluation*. Many expressions contain
26542654
sub-expressions (operands). The meaning of each kind of expression dictates
26552655
several things:
2656-
2657-
* Whether or not to evaluate the sub-expressions when evaluating the expression
2658-
* The order in which to evaluate the sub-expressions
2659-
* How to combine the sub-expressions' values to obtain the value of the expression
2656+
* Whether or not to evaluate the sub-expressions when evaluating the
2657+
* expression The order in which to evaluate the sub-expressions How to
2658+
* combine the sub-expressions' values to obtain the value of the expression.
26602659

26612660
In this way, the structure of expressions dictates the structure of execution.
26622661
Blocks are just another kind of expression, so blocks, statements, expressions,

branches/try/src/etc/snapshot.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ def full_snapshot_name(date, rev, platform, hsh):
7575

7676

7777
def get_kernel(triple):
78-
t = triple.split('-')
79-
if len(t) == 2:
80-
os_name = t[1]
81-
else:
82-
os_name = t[2]
78+
os_name = triple.split('-')[2]
8379
if os_name == "windows":
8480
return "winnt"
8581
if os_name == "darwin":

branches/try/src/libcollections/tree/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ impl<T: Ord> TreeSet<T> {
504504
/// # Example
505505
///
506506
/// ```
507-
/// use std::collections::TreeSet;
507+
/// use std::collections::BTreeSet;
508508
///
509-
/// let mut set = TreeSet::new();
509+
/// let mut set = BTreeSet::new();
510510
///
511511
/// assert_eq!(set.insert(2i), true);
512512
/// assert_eq!(set.insert(2i), false);
@@ -522,9 +522,9 @@ impl<T: Ord> TreeSet<T> {
522522
/// # Example
523523
///
524524
/// ```
525-
/// use std::collections::TreeSet;
525+
/// use std::collections::BTreeSet;
526526
///
527-
/// let mut set = TreeSet::new();
527+
/// let mut set = BTreeSet::new();
528528
///
529529
/// set.insert(2i);
530530
/// assert_eq!(set.remove(&2), true);

branches/try/src/libcore/cell.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157

158158
use clone::Clone;
159159
use cmp::PartialEq;
160-
use default::Default;
161160
use kinds::{marker, Copy};
162161
use ops::{Deref, DerefMut, Drop};
163162
use option::{None, Option, Some};
@@ -212,13 +211,6 @@ impl<T:Copy> Clone for Cell<T> {
212211
}
213212
}
214213

215-
#[unstable]
216-
impl<T:Default + Copy> Default for Cell<T> {
217-
fn default() -> Cell<T> {
218-
Cell::new(Default::default())
219-
}
220-
}
221-
222214
#[unstable = "waiting for `PartialEq` trait to become stable"]
223215
impl<T:PartialEq + Copy> PartialEq for Cell<T> {
224216
fn eq(&self, other: &Cell<T>) -> bool {
@@ -345,13 +337,6 @@ impl<T: Clone> Clone for RefCell<T> {
345337
}
346338
}
347339

348-
#[unstable]
349-
impl<T:Default> Default for RefCell<T> {
350-
fn default() -> RefCell<T> {
351-
RefCell::new(Default::default())
352-
}
353-
}
354-
355340
#[unstable = "waiting for `PartialEq` to become stable"]
356341
impl<T: PartialEq> PartialEq for RefCell<T> {
357342
fn eq(&self, other: &RefCell<T>) -> bool {

branches/try/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
//! a bug.
268268
//!
269269
//! A module that instead returns `Results` is alerting the caller
270-
//! that failure is possible, and providing precise control over how
270+
//! that panics are possible, and providing precise control over how
271271
//! it is handled.
272272
//!
273273
//! Furthermore, panics may not be recoverable at all, depending on

branches/try/src/libcoretest/cell.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use core::cell::*;
12-
use core::default::Default;
1312
use std::mem::drop;
1413

1514
#[test]
@@ -147,15 +146,3 @@ fn as_unsafe_cell() {
147146
unsafe { *r2.as_unsafe_cell().get() = 1u; }
148147
assert_eq!(1u, *r2.borrow());
149148
}
150-
151-
#[test]
152-
fn cell_default() {
153-
let cell: Cell<u32> = Default::default();
154-
assert_eq!(0, cell.get());
155-
}
156-
157-
#[test]
158-
fn refcell_default() {
159-
let cell: RefCell<u64> = Default::default();
160-
assert_eq!(0, *cell.borrow());
161-
}

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,12 @@ pub fn get_item_path(cdata: Cmd, id: ast::NodeId) -> Vec<ast_map::PathElem> {
630630
item_path(lookup_item(id, cdata.data()))
631631
}
632632

633-
pub type DecodeInlinedItem<'a> = for<'tcx> |cdata: Cmd,
634-
tcx: &ty::ctxt<'tcx>,
635-
path: Vec<ast_map::PathElem>,
636-
par_doc: rbml::Doc|: 'a
637-
-> Result<&'tcx ast::InlinedItem,
638-
Vec<ast_map::PathElem>>;
633+
pub type DecodeInlinedItem<'a> = <'tcx> |cdata: Cmd,
634+
tcx: &ty::ctxt<'tcx>,
635+
path: Vec<ast_map::PathElem>,
636+
par_doc: rbml::Doc|: 'a
637+
-> Result<&'tcx ast::InlinedItem,
638+
Vec<ast_map::PathElem>>;
639639

640640
pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &ty::ctxt<'tcx>, id: ast::NodeId,
641641
decode_inlined_item: DecodeInlinedItem)

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,8 @@ pub fn trans_closure(ccx: &CrateContext,
17871787
abi: Abi,
17881788
has_env: bool,
17891789
is_unboxed_closure: IsUnboxedClosureFlag,
1790-
maybe_load_env: for<'blk, 'tcx> |Block<'blk, 'tcx>, ScopeId|
1791-
-> Block<'blk, 'tcx>) {
1790+
maybe_load_env: <'blk, 'tcx> |Block<'blk, 'tcx>, ScopeId|
1791+
-> Block<'blk, 'tcx>) {
17921792
ccx.stats().n_closures.set(ccx.stats().n_closures.get() + 1);
17931793

17941794
let _icx = push_ctxt("trans_closure");

branches/try/src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ fn declare_generic_glue(ccx: &CrateContext, t: ty::t, llfnty: Type,
528528
fn make_generic_glue(ccx: &CrateContext,
529529
t: ty::t,
530530
llfn: ValueRef,
531-
helper: for<'blk, 'tcx> |Block<'blk, 'tcx>, ValueRef, ty::t|
532-
-> Block<'blk, 'tcx>,
531+
helper: <'blk, 'tcx> |Block<'blk, 'tcx>, ValueRef, ty::t|
532+
-> Block<'blk, 'tcx>,
533533
name: &str)
534534
-> ValueRef {
535535
let _icx = push_ctxt("make_generic_glue");

branches/try/src/librustc/middle/trans/type_of.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,12 @@ pub fn llvm_type_name(cx: &CrateContext,
455455

456456
let base = ty::item_path_str(cx.tcx(), did);
457457
let strings: Vec<String> = tps.iter().map(|t| t.repr(cx.tcx())).collect();
458-
let tstr = format!("{}<{}>", base, strings);
458+
let tstr = if strings.is_empty() {
459+
base
460+
} else {
461+
format!("{}<{}>", base, strings)
462+
};
463+
459464
if did.krate == 0 {
460465
format!("{}.{}", name, tstr)
461466
} else {

branches/try/src/librustdoc/html/static/main.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,3 @@ pre.rust { position: relative; }
584584
height: 1.5em;
585585
}
586586
}
587-
588-
@media print {
589-
nav.sub, .content .out-of-band, .collapse-toggle {
590-
display: none;
591-
}
592-
}

branches/try/src/libserialize/json.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,10 +2315,6 @@ impl ToJson for bool {
23152315
fn to_json(&self) -> Json { Boolean(*self) }
23162316
}
23172317

2318-
impl ToJson for str {
2319-
fn to_json(&self) -> Json { String(self.into_string()) }
2320-
}
2321-
23222318
impl ToJson for string::String {
23232319
fn to_json(&self) -> Json { String((*self).clone()) }
23242320
}
@@ -3718,8 +3714,7 @@ mod tests {
37183714
assert_eq!(f64::NAN.to_json(), Null);
37193715
assert_eq!(true.to_json(), Boolean(true));
37203716
assert_eq!(false.to_json(), Boolean(false));
3721-
assert_eq!("abc".to_json(), String("abc".into_string()));
3722-
assert_eq!("abc".into_string().to_json(), String("abc".into_string()));
3717+
assert_eq!("abc".to_string().to_json(), String("abc".to_string()));
37233718
assert_eq!((1u, 2u).to_json(), list2);
37243719
assert_eq!((1u, 2u, 3u).to_json(), list3);
37253720
assert_eq!([1u, 2].to_json(), list2);

branches/try/src/libstd/io/mod.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,16 @@ pub trait Buffer: Reader {
14371437
)
14381438
}
14391439

1440+
/// Create an iterator that reads a line on each iteration until EOF.
1441+
///
1442+
/// # Error
1443+
///
1444+
/// Any error other than `EndOfFile` that is produced by the underlying Reader
1445+
/// is returned by the iterator and should be handled by the caller.
1446+
fn lines<'r>(&'r mut self) -> Lines<'r, Self> {
1447+
Lines { buffer: self }
1448+
}
1449+
14401450
/// Reads a sequence of bytes leading up to a specified delimiter. Once the
14411451
/// specified byte is encountered, reading ceases and the bytes up to and
14421452
/// including the delimiter are returned.
@@ -1512,36 +1522,17 @@ pub trait Buffer: Reader {
15121522
None => Err(standard_error(InvalidInput))
15131523
}
15141524
}
1515-
}
15161525

1517-
/// Extension methods for the Buffer trait which are included in the prelude.
1518-
pub trait BufferPrelude {
15191526
/// Create an iterator that reads a utf8-encoded character on each iteration
15201527
/// until EOF.
15211528
///
15221529
/// # Error
15231530
///
15241531
/// Any error other than `EndOfFile` that is produced by the underlying Reader
15251532
/// is returned by the iterator and should be handled by the caller.
1526-
fn chars<'r>(&'r mut self) -> Chars<'r, Self>;
1527-
1528-
/// Create an iterator that reads a line on each iteration until EOF.
1529-
///
1530-
/// # Error
1531-
///
1532-
/// Any error other than `EndOfFile` that is produced by the underlying Reader
1533-
/// is returned by the iterator and should be handled by the caller.
1534-
fn lines<'r>(&'r mut self) -> Lines<'r, Self>;
1535-
}
1536-
1537-
impl<T: Buffer> BufferPrelude for T {
1538-
fn chars<'r>(&'r mut self) -> Chars<'r, T> {
1533+
fn chars<'r>(&'r mut self) -> Chars<'r, Self> {
15391534
Chars { buffer: self }
15401535
}
1541-
1542-
fn lines<'r>(&'r mut self) -> Lines<'r, T> {
1543-
Lines { buffer: self }
1544-
}
15451536
}
15461537

15471538
/// When seeking, the resulting cursor is offset from a base by the offset given
@@ -2012,8 +2003,4 @@ mod tests {
20122003
assert_eq!(format!("{}", ALL_PERMISSIONS), "0777".to_string());
20132004
assert_eq!(format!("{}", USER_READ | USER_WRITE | OTHER_WRITE), "0602".to_string());
20142005
}
2015-
2016-
fn _ensure_buffer_is_object_safe<T: Buffer>(x: &T) -> &Buffer {
2017-
x as &Buffer
2018-
}
20192006
}

branches/try/src/libstd/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#[doc(no_inline)] pub use path::{GenericPath, Path, PosixPath, WindowsPath};
7474
#[doc(no_inline)] pub use ptr::{RawPtr, RawMutPtr};
7575
#[doc(no_inline)] pub use result::{Result, Ok, Err};
76-
#[doc(no_inline)] pub use io::{Buffer, Writer, Reader, Seek, BufferPrelude};
76+
#[doc(no_inline)] pub use io::{Buffer, Writer, Reader, Seek};
7777
#[doc(no_inline)] pub use str::{Str, StrVector, StrPrelude};
7878
#[doc(no_inline)] pub use str::{IntoMaybeOwned, StrAllocating, UnicodeStrPrelude};
7979
#[doc(no_inline)] pub use to_string::{ToString, IntoStr};

0 commit comments

Comments
 (0)