Skip to content

Commit 1661894

Browse files
committed
---
yaml --- r: 274107 b: refs/heads/stable c: 4349cda h: refs/heads/master i: 274105: 6128714 274103: 6d1debc
1 parent bcb1a0b commit 1661894

File tree

110 files changed

+2813
-1987
lines changed

Some content is hidden

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

110 files changed

+2813
-1987
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: 7ffd408d86e3fc9b8e9aafaef20ec4e096f1b55b
32+
refs/heads/stable: 4349cdae9c8428a520d2b1182c7094846f5418d5
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/configure

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ CFG_SELF="$0"
550550
CFG_CONFIGURE_ARGS="$@"
551551

552552

553-
case "${CFG_SRC_DIR}" in
553+
case "${CFG_SRC_DIR}" in
554554
*\ * )
555555
err "The path to the rust source directory contains spaces, which is not supported"
556556
;;
@@ -892,6 +892,13 @@ then
892892
CFG_DISABLE_JEMALLOC=1
893893
fi
894894

895+
if [ $CFG_OSTYPE = pc-windows-gnu ]
896+
then
897+
# FIXME(#31030) - there's not a great reason to disable jemalloc here
898+
step_msg "on Windows, disabling jemalloc"
899+
CFG_DISABLE_JEMALLOC=1
900+
fi
901+
895902
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
896903
# system, so if we find that gcc is clang, we should just use clang directly.
897904
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
@@ -1035,7 +1042,7 @@ then
10351042
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10361043
then
10371044
case $CFG_OSX_CLANG_VERSION in
1038-
(7.0*)
1045+
(7.0* | 7.1* | 7.2*)
10391046
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10401047
;;
10411048
(*)

branches/stable/src/doc/book/lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is
353353
fn get_mut(&mut self) -> &mut T; // elided
354354
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded
355355
356-
fn args<T:ToCStr>(&mut self, args: &[T]) -> &mut Command; // elided
357-
fn args<'a, 'b, T:ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command; // expanded
356+
fn args<T: ToCStr>(&mut self, args: &[T]) -> &mut Command; // elided
357+
fn args<'a, 'b, T: ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command; // expanded
358358
359359
fn new(buf: &mut [u8]) -> BufWriter; // elided
360360
fn new<'a>(buf: &'a mut [u8]) -> BufWriter<'a>; // expanded

branches/stable/src/doc/book/macros.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,11 @@ This expands to
285285

286286
```text
287287
const char *state = "reticulating splines";
288-
int state = get_log_state();
289-
if (state > 0) {
290-
printf("log(%d): %s\n", state, state);
288+
{
289+
int state = get_log_state();
290+
if (state > 0) {
291+
printf("log(%d): %s\n", state, state);
292+
}
291293
}
292294
```
293295

branches/stable/src/doc/nomicon/lifetime-elision.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ fn frob(s: &str, t: &str) -> &str; // ILLEGAL
5555
fn get_mut(&mut self) -> &mut T; // elided
5656
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded
5757
58-
fn args<T:ToCStr>(&mut self, args: &[T]) -> &mut Command // elided
59-
fn args<'a, 'b, T:ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command // expanded
58+
fn args<T: ToCStr>(&mut self, args: &[T]) -> &mut Command // elided
59+
fn args<'a, 'b, T: ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command // expanded
6060
6161
fn new(buf: &mut [u8]) -> BufWriter; // elided
6262
fn new<'a>(buf: &'a mut [u8]) -> BufWriter<'a> // expanded

branches/stable/src/jemalloc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f84e30927284b0c500ed3eaf09e8e159da20ddaf
1+
Subproject commit e24a1a025a1f214e40eedafe3b9c7b1d69937922

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,8 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
10271027
}
10281028
self.node.as_leaf_mut().len -= 1;
10291029

1030+
left_node.as_leaf_mut().len += right_len as u16 + 1;
1031+
10301032
if self.node.height > 1 {
10311033
ptr::copy_nonoverlapping(
10321034
right_node.cast_unchecked().as_internal().edges.as_ptr(),
@@ -1058,8 +1060,6 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
10581060
);
10591061
}
10601062

1061-
left_node.as_leaf_mut().len += right_len as u16 + 1;
1062-
10631063
Handle::new_edge(self.node, self.idx)
10641064
}
10651065
}

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

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use core::cmp::Ordering::{self, Less, Greater, Equal};
1515
use core::fmt::Debug;
1616
use core::fmt;
17-
use core::iter::{Peekable, Map, FromIterator};
17+
use core::iter::{Peekable, FromIterator};
1818
use core::ops::{BitOr, BitAnd, BitXor, Sub};
1919

2020
use borrow::Borrow;
@@ -52,12 +52,12 @@ pub struct Iter<'a, T: 'a> {
5252
/// An owning iterator over a BTreeSet's items.
5353
#[stable(feature = "rust1", since = "1.0.0")]
5454
pub struct IntoIter<T> {
55-
iter: Map<::btree_map::IntoIter<T, ()>, fn((T, ())) -> T>,
55+
iter: ::btree_map::IntoIter<T, ()>,
5656
}
5757

5858
/// An iterator over a sub-range of BTreeSet's items.
5959
pub struct Range<'a, T: 'a> {
60-
iter: Map<::btree_map::Range<'a, T, ()>, fn((&'a T, &'a ())) -> &'a T>,
60+
iter: ::btree_map::Range<'a, T, ()>,
6161
}
6262

6363
/// A lazy iterator producing elements in the set difference (in-order).
@@ -160,12 +160,7 @@ impl<T: Ord> BTreeSet<T> {
160160
-> Range<'a, T>
161161
where T: Borrow<Min> + Borrow<Max>
162162
{
163-
fn first<A, B>((a, _): (A, B)) -> A {
164-
a
165-
}
166-
let first: fn((&'a T, &'a ())) -> &'a T = first; // coerce to fn pointer
167-
168-
Range { iter: self.map.range(min, max).map(first) }
163+
Range { iter: self.map.range(min, max) }
169164
}
170165
}
171166

@@ -548,12 +543,7 @@ impl<T> IntoIterator for BTreeSet<T> {
548543
/// assert_eq!(v, [1, 2, 3, 4]);
549544
/// ```
550545
fn into_iter(self) -> IntoIter<T> {
551-
fn first<A, B>((a, _): (A, B)) -> A {
552-
a
553-
}
554-
let first: fn((T, ())) -> T = first; // coerce to fn pointer
555-
556-
IntoIter { iter: self.map.into_iter().map(first) }
546+
IntoIter { iter: self.map.into_iter() }
557547
}
558548
}
559549

@@ -721,7 +711,7 @@ impl<T> Iterator for IntoIter<T> {
721711
type Item = T;
722712

723713
fn next(&mut self) -> Option<T> {
724-
self.iter.next()
714+
self.iter.next().map(|(k, _)| k)
725715
}
726716
fn size_hint(&self) -> (usize, Option<usize>) {
727717
self.iter.size_hint()
@@ -730,7 +720,7 @@ impl<T> Iterator for IntoIter<T> {
730720
#[stable(feature = "rust1", since = "1.0.0")]
731721
impl<T> DoubleEndedIterator for IntoIter<T> {
732722
fn next_back(&mut self) -> Option<T> {
733-
self.iter.next_back()
723+
self.iter.next_back().map(|(k, _)| k)
734724
}
735725
}
736726
#[stable(feature = "rust1", since = "1.0.0")]
@@ -746,12 +736,12 @@ impl<'a, T> Iterator for Range<'a, T> {
746736
type Item = &'a T;
747737

748738
fn next(&mut self) -> Option<&'a T> {
749-
self.iter.next()
739+
self.iter.next().map(|(k, _)| k)
750740
}
751741
}
752742
impl<'a, T> DoubleEndedIterator for Range<'a, T> {
753743
fn next_back(&mut self) -> Option<&'a T> {
754-
self.iter.next_back()
744+
self.iter.next_back().map(|(k, _)| k)
755745
}
756746
}
757747

branches/stable/src/libcollections/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@
348348
//! The fill character is provided normally in conjunction with the `width`
349349
//! parameter. This indicates that if the value being formatted is smaller than
350350
//! `width` some extra characters will be printed around it. The extra
351-
//! characters are specified by `fill`, and the alignment can be one of two
352-
//! options:
351+
//! characters are specified by `fill`, and the alignment can be one of the
352+
//! following options:
353353
//!
354354
//! * `<` - the argument is left-aligned in `width` columns
355355
//! * `^` - the argument is center-aligned in `width` columns

branches/stable/src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl str {
302302
/// # Safety
303303
///
304304
/// Callers of this function are responsible that three preconditions are
305-
/// satisifed:
305+
/// satisfied:
306306
///
307307
/// * `begin` must come before `end`.
308308
/// * `begin` and `end` must be byte positions within the string slice.
@@ -345,7 +345,7 @@ impl str {
345345
/// # Safety
346346
///
347347
/// Callers of this function are responsible that three preconditions are
348-
/// satisifed:
348+
/// satisfied:
349349
///
350350
/// * `begin` must come before `end`.
351351
/// * `begin` and `end` must be byte positions within the string slice.

branches/stable/src/libcollectionstest/btree/set.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,13 @@ fn test_recovery() {
254254

255255
assert_eq!(s.iter().next(), None);
256256
}
257+
258+
#[test]
259+
fn test_variance() {
260+
use std::collections::btree_set::{IntoIter, Iter, Range};
261+
262+
fn set<'new>(v: BTreeSet<&'static str>) -> BTreeSet<&'new str> { v }
263+
fn iter<'a, 'new>(v: Iter<'a, &'static str>) -> Iter<'a, &'new str> { v }
264+
fn into_iter<'new>(v: IntoIter<&'static str>) -> IntoIter<&'new str> { v }
265+
fn range<'a, 'new>(v: Range<'a, &'static str>) -> Range<'a, &'new str> { v }
266+
}

branches/stable/src/libcore/marker.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ macro_rules! impls{
333333
/// use std::marker::PhantomData;
334334
///
335335
/// # #[allow(dead_code)]
336-
/// struct Slice<'a, T:'a> {
336+
/// struct Slice<'a, T: 'a> {
337337
/// start: *const T,
338338
/// end: *const T,
339339
/// phantom: PhantomData<&'a T>
@@ -428,18 +428,18 @@ mod impls {
428428
/// use std::any::Any;
429429
///
430430
/// # #[allow(dead_code)]
431-
/// fn foo<T:Reflect+'static>(x: &T) {
431+
/// fn foo<T: Reflect + 'static>(x: &T) {
432432
/// let any: &Any = x;
433433
/// if any.is::<u32>() { println!("u32"); }
434434
/// }
435435
/// ```
436436
///
437-
/// Without the declaration `T:Reflect`, `foo` would not type check
437+
/// Without the declaration `T: Reflect`, `foo` would not type check
438438
/// (note: as a matter of style, it would be preferable to write
439-
/// `T:Any`, because `T:Any` implies `T:Reflect` and `T:'static`, but
439+
/// `T: Any`, because `T: Any` implies `T: Reflect` and `T: 'static`, but
440440
/// we use `Reflect` here to show how it works). The `Reflect` bound
441441
/// thus serves to alert `foo`'s caller to the fact that `foo` may
442-
/// behave differently depending on whether `T=u32` or not. In
442+
/// behave differently depending on whether `T = u32` or not. In
443443
/// particular, thanks to the `Reflect` bound, callers know that a
444444
/// function declared like `fn bar<T>(...)` will always act in
445445
/// precisely the same way no matter what type `T` is supplied,

0 commit comments

Comments
 (0)