Skip to content

Commit d8f2c8c

Browse files
committed
---
yaml --- r: 137197 b: refs/heads/release-prep c: fe8f430 h: refs/heads/master i: 137195: 57082dc v: v3
1 parent e0a2638 commit d8f2c8c

File tree

9 files changed

+38
-134
lines changed

9 files changed

+38
-134
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: 5ca68d4ac15c8ca056306928a5197030a50d3873
32+
refs/heads/release-prep: fe8f43030a710eeee1043061145abf2b47c5e601

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-
[sundown][sundown] library. rustdoc does not yet do any fanciness such as
70+
[hoedown][hoedown] 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-
[sundown]: https://github.com/vmg/sundown/
126+
[hoedown]: https://github.com/hoedown/hoedown
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/librustc/middle/trans/reflect.rs

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,6 @@ impl<'a, 'blk, 'tcx> Reflector<'a, 'blk, 'tcx> {
127127
self.visit(name, []);
128128
}
129129

130-
fn visit_closure_ty(&mut self, fty: &ty::ClosureTy, is_unboxed: bool) {
131-
let pureval = ast_fn_style_constant(fty.fn_style);
132-
let sigilval = match fty.store {
133-
ty::UniqTraitStore => 2u,
134-
ty::RegionTraitStore(..) => 4u,
135-
};
136-
let retval = if ty::type_is_bot(fty.sig.output) {0u} else {1u};
137-
let extra = vec!(self.c_uint(pureval),
138-
self.c_uint(sigilval),
139-
self.c_uint(fty.sig.inputs.len()),
140-
self.c_uint(retval));
141-
self.visit("enter_fn", extra.as_slice());
142-
self.visit_sig(retval, &fty.sig, is_unboxed);
143-
self.visit("leave_fn", extra.as_slice());
144-
}
145-
146130
// Entrypoint
147131
pub fn visit_ty(&mut self, t: ty::t) {
148132
let bcx = self.bcx;
@@ -263,8 +247,20 @@ impl<'a, 'blk, 'tcx> Reflector<'a, 'blk, 'tcx> {
263247

264248
// FIXME (#2594): fetch constants out of intrinsic
265249
// FIXME (#4809): visitor should break out bare fns from other fns
266-
ty::ty_closure(box ref fty) => {
267-
self.visit_closure_ty(fty, false);
250+
ty::ty_closure(ref fty) => {
251+
let pureval = ast_fn_style_constant(fty.fn_style);
252+
let sigilval = match fty.store {
253+
ty::UniqTraitStore => 2u,
254+
ty::RegionTraitStore(..) => 4u,
255+
};
256+
let retval = if ty::type_is_bot(fty.sig.output) {0u} else {1u};
257+
let extra = vec!(self.c_uint(pureval),
258+
self.c_uint(sigilval),
259+
self.c_uint(fty.sig.inputs.len()),
260+
self.c_uint(retval));
261+
self.visit("enter_fn", extra.as_slice());
262+
self.visit_sig(retval, &fty.sig);
263+
self.visit("leave_fn", extra.as_slice());
268264
}
269265

270266
// FIXME (#2594): fetch constants out of intrinsic:: for the
@@ -278,7 +274,7 @@ impl<'a, 'blk, 'tcx> Reflector<'a, 'blk, 'tcx> {
278274
self.c_uint(fty.sig.inputs.len()),
279275
self.c_uint(retval));
280276
self.visit("enter_fn", extra.as_slice());
281-
self.visit_sig(retval, &fty.sig, false);
277+
self.visit_sig(retval, &fty.sig);
282278
self.visit("leave_fn", extra.as_slice());
283279
}
284280

@@ -392,30 +388,16 @@ impl<'a, 'blk, 'tcx> Reflector<'a, 'blk, 'tcx> {
392388
// Miscellaneous extra types
393389
ty::ty_infer(_) => self.leaf("infer"),
394390
ty::ty_err => self.leaf("err"),
395-
ty::ty_unboxed_closure(ref def_id, _) => {
396-
let closure_map = tcx.unboxed_closures.borrow();
397-
let fty = &closure_map.find(def_id).unwrap().closure_type;
398-
self.visit_closure_ty(fty, true);
399-
}
391+
ty::ty_unboxed_closure(..) => self.leaf("err"),
400392
ty::ty_param(ref p) => {
401393
let extra = vec!(self.c_uint(p.idx));
402394
self.visit("param", extra.as_slice())
403395
}
404396
}
405397
}
406398

407-
pub fn visit_sig(&mut self, retval: uint, sig: &ty::FnSig, is_unboxed: bool) {
408-
let args = if is_unboxed {
409-
match ty::get(sig.inputs[0]).sty {
410-
ty::ty_tup(ref contents) => contents.iter(),
411-
ty::ty_nil => [].iter(),
412-
_ => unreachable!()
413-
}
414-
} else {
415-
sig.inputs.iter()
416-
};
417-
418-
for (i, arg) in args.enumerate() {
399+
pub fn visit_sig(&mut self, retval: uint, sig: &ty::FnSig) {
400+
for (i, arg) in sig.inputs.iter().enumerate() {
419401
let modeval = 5u; // "by copy"
420402
let extra = vec!(self.c_uint(i),
421403
self.c_uint(modeval),

branches/release-prep/src/librustc/middle/typeck/infer/error_reporting.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -869,19 +869,6 @@ impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx> {
869869
ast::TypeImplItem(_) => None,
870870
}
871871
},
872-
ast_map::NodeTraitItem(ref item) => {
873-
match **item {
874-
ast::ProvidedMethod(ref m) => {
875-
Some((m.pe_fn_decl(),
876-
m.pe_generics(),
877-
m.pe_fn_style(),
878-
m.pe_ident(),
879-
Some(&m.pe_explicit_self().node),
880-
m.span))
881-
}
882-
_ => None
883-
}
884-
}
885872
_ => None
886873
},
887874
None => None

branches/release-prep/src/libstd/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,10 @@ impl<'a> Writer for Box<Writer+'a> {
12931293

12941294
impl<'a> Writer for &'a mut Writer+'a {
12951295
#[inline]
1296-
fn write(&mut self, buf: &[u8]) -> IoResult<()> { (**self).write(buf) }
1296+
fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.write(buf) }
12971297

12981298
#[inline]
1299-
fn flush(&mut self) -> IoResult<()> { (**self).flush() }
1299+
fn flush(&mut self) -> IoResult<()> { self.flush() }
13001300
}
13011301

13021302
/// A `RefWriter` is a struct implementing `Writer` which contains a reference

branches/release-prep/src/test/compile-fail/issue-17758.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

branches/release-prep/src/test/run-pass/issue-17737.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)