Skip to content

Commit ebd9e06

Browse files
committed
---
yaml --- r: 275180 b: refs/heads/stable c: 901eca9 h: refs/heads/master
1 parent 0e8a783 commit ebd9e06

File tree

41 files changed

+282
-382
lines changed

Some content is hidden

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

41 files changed

+282
-382
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: df33fc352d7b6aecc0ccadbfaf56484991cb80be
32+
refs/heads/stable: 901eca9e6ce7a527e1014fda3301e6ddf1365096
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,8 +3564,9 @@ Each instance of a trait object includes:
35643564
each method of `SomeTrait` that `T` implements, a pointer to `T`'s
35653565
implementation (i.e. a function pointer).
35663566

3567-
The purpose of trait objects is to permit "late binding" of methods. A call to
3568-
a method on a trait object is only resolved to a vtable entry at compile time.
3567+
The purpose of trait objects is to permit "late binding" of methods. Calling a
3568+
method on a trait object results in virtual dispatch at runtime: that is, a
3569+
function pointer is loaded from the trait object vtable and invoked indirectly.
35693570
The actual implementation for each vtable entry can vary on an object-by-object
35703571
basis.
35713572

branches/stable/src/etc/licenseck.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# except according to those terms.
1010

1111
import re
12+
import os
1213

1314
license_re = re.compile(
1415
u"""(#|//) Copyright .* The Rust Project Developers. See the COPYRIGHT
@@ -40,8 +41,9 @@
4041
]
4142

4243
def check_license(name, contents):
44+
name = os.path.normpath(name)
4345
# Whitelist check
44-
if any(name.endswith(e) for e in exceptions):
46+
if any(name.endswith(os.path.normpath(e)) for e in exceptions):
4547
return True
4648

4749
# Xfail check

branches/stable/src/etc/tidy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def interesting_file(f):
122122
'src/liblibc',
123123
}
124124

125-
if any(d in dirpath for d in skippable_dirs):
125+
dirpath = os.path.normpath(dirpath)
126+
if any(os.path.normpath(d) in dirpath for d in skippable_dirs):
126127
continue
127128

128129
file_names = [os.path.join(dirpath, f) for f in filenames

branches/stable/src/libcollections/borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ pub enum Cow<'a, B: ?Sized + 'a>
9595
{
9696
/// Borrowed data.
9797
#[stable(feature = "rust1", since = "1.0.0")]
98-
Borrowed(#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] &'a B),
98+
Borrowed(#[stable(feature = "rust1", since = "1.0.0")] &'a B),
9999

100100
/// Owned data.
101101
#[stable(feature = "rust1", since = "1.0.0")]
102102
Owned(
103-
#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] <B as ToOwned>::Owned
103+
#[stable(feature = "rust1", since = "1.0.0")] <B as ToOwned>::Owned
104104
),
105105
}
106106

branches/stable/src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@ pub enum Entry<'a, K: 'a, V: 'a> {
238238
/// A vacant Entry
239239
#[stable(feature = "rust1", since = "1.0.0")]
240240
Vacant(
241-
#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] VacantEntry<'a, K, V>
241+
#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>
242242
),
243243

244244
/// An occupied Entry
245245
#[stable(feature = "rust1", since = "1.0.0")]
246246
Occupied(
247-
#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] OccupiedEntry<'a, K, V>
247+
#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>
248248
),
249249
}
250250

branches/stable/src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl<T> [T] {
407407
}
408408

409409
/// Returns an iterator over `size` elements of the slice at a
410-
/// time. The chunks do not overlap. If `size` does not divide the
410+
/// time. The chunks are slices and do not overlap. If `size` does not divide the
411411
/// length of the slice, then the last chunk will not have length
412412
/// `size`.
413413
///
@@ -433,7 +433,7 @@ impl<T> [T] {
433433
}
434434

435435
/// Returns an iterator over `chunk_size` elements of the slice at a time.
436-
/// The chunks are mutable and do not overlap. If `chunk_size` does
436+
/// The chunks are mutable slices, and do not overlap. If `chunk_size` does
437437
/// not divide the length of the slice, then the last chunk will not
438438
/// have length `chunk_size`.
439439
///

branches/stable/src/libcore/intrinsics.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,5 @@ extern "rust-intrinsic" {
586586
/// platforms this is a `*mut *mut T` which is filled in by the compiler and
587587
/// on MSVC it's `*mut [usize; 2]`. For more information see the compiler's
588588
/// source as well as std's catch implementation.
589-
#[cfg(not(stage0))]
590589
pub fn try(f: fn(*mut u8), data: *mut u8, local_ptr: *mut u8) -> i32;
591-
#[cfg(stage0)]
592-
pub fn try(f: fn(*mut u8), data: *mut u8) -> *mut u8;
593590
}

branches/stable/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub enum Option<T> {
169169
None,
170170
/// Some value `T`
171171
#[stable(feature = "rust1", since = "1.0.0")]
172-
Some(#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] T)
172+
Some(#[stable(feature = "rust1", since = "1.0.0")] T)
173173
}
174174

175175
/////////////////////////////////////////////////////////////////////////////

branches/stable/src/libcore/result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ use option::Option::{self, None, Some};
250250
pub enum Result<T, E> {
251251
/// Contains the success value
252252
#[stable(feature = "rust1", since = "1.0.0")]
253-
Ok(#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] T),
253+
Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
254254

255255
/// Contains the error value
256256
#[stable(feature = "rust1", since = "1.0.0")]
257-
Err(#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] E)
257+
Err(#[stable(feature = "rust1", since = "1.0.0")] E)
258258
}
259259

260260
/////////////////////////////////////////////////////////////////////////////

branches/stable/src/libgetopts/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,8 @@ impl Matches {
331331
/// Returns the string argument supplied to one of several matching options or `None`.
332332
pub fn opts_str(&self, names: &[String]) -> Option<String> {
333333
for nm in names {
334-
match self.opt_val(&nm[..]) {
335-
Some(Val(ref s)) => return Some(s.clone()),
336-
_ => (),
334+
if let Some(Val(ref s)) = self.opt_val(&nm[..]) {
335+
return Some(s.clone())
337336
}
338337
}
339338
None

branches/stable/src/liblibc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 1b1eea2cdd77c63d73ba0b09b905a91910d1c992
1+
Subproject commit 16f1c190afbc7605ed50a40f802189e436de68f6

branches/stable/src/librustc_trans/back/link.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,8 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
226226
}
227227

228228
fn get_symbol_hash<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> String {
229-
match ccx.type_hashcodes().borrow().get(&t) {
230-
Some(h) => return h.to_string(),
231-
None => {}
229+
if let Some(h) = ccx.type_hashcodes().borrow().get(&t) {
230+
return h.to_string()
232231
}
233232

234233
let mut symbol_hasher = ccx.symbol_hasher().borrow_mut();
@@ -315,9 +314,8 @@ pub fn mangle<PI: Iterator<Item=InternedString>>(path: PI, hash: Option<&str>) -
315314
push(&mut n, &data);
316315
}
317316

318-
match hash {
319-
Some(s) => push(&mut n, s),
320-
None => {}
317+
if let Some(s) = hash {
318+
push(&mut n, s)
321319
}
322320

323321
n.push('E'); // End name-sequence.

branches/stable/src/librustc_trans/trans/base.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ impl Drop for _InsnCtxt {
150150
pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
151151
debug!("new InsnCtxt: {}", s);
152152
TASK_LOCAL_INSN_KEY.with(|slot| {
153-
match slot.borrow_mut().as_mut() {
154-
Some(ctx) => ctx.push(s),
155-
None => {}
153+
if let Some(ctx) = slot.borrow_mut().as_mut() {
154+
ctx.push(s)
156155
}
157156
});
158157
_InsnCtxt {
@@ -198,9 +197,8 @@ fn get_extern_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
198197
name: &str,
199198
did: DefId)
200199
-> ValueRef {
201-
match ccx.externs().borrow().get(name) {
202-
Some(n) => return *n,
203-
None => (),
200+
if let Some(n) = ccx.externs().borrow().get(name) {
201+
return *n;
204202
}
205203

206204
let f = declare::declare_rust_fn(ccx, name, fn_ty);
@@ -238,9 +236,8 @@ pub fn get_extern_const<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
238236
-> ValueRef {
239237
let name = ccx.sess().cstore.item_symbol(did);
240238
let ty = type_of(ccx, t);
241-
match ccx.externs().borrow_mut().get(&name) {
242-
Some(n) => return *n,
243-
None => (),
239+
if let Some(n) = ccx.externs().borrow_mut().get(&name) {
240+
return *n;
244241
}
245242
// FIXME(nagisa): perhaps the map of externs could be offloaded to llvm somehow?
246243
// FIXME(nagisa): investigate whether it can be changed into define_global
@@ -2755,9 +2752,8 @@ fn contains_null(s: &str) -> bool {
27552752
pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
27562753
debug!("get_item_val(id=`{}`)", id);
27572754

2758-
match ccx.item_vals().borrow().get(&id).cloned() {
2759-
Some(v) => return v,
2760-
None => {}
2755+
if let Some(v) = ccx.item_vals().borrow().get(&id).cloned() {
2756+
return v;
27612757
}
27622758

27632759
let item = ccx.tcx().map.get(id);

branches/stable/src/librustc_trans/trans/common.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,8 @@ pub fn C_u8(ccx: &CrateContext, i: u8) -> ValueRef {
947947
// our boxed-and-length-annotated strings.
948948
pub fn C_cstr(cx: &CrateContext, s: InternedString, null_terminated: bool) -> ValueRef {
949949
unsafe {
950-
match cx.const_cstr_cache().borrow().get(&s) {
951-
Some(&llval) => return llval,
952-
None => ()
950+
if let Some(&llval) = cx.const_cstr_cache().borrow().get(&s) {
951+
return llval;
953952
}
954953

955954
let sc = llvm::LLVMConstStringInContext(cx.llcx(),

branches/stable/src/librustc_trans/trans/type_of.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ pub fn type_of_fn_from_ty<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, fty: Ty<'tcx>)
182182
// recursive types. For example, enum types rely on this behavior.
183183

184184
pub fn sizing_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Type {
185-
match cx.llsizingtypes().borrow().get(&t).cloned() {
186-
Some(t) => return t,
187-
None => ()
185+
if let Some(t) = cx.llsizingtypes().borrow().get(&t).cloned() {
186+
return t;
188187
}
189188

190189
debug!("sizing_type_of {:?}", t);
@@ -317,9 +316,8 @@ pub fn type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Type {
317316
/// NB: If you update this, be sure to update `sizing_type_of()` as well.
318317
pub fn in_memory_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Type {
319318
// Check the cache.
320-
match cx.lltypes().borrow().get(&t) {
321-
Some(&llty) => return llty,
322-
None => ()
319+
if let Some(&llty) = cx.lltypes().borrow().get(&t) {
320+
return llty;
323321
}
324322

325323
debug!("type_of {:?}", t);

branches/stable/src/librustdoc/html/render.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,18 +2734,19 @@ fn make_item_keywords(it: &clean::Item) -> String {
27342734

27352735
fn get_index_search_type(item: &clean::Item,
27362736
parent: Option<String>) -> Option<IndexItemFunctionType> {
2737-
let decl = match item.inner {
2738-
clean::FunctionItem(ref f) => &f.decl,
2739-
clean::MethodItem(ref m) => &m.decl,
2740-
clean::TyMethodItem(ref m) => &m.decl,
2737+
let (decl, selfty) = match item.inner {
2738+
clean::FunctionItem(ref f) => (&f.decl, None),
2739+
clean::MethodItem(ref m) => (&m.decl, Some(&m.self_)),
2740+
clean::TyMethodItem(ref m) => (&m.decl, Some(&m.self_)),
27412741
_ => return None
27422742
};
27432743

27442744
let mut inputs = Vec::new();
27452745

27462746
// Consider `self` an argument as well.
2747-
if let Some(name) = parent {
2748-
inputs.push(Type { name: Some(name.to_ascii_lowercase()) });
2747+
match parent.and_then(|p| selfty.map(|s| (p, s)) ) {
2748+
Some((_, &clean::SelfStatic)) | None => (),
2749+
Some((name, _)) => inputs.push(Type { name: Some(name.to_ascii_lowercase()) }),
27492750
}
27502751

27512752
inputs.extend(&mut decl.inputs.values.iter().map(|arg| {

branches/stable/src/librustdoc/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,8 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
385385
*s.borrow_mut() = analysis.take();
386386
});
387387

388-
match matches.opt_str("crate-name") {
389-
Some(name) => krate.name = name,
390-
None => {}
388+
if let Some(name) = matches.opt_str("crate-name") {
389+
krate.name = name
391390
}
392391

393392
// Process all of the crate attributes, extracting plugin metadata along

branches/stable/src/libstd/collections/hash/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,13 +1402,13 @@ pub enum Entry<'a, K: 'a, V: 'a> {
14021402
/// An occupied Entry.
14031403
#[stable(feature = "rust1", since = "1.0.0")]
14041404
Occupied(
1405-
#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] OccupiedEntry<'a, K, V>
1405+
#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>
14061406
),
14071407

14081408
/// A vacant Entry.
14091409
#[stable(feature = "rust1", since = "1.0.0")]
14101410
Vacant(
1411-
#[cfg_attr(not(stage0), stable(feature = "rust1", since = "1.0.0"))] VacantEntry<'a, K, V>
1411+
#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>
14121412
),
14131413
}
14141414

branches/stable/src/libstd/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub enum VarError {
218218
/// valid unicode data. The found data is returned as a payload of this
219219
/// variant.
220220
#[stable(feature = "env", since = "1.0.0")]
221-
NotUnicode(#[cfg_attr(not(stage0), stable(feature = "env", since = "1.0.0"))] OsString),
221+
NotUnicode(#[stable(feature = "env", since = "1.0.0")] OsString),
222222
}
223223

224224
#[stable(feature = "env", since = "1.0.0")]

0 commit comments

Comments
 (0)