Skip to content

Commit 868c30c

Browse files
committed
---
yaml --- r: 137212 b: refs/heads/release-prep c: 1f7a8bc h: refs/heads/master v: v3
1 parent 956d5fd commit 868c30c

39 files changed

+123
-406
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2929
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
3030
refs/heads/libuv-update-temp-branch: 6ed22c618766f1f2a2e108eef8ce3f51be0f70b7
3131
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
32-
refs/heads/release-prep: 027d6b4d5301edb1595c23bd55bd893f53a726b7
32+
refs/heads/release-prep: 1f7a8bcb4b804c9198c2b7315368c9bf8226dfb5

branches/release-prep/mk/docs.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ HTML_DEPS += doc/version_info.html
112112
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
113113
$(wildcard $(D)/*.*) | doc/
114114
@$(call E, version-info: $@)
115-
$(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; \
116-
s/SHORT_HASH/$(CFG_SHORT_VER_HASH)/; \
115+
$(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$( \
116+
CFG_SHORT_VER_HASH)/; \
117117
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
118118

119119
GENERATED += doc/version.tex doc/version_info.html

branches/release-prep/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ endif
246246
######################################################################
247247

248248
# FIXME: x86-ism
249-
LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser mcjit \
249+
LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit \
250250
interpreter instrumentation
251251

252252
# Only build these LLVM tools

branches/release-prep/src/doc/guide.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ struct Point {
961961
}
962962

963963
fn main() {
964-
let origin = Point { x: 0i, y: 0i };
964+
let origin = Point { x: 0i, y: 0i };
965965

966966
println!("The origin is at ({}, {})", origin.x, origin.y);
967967
}
@@ -988,7 +988,7 @@ struct Point {
988988
}
989989
990990
fn main() {
991-
let mut point = Point { x: 0i, y: 0i };
991+
let mut point = Point { x: 0i, y: 0i };
992992
993993
point.x = 5;
994994
@@ -1140,13 +1140,13 @@ You can have any number of values in an enum:
11401140
```{rust}
11411141
enum OptionalColor {
11421142
Color(int, int, int),
1143-
Missing,
1143+
Missing
11441144
}
11451145
```
11461146

11471147
Enums with values are quite useful, but as I mentioned, they're even more
11481148
useful when they're generic across types. But before we get to generics, let's
1149-
talk about how to fix these big `if`/`else` statements we've been writing. We'll
1149+
talk about how to fix this big `if`/`else` statements we've been writing. We'll
11501150
do that with `match`.
11511151

11521152
# Match
@@ -1561,7 +1561,7 @@ println!("The second name is: {}", names[1]);
15611561

15621562
These subscripts start at zero, like in most programming languages, so the
15631563
first name is `names[0]` and the second name is `names[1]`. The above example
1564-
prints `The second name is: Brian`.
1564+
prints `The second name is Brian`.
15651565

15661566
There's a whole lot more to vectors, but that's enough to get started. We have
15671567
now learned all of the most basic Rust concepts. We're ready to start building
@@ -2084,7 +2084,7 @@ fn main() {
20842084
match cmp(input, secret_number) {
20852085
Less => println!("Too small!"),
20862086
Greater => println!("Too big!"),
2087-
Equal => println!("You win!"),
2087+
Equal => { println!("You win!"); },
20882088
}
20892089
}
20902090
@@ -2176,12 +2176,14 @@ fn main() {
21762176
.expect("Failed to read line");
21772177
let input_num: Option<uint> = from_str(input.as_slice());
21782178
2179+
2180+
21792181
println!("You guessed: {}", input_num);
21802182
21812183
match cmp(input_num, secret_number) {
21822184
Less => println!("Too small!"),
21832185
Greater => println!("Too big!"),
2184-
Equal => println!("You win!"),
2186+
Equal => { println!("You win!"); },
21852187
}
21862188
}
21872189
@@ -2239,7 +2241,7 @@ fn main() {
22392241
match cmp(num, secret_number) {
22402242
Less => println!("Too small!"),
22412243
Greater => println!("Too big!"),
2242-
Equal => println!("You win!"),
2244+
Equal => { println!("You win!"); },
22432245
}
22442246
}
22452247
@@ -2305,7 +2307,7 @@ fn main() {
23052307
match cmp(num, secret_number) {
23062308
Less => println!("Too small!"),
23072309
Greater => println!("Too big!"),
2308-
Equal => println!("You win!"),
2310+
Equal => { println!("You win!"); },
23092311
}
23102312
}
23112313
@@ -2380,7 +2382,7 @@ fn main() {
23802382
match cmp(num, secret_number) {
23812383
Less => println!("Too small!"),
23822384
Greater => println!("Too big!"),
2383-
Equal => println!("You win!"),
2385+
Equal => { println!("You win!"); },
23842386
}
23852387
}
23862388
}
@@ -2617,7 +2619,7 @@ Rust's more unique features.
26172619

26182620
Rust features a strong module system, but it works a bit differently than in
26192621
other programming languages. Rust's module system has two main components:
2620-
**crate**s and **module**s.
2622+
**crate**s, and **module**s.
26212623

26222624
A crate is Rust's unit of independent compilation. Rust always compiles one
26232625
crate at a time, producing either a library or an executable. However, executables
@@ -2638,7 +2640,6 @@ Enough talk, let's build something! Let's make a new project called `modules`.
26382640
```{bash,ignore}
26392641
$ cd ~/projects
26402642
$ cargo new modules --bin
2641-
$ cd modules
26422643
```
26432644

26442645
Let's double check our work by compiling:
@@ -3621,7 +3622,7 @@ let x = box 5i;
36213622
```
36223623

36233624
This allocates an integer `5` on the heap, and creates a binding `x` that
3624-
refers to it. The great thing about boxed pointers is that we don't have to
3625+
refers to it.. The great thing about boxed pointers is that we don't have to
36253626
manually free this allocation! If we write
36263627

36273628
```{rust}
@@ -3993,7 +3994,7 @@ Let's make a closure:
39933994
```{rust}
39943995
let add_one = |x| { 1i + x };
39953996
3996-
println!("The sum of 5 plus 1 is {}.", add_one(5i));
3997+
println!("The 5 plus 1 is {}.", add_one(5i));
39973998
```
39983999

39994000
We create a closure using the `|...| { ... }` syntax, and then we create a
@@ -4088,7 +4089,7 @@ fn main() {
40884089
}
40894090
```
40904091

4091-
Let's break the example down, starting with `main`:
4092+
Let's break example down, starting with `main`:
40924093

40934094
```{rust}
40944095
let square = |x: int| { x * x };
@@ -4209,7 +4210,7 @@ loop {
42094210
match range.next() {
42104211
Some(x) => {
42114212
println!("{}", x);
4212-
},
4213+
}
42134214
None => { break }
42144215
}
42154216
}

branches/release-prep/src/doc/rustdoc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub use std::option::Option;
6767
```
6868

6969
Doc comments are markdown, and are currently parsed with the
70-
[hoedown][hoedown] library. rustdoc does not yet do any fanciness such as
70+
[sundown][sundown] library. rustdoc does not yet do any fanciness such as
7171
referencing other items inline, like javadoc's `@see`. One exception to this
7272
is that the first paragraph will be used as the "summary" of an item in the
7373
generated documentation:
@@ -123,7 +123,7 @@ documentation. There is a search bar at the top, which is powered by some
123123
JavaScript and a statically-generated search index. No special web server is
124124
required for the search.
125125

126-
[hoedown]: https://github.com/hoedown/hoedown
126+
[sundown]: https://github.com/vmg/sundown/
127127

128128
# Testing the Documentation
129129

branches/release-prep/src/libcollections/str.rs

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -778,11 +778,13 @@ pub trait StrAllocating: Str {
778778
/// Returns the Levenshtein Distance between two strings.
779779
fn lev_distance(&self, t: &str) -> uint {
780780
let me = self.as_slice();
781-
if me.is_empty() { return t.char_len(); }
782-
if t.is_empty() { return me.char_len(); }
781+
let slen = me.len();
782+
let tlen = t.len();
783783

784-
let mut dcol = Vec::from_fn(t.len() + 1, |x| x);
785-
let mut t_last = 0;
784+
if slen == 0 { return tlen; }
785+
if tlen == 0 { return slen; }
786+
787+
let mut dcol = Vec::from_fn(tlen + 1, |x| x);
786788

787789
for (i, sc) in me.chars().enumerate() {
788790

@@ -797,15 +799,15 @@ pub trait StrAllocating: Str {
797799
*dcol.get_mut(j + 1) = current;
798800
} else {
799801
*dcol.get_mut(j + 1) = cmp::min(current, next);
800-
*dcol.get_mut(j + 1) = cmp::min(dcol[j + 1], dcol[j]) + 1;
802+
*dcol.get_mut(j + 1) = cmp::min(dcol[j + 1],
803+
dcol[j]) + 1;
801804
}
802805

803806
current = next;
804-
t_last = j;
805807
}
806808
}
807809

808-
dcol[t_last + 1]
810+
return dcol[tlen];
809811
}
810812

811813
/// Returns an iterator over the string in Unicode Normalization Form D
@@ -1876,27 +1878,6 @@ mod tests {
18761878
assert_eq!(words, vec!["Märy", "häd", "ä", "little", "lämb", "Little", "lämb"])
18771879
}
18781880

1879-
#[test]
1880-
fn test_lev_distance() {
1881-
use std::char::{ from_u32, MAX };
1882-
// Test bytelength agnosticity
1883-
for c in range(0u32, MAX as u32)
1884-
.filter_map(|i| from_u32(i))
1885-
.map(|i| String::from_char(1, i)) {
1886-
assert_eq!(c[].lev_distance(c[]), 0);
1887-
}
1888-
1889-
let a = "\nMäry häd ä little lämb\n\nLittle lämb\n";
1890-
let b = "\nMary häd ä little lämb\n\nLittle lämb\n";
1891-
let c = "Mary häd ä little lämb\n\nLittle lämb\n";
1892-
assert_eq!(a.lev_distance(b), 1);
1893-
assert_eq!(b.lev_distance(a), 1);
1894-
assert_eq!(a.lev_distance(c), 2);
1895-
assert_eq!(c.lev_distance(a), 2);
1896-
assert_eq!(b.lev_distance(c), 1);
1897-
assert_eq!(c.lev_distance(b), 1);
1898-
}
1899-
19001881
#[test]
19011882
fn test_nfd_chars() {
19021883
macro_rules! t {

branches/release-prep/src/libcore/atomic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ impl AtomicInt {
382382
/// # Examples
383383
///
384384
/// ```
385-
/// use std::sync::atomic::{AtomicInt, SeqCst};
385+
/// use std::sync::atomic::{AtomicUint, SeqCst};
386386
///
387-
/// let foo = AtomicInt::new(0b101101);
387+
/// let foo = AtomicUint::new(0b101101);
388388
/// assert_eq!(0b101101, foo.fetch_and(0b110011, SeqCst));
389389
/// assert_eq!(0b100001, foo.load(SeqCst));
390390
#[inline]
@@ -397,9 +397,9 @@ impl AtomicInt {
397397
/// # Examples
398398
///
399399
/// ```
400-
/// use std::sync::atomic::{AtomicInt, SeqCst};
400+
/// use std::sync::atomic::{AtomicUint, SeqCst};
401401
///
402-
/// let foo = AtomicInt::new(0b101101);
402+
/// let foo = AtomicUint::new(0b101101);
403403
/// assert_eq!(0b101101, foo.fetch_or(0b110011, SeqCst));
404404
/// assert_eq!(0b111111, foo.load(SeqCst));
405405
#[inline]
@@ -412,9 +412,9 @@ impl AtomicInt {
412412
/// # Examples
413413
///
414414
/// ```
415-
/// use std::sync::atomic::{AtomicInt, SeqCst};
415+
/// use std::sync::atomic::{AtomicUint, SeqCst};
416416
///
417-
/// let foo = AtomicInt::new(0b101101);
417+
/// let foo = AtomicUint::new(0b101101);
418418
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, SeqCst));
419419
/// assert_eq!(0b011110, foo.load(SeqCst));
420420
#[inline]

branches/release-prep/src/libcore/intrinsics.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,6 @@ extern "rust-intrinsic" {
250250
/// Abort the execution of the process.
251251
pub fn abort() -> !;
252252

253-
/// Tell LLVM that this point in the code is not reachable,
254-
/// enabling further optimizations.
255-
///
256-
/// NB: This is very different from the `unreachable!()` macro!
257-
#[cfg(not(stage0))]
258-
pub fn unreachable() -> !;
259-
260253
/// Execute a breakpoint trap, for inspection by a debugger.
261254
pub fn breakpoint();
262255

branches/release-prep/src/libnative/io/c_unix.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ mod signal {
232232
pub static SA_SIGINFO: libc::c_int = 0x0040;
233233
pub static SIGCHLD: libc::c_int = 20;
234234

235-
#[cfg(any(target_os = "macos", target_os = "ios"))]
235+
#[cfg(target_os = "macos")]
236+
#[cfg(target_os = "ios")]
236237
pub type sigset_t = u32;
237-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
238+
#[cfg(target_os = "freebsd")]
239+
#[cfg(target_os = "dragonfly")]
238240
#[repr(C)]
239241
pub struct sigset_t {
240242
bits: [u32, ..4],
@@ -252,7 +254,8 @@ mod signal {
252254
pub status: libc::c_int,
253255
}
254256

255-
#[cfg(any(target_os = "macos", target_os = "ios"))]
257+
#[cfg(target_os = "macos")]
258+
#[cfg(target_os = "ios")]
256259
#[repr(C)]
257260
pub struct sigaction {
258261
pub sa_handler: extern fn(libc::c_int),
@@ -261,7 +264,8 @@ mod signal {
261264
pub sa_flags: libc::c_int,
262265
}
263266

264-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
267+
#[cfg(target_os = "freebsd")]
268+
#[cfg(target_os = "dragonfly")]
265269
#[repr(C)]
266270
pub struct sigaction {
267271
pub sa_handler: extern fn(libc::c_int),

branches/release-prep/src/librustc/middle/resolve.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5852,8 +5852,11 @@ impl<'a> Resolver<'a> {
58525852
visit::walk_expr(self, expr);
58535853
}
58545854

5855-
ExprFnBlock(capture_clause, ref fn_decl, ref block) => {
5856-
self.capture_mode_map.insert(expr.id, capture_clause);
5855+
ExprFnBlock(_, ref fn_decl, ref block) => {
5856+
// NOTE(stage0): After snapshot, change to:
5857+
//
5858+
//self.capture_mode_map.insert(expr.id, capture_clause);
5859+
self.capture_mode_map.insert(expr.id, ast::CaptureByRef);
58575860
self.resolve_function(ClosureRibKind(expr.id, ast::DUMMY_NODE_ID),
58585861
Some(&**fn_decl), NoTypeParameters,
58595862
&**block);

branches/release-prep/src/librustc/middle/trans/debuginfo.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,7 +3164,8 @@ fn populate_scope_map(cx: &CrateContext,
31643164
parent_scope,
31653165
file_metadata,
31663166
loc.line as c_uint,
3167-
loc.col.to_uint() as c_uint)
3167+
loc.col.to_uint() as c_uint,
3168+
0)
31683169
};
31693170

31703171
scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata,
@@ -3289,7 +3290,8 @@ fn populate_scope_map(cx: &CrateContext,
32893290
parent_scope,
32903291
file_metadata,
32913292
loc.line as c_uint,
3292-
loc.col.to_uint() as c_uint)
3293+
loc.col.to_uint() as c_uint,
3294+
0)
32933295
};
32943296

32953297
scope_stack.push(ScopeStackEntry {

branches/release-prep/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: ty::t)
429429
tvec::make_drop_glue_unboxed(bcx, v0, ty, true)
430430
}
431431
ty::ty_str => {
432-
let unit_ty = ty::sequence_element_type(bcx.tcx(), t);
432+
let unit_ty = ty::sequence_element_type(bcx.tcx(), content_ty);
433433
tvec::make_drop_glue_unboxed(bcx, v0, unit_ty, true)
434434
}
435435
ty::ty_trait(..) => {

branches/release-prep/src/librustc/middle/trans/intrinsic.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,6 @@ pub fn trans_intrinsic_call<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, node: ast::N
228228
Unreachable(bcx);
229229
v
230230
}
231-
(_, "unreachable") => {
232-
Unreachable(bcx);
233-
C_nil(ccx)
234-
}
235231
(_, "breakpoint") => {
236232
let llfn = ccx.get_intrinsic(&("llvm.debugtrap"));
237233
Call(bcx, llfn, [], None)

0 commit comments

Comments
 (0)