Skip to content

Rollup of 15 pull requests #22281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
995b159
rustdoc: Show must_use attribute
sanxiyn Feb 12, 2015
00a6ff9
Adjusting default CPUs for iOS
vhbit Feb 12, 2015
985fc7d
std: Optimize Vec::from_iter
alexcrichton Feb 11, 2015
3df5c4a
Update LLVM to disable asserts in the PassInfo cache
dotdash Feb 12, 2015
9c686dc
Correct typo for 'underyling'
duaneedwards Feb 12, 2015
3d9528a
Unstabilise `words` for now.
huonw Feb 13, 2015
e4a9eb9
Remove `_VALUE` from the float extremes constants.
huonw Feb 13, 2015
c5dba72
Remove reference to mailing list
iKevinY Feb 13, 2015
c6a647a
Replace map(|x| *x) with cloned().
ruuda Feb 13, 2015
1c7cb8b
Relpace map(|x| x.clone()) with cloned().
ruuda Feb 13, 2015
539866b
Replace map(|x| (*x).clone()) with cloned().
ruuda Feb 13, 2015
805a31f
Improve documentation for `Select::new()`.
steveklabnik Feb 13, 2015
58a7d58
Re-word paragraph about enums and equality
steveklabnik Feb 13, 2015
d414a39
Re-tag `slicing_syntax` as `Accepted`.
pnkfelix Feb 13, 2015
c9ad0d1
Revert incorrect map(|x| *x) -> cloned() substitutions.
ruuda Feb 13, 2015
a7d5c3f
Added all active features to the list in reference.md.
pnkfelix Feb 13, 2015
fb05f28
Add `#[rustc_error]` annotation, which causes trans to signal an error
nikomatsakis Feb 12, 2015
f48eda8
Fix small copy-paste typo
unode Feb 13, 2015
add3ba6
Rollup merge of #22200 - alexcrichton:opt-vec-collect, r=huonw
steveklabnik Feb 13, 2015
6f03875
Rollup merge of #22224 - sanxiyn:must-use, r=cmr
steveklabnik Feb 13, 2015
7c27d41
Rollup merge of #22229 - vhbit:ios-default-cpus, r=alexcrichton
steveklabnik Feb 13, 2015
f62eea1
Rollup merge of #22238 - dotdash:llvmup_20150212, r=alexcrichton
steveklabnik Feb 13, 2015
d1fbf55
Rollup merge of #22248 - duaneedwards:patch-1, r=Gankro
steveklabnik Feb 13, 2015
1603ed9
Rollup merge of #22253 - huonw:unstable-words, r=aturon
steveklabnik Feb 13, 2015
db01550
Rollup merge of #22254 - huonw:float-value--, r=aturon
steveklabnik Feb 13, 2015
9c9c0f6
Rollup merge of #22263 - iKevinY:no-mailing-list, r=nikomatsakis
steveklabnik Feb 13, 2015
7813bbb
Rollup merge of #22268 - steveklabnik:improve_wait, r=nikomatsakis
steveklabnik Feb 13, 2015
13a0e5a
Rollup merge of #22271 - steveklabnik:gh22035, r=nikomatsakis
steveklabnik Feb 13, 2015
e354763
Rollup merge of #22274 - pnkfelix:retag-slicing-syntax-as-accepted, r…
steveklabnik Feb 13, 2015
af595a3
Rollup merge of #22276 - ruud-v-a:map-clone, r=nikomatsakis
steveklabnik Feb 13, 2015
ad1cec6
Rollup merge of #22277 - pnkfelix:reference-update-feature-gate-list,…
steveklabnik Feb 13, 2015
aa91900
Rollup merge of #22278 - nikomatsakis:rustc-error, r=nikomatsakis
steveklabnik Feb 13, 2015
ee96742
Rollup merge of #22280 - Unode:patch-1, r=steveklabnik
steveklabnik Feb 13, 2015
7ac46e1
Remove slicing_syntax feature gate
steveklabnik Feb 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/doc/complement-bugreport.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ $ RUST_BACKTRACE=1 rustc ...

# I submitted a bug, but nobody has commented on it!

This is sad, but does happen sometimes, since we're short-staffed. If you
submit a bug and you haven't received a comment on it within 3 business days,
it's entirely reasonable to either ask on the #rust IRC channel,
or post on the [rust-dev mailing list](https://mail.mozilla.org/listinfo/rust-dev)
to ask what the status of the bug is.
This is sad, but does happen sometimes, since we're short-staffed. If you submit a
bug and you haven't received a comment on it within 3 business days, it's entirely
reasonable to ask about the status of the bug in #rust on irc.mozilla.org.
2 changes: 1 addition & 1 deletion src/doc/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ segfault when we allocate more memory?

The answer is that in the C++ version, `x` is a *reference* to the memory
location where the first element of the array is stored. But in Ruby, `x` is a
standalone value, not connected to the underyling array at all. Let's dig into
standalone value, not connected to the underlying array at all. Let's dig into
the details for a moment. Your program has access to memory, provided to it by
the operating system. Each location in memory has an address. So when we make
our vector, `v`, it's stored in a memory location somewhere:
Expand Down
62 changes: 52 additions & 10 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2377,21 +2377,33 @@ considered off, and using the features will result in a compiler error.

The currently implemented features of the reference compiler are:

* `advanced_slice_patterns` - see the [match expressions](#match-expressions)
section for discussion; the exact semantics of
slice patterns are subject to change.

* `asm` - The `asm!` macro provides a means for inline assembly. This is often
useful, but the exact syntax for this feature along with its
semantics are likely to change, so this macro usage must be opted
into.

* `associated_types` - Allows type aliases in traits. Experimental.

* `box_patterns` - Allows `box` patterns, the exact semantics of which
is subject to change.

* `box_syntax` - Allows use of `box` expressions, the exact semantics of which
is subject to change.

* `concat_idents` - Allows use of the `concat_idents` macro, which is in many
ways insufficient for concatenating identifiers, and may be
removed entirely for something more wholesome.

* `default_type_params` - Allows use of default type parameters. The future of
this feature is uncertain.

* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
are inherently unstable and no promise about them is made.

* `int_uint` - Allows the use of the `int` and `uint` types, which are deprecated.
Use `isize` and `usize` instead.

* `lang_items` - Allows use of the `#[lang]` attribute. Like `intrinsics`,
lang items are inherently unstable and no promise about them
is made.
Expand All @@ -2410,12 +2422,33 @@ The currently implemented features of the reference compiler are:
* `log_syntax` - Allows use of the `log_syntax` macro attribute, which is a
nasty hack that will certainly be removed.

* `main` - Allows use of the `#[main]` attribute, which changes the entry point
into a Rust program. This capabiilty is subject to change.

* `macro_reexport` - Allows macros to be re-exported from one crate after being imported
from another. This feature was originally designed with the sole
use case of the Rust standard library in mind, and is subject to
change.

* `non_ascii_idents` - The compiler supports the use of non-ascii identifiers,
but the implementation is a little rough around the
edges, so this can be seen as an experimental feature
for now until the specification of identifiers is fully
fleshed out.

* `no_std` - Allows the `#![no_std]` crate attribute, which disables the implicit
`extern crate std`. This typically requires use of the unstable APIs
behind the libstd "facade", such as libcore and libcollections. It
may also cause problems when using syntax extensions, including
`#[derive]`.

* `on_unimplemented` - Allows the `#[rustc_on_unimplemented]` attribute, which allows
trait definitions to add specialized notes to error messages
when an implementation was expected but not found.

* `optin_builtin_traits` - Allows the definition of default and negative trait
implementations. Experimental.

* `plugin` - Usage of [compiler plugins][plugin] for custom lints or syntax extensions.
These depend on compiler internals and are subject to change.

Expand All @@ -2431,8 +2464,15 @@ The currently implemented features of the reference compiler are:
* `simd` - Allows use of the `#[simd]` attribute, which is overly simple and
not the SIMD interface we want to expose in the long term.

* `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions.
The SIMD interface is subject to change.

* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate

* `start` - Allows use of the `#[start]` attribute, which changes the entry point
into a Rust program. This capabiilty, especially the signature for the
annotated function, is subject to change.

* `struct_inherit` - Allows using struct inheritance, which is barely
implemented and will probably be removed. Don't use this.

Expand Down Expand Up @@ -2460,18 +2500,20 @@ The currently implemented features of the reference compiler are:
which is considered wildly unsafe and will be
obsoleted by language improvements.

* `unsafe_no_drop_flag` - Allows use of the `#[unsafe_no_drop_flag]` attribute,
which removes hidden flag added to a type that
implements the `Drop` trait. The design for the
`Drop` flag is subject to change, and this feature
may be removed in the future.

* `unmarked_api` - Allows use of items within a `#![staged_api]` crate
which have not been marked with a stability marker.
Such items should not be allowed by the compiler to exist,
so if you need this there probably is a compiler bug.

* `associated_types` - Allows type aliases in traits. Experimental.

* `no_std` - Allows the `#![no_std]` crate attribute, which disables the implicit
`extern crate std`. This typically requires use of the unstable APIs
behind the libstd "facade", such as libcore and libcollections. It
may also cause problems when using syntax extensions, including
`#[derive]`.
* `visible_private_types` - Allows public APIs to expose otherwise private
types, e.g. as the return type of a public function.
This capability may be removed in the future.

If a feature is promoted to a language feature, then all existing programs will
start to receive compilation warnings about #[feature] directives which enabled
Expand Down
13 changes: 5 additions & 8 deletions src/doc/trpl/compound-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,12 @@ let four_is_smaller = four <= ten;
let four_equals_ten = four == ten;
```

This may seem rather limiting, particularly equality being invalid; in
many cases however, it's unnecessary. Rust provides the [`match`][match]
keyword, which will be examined in more detail in the next section, which
often allows better and easier branch control than a series of `if`/`else`
statements would. However, for our [game][game] we need the comparisons
to work so we will utilize the `Ordering` `enum` provided by the standard
library which supports such comparisons. It has this form:
This may seem rather limiting, but it's a limitation which we can overcome.
There are two ways: by implementing equality ourselves, or by using the
[`match`][match] keyword. We don't know enough about Rust to implement equality
yet, but we can use the `Ordering` enum from the standard library, which does:

```{rust}
```
enum Ordering {
Less,
Equal,
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ not work:

```{ignore}
fn print_sum(x, y) {
println!("x is: {}", x + y);
println!("sum is: {}", x + y);
}
```

Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ mod tests {
#[test]
fn test_from_bools() {
let bools = vec![true, false, true, true];
let bitv: Bitv = bools.iter().map(|n| *n).collect();
let bitv: Bitv = bools.iter().cloned().collect();
assert_eq!(format!("{:?}", bitv), "1011");
}

Expand All @@ -2295,12 +2295,12 @@ mod tests {
#[test]
fn test_bitv_iterator() {
let bools = vec![true, false, true, true];
let bitv: Bitv = bools.iter().map(|n| *n).collect();
let bitv: Bitv = bools.iter().cloned().collect();

assert_eq!(bitv.iter().collect::<Vec<bool>>(), bools);

let long: Vec<_> = (0i32..10000).map(|i| i % 2 == 0).collect();
let bitv: Bitv = long.iter().map(|n| *n).collect();
let bitv: Bitv = long.iter().cloned().collect();
assert_eq!(bitv.iter().collect::<Vec<bool>>(), long)
}

Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ impl<A: Ord> Ord for DList<A> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<A: Clone> Clone for DList<A> {
fn clone(&self) -> DList<A> {
self.iter().map(|x| x.clone()).collect()
self.iter().cloned().collect()
}
}

Expand Down Expand Up @@ -1013,7 +1013,7 @@ mod tests {

#[cfg(test)]
fn list_from<T: Clone>(v: &[T]) -> DList<T> {
v.iter().map(|x| (*x).clone()).collect()
v.iter().cloned().collect()
}

#[test]
Expand Down
3 changes: 2 additions & 1 deletion src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,8 @@ pub trait StrExt: Index<RangeFull, Output = str> {
/// let v: Vec<&str> = some_words.words().collect();
/// assert_eq!(v, vec!["Mary", "had", "a", "little", "lamb"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[unstable(feature = "str_words",
reason = "the precise algorithm to use is unclear")]
fn words(&self) -> Words {
UnicodeStr::words(&self[])
}
Expand Down
12 changes: 11 additions & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,17 @@ impl<T> FromIterator<T> for Vec<T> {
fn from_iter<I:Iterator<Item=T>>(iterator: I) -> Vec<T> {
let (lower, _) = iterator.size_hint();
let mut vector = Vec::with_capacity(lower);
for element in iterator {

let mut i = iterator.fuse();
for element in i.by_ref().take(vector.capacity()) {
let len = vector.len();
unsafe {
ptr::write(vector.get_unchecked_mut(len), element);
vector.set_len(len + 1);
}
}

for element in i {
vector.push(element)
}
vector
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub trait IteratorExt: Iterator + Sized {
///
/// ```
/// let xs = [100, 200, 300];
/// let mut it = xs.iter().map(|x| *x).peekable();
/// let mut it = xs.iter().cloned().peekable();
/// assert_eq!(*it.peek().unwrap(), 100);
/// assert_eq!(it.next().unwrap(), 100);
/// assert_eq!(it.next().unwrap(), 200);
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#![feature(int_uint)]
#![feature(intrinsics, lang_items)]
#![feature(on_unimplemented)]
#![feature(simd, unsafe_destructor, slicing_syntax)]
#![feature(simd, unsafe_destructor)]
#![feature(staged_api)]
#![feature(unboxed_closures)]

Expand Down
19 changes: 16 additions & 3 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,27 @@ pub const EPSILON: f32 = 1.19209290e-07_f32;

/// Smallest finite f32 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f32::MIN`")]
pub const MIN_VALUE: f32 = -3.40282347e+38_f32;
/// Smallest positive, normalized f32 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f32::MIN_POSITIVE`")]
pub const MIN_POS_VALUE: f32 = 1.17549435e-38_f32;
/// Largest finite f32 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f32::MAX`")]
pub const MAX_VALUE: f32 = 3.40282347e+38_f32;

/// Smallest finite f32 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MIN: f32 = -3.40282347e+38_f32;
/// Smallest positive, normalized f32 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MIN_POSITIVE: f32 = 1.17549435e-38_f32;
/// Largest finite f32 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MAX: f32 = 3.40282347e+38_f32;

#[unstable(feature = "core", reason = "pending integer conventions")]
pub const MIN_EXP: int = -125;
#[unstable(feature = "core", reason = "pending integer conventions")]
Expand Down Expand Up @@ -215,17 +228,17 @@ impl Float for f32 {
#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn min_value() -> f32 { MIN_VALUE }
fn min_value() -> f32 { MIN }

#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn min_pos_value(_: Option<f32>) -> f32 { MIN_POS_VALUE }
fn min_pos_value(_: Option<f32>) -> f32 { MIN_POSITIVE }

#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn max_value() -> f32 { MAX_VALUE }
fn max_value() -> f32 { MAX }

/// Returns the mantissa, exponent and sign as integers.
fn integer_decode(self) -> (u64, i16, i8) {
Expand Down
19 changes: 16 additions & 3 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,27 @@ pub const EPSILON: f64 = 2.2204460492503131e-16_f64;

/// Smallest finite f64 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f64::MIN`")]
pub const MIN_VALUE: f64 = -1.7976931348623157e+308_f64;
/// Smallest positive, normalized f64 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f64::MIN_POSITIVE`")]
pub const MIN_POS_VALUE: f64 = 2.2250738585072014e-308_f64;
/// Largest finite f64 value
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.0.0", reason = "use `std::f64::MAX`")]
pub const MAX_VALUE: f64 = 1.7976931348623157e+308_f64;

/// Smallest finite f64 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MIN: f64 = -1.7976931348623157e+308_f64;
/// Smallest positive, normalized f64 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MIN_POSITIVE: f64 = 2.2250738585072014e-308_f64;
/// Largest finite f64 value
#[stable(feature = "rust1", since = "1.0.0")]
pub const MAX: f64 = 1.7976931348623157e+308_f64;

#[unstable(feature = "core", reason = "pending integer conventions")]
pub const MIN_EXP: int = -1021;
#[unstable(feature = "core", reason = "pending integer conventions")]
Expand Down Expand Up @@ -222,17 +235,17 @@ impl Float for f64 {
#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn min_value() -> f64 { MIN_VALUE }
fn min_value() -> f64 { MIN }

#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn min_pos_value(_: Option<f64>) -> f64 { MIN_POS_VALUE }
fn min_pos_value(_: Option<f64>) -> f64 { MIN_POSITIVE }

#[inline]
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0")]
fn max_value() -> f64 { MAX_VALUE }
fn max_value() -> f64 { MAX }

/// Returns the mantissa, exponent and sign as integers.
fn integer_decode(self) -> (u64, i16, i8) {
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ macro_rules! impl_to_primitive_float_to_float {
Some($slf as $DstT)
} else {
let n = $slf as f64;
let max_value: $SrcT = ::$SrcT::MAX_VALUE;
let max_value: $SrcT = ::$SrcT::MAX;
if -max_value as f64 <= n && n <= max_value as f64 {
Some($slf as $DstT)
} else {
Expand Down Expand Up @@ -1331,18 +1331,18 @@ pub trait Float
/// Returns the smallest finite value that this type can represent.
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0",
reason = "use `std::f32::MIN_VALUE` or `std::f64::MIN_VALUE` as appropriate")]
reason = "use `std::f32::MIN` or `std::f64::MIN` as appropriate")]
fn min_value() -> Self;
/// Returns the smallest normalized positive number that this type can represent.
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0",
reason = "use `std::f32::MIN_POS_VALUE` or \
`std::f64::MIN_POS_VALUE` as appropriate")]
reason = "use `std::f32::MIN_POSITIVE` or \
`std::f64::MIN_POSITIVE` as appropriate")]
fn min_pos_value(unused_self: Option<Self>) -> Self;
/// Returns the largest finite value that this type can represent.
#[unstable(feature = "core")]
#[deprecated(since = "1.0.0",
reason = "use `std::f32::MAX_VALUE` or `std::f64::MAX_VALUE` as appropriate")]
reason = "use `std::f32::MAX` or `std::f64::MAX` as appropriate")]
fn max_value() -> Self;

/// Returns true if this value is NaN and false otherwise.
Expand Down
2 changes: 1 addition & 1 deletion src/libcoretest/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ fn test_random_access_inspect() {
fn test_random_access_map() {
let xs = [1, 2, 3, 4, 5];

let mut it = xs.iter().map(|x| *x);
let mut it = xs.iter().cloned();
assert_eq!(xs.len(), it.indexable());
for (i, elt) in xs.iter().enumerate() {
assert_eq!(Some(*elt), it.idx(i));
Expand Down
Loading