-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 11 pull requests #32496
Rollup of 11 pull requests #32496
Commits on Mar 15, 2016
-
std: Fix inheriting stdin on status()
This regression was accidentally introduced in rust-lang#31618, and it's just flipping a boolean! Closes rust-lang#32254
Configuration menu - View commit details
-
Copy full SHA for 4124466 - Browse repository at this point
Copy the full SHA 4124466View commit details
Commits on Mar 22, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 3ee841c - Browse repository at this point
Copy the full SHA 3ee841cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2731dc1 - Browse repository at this point
Copy the full SHA 2731dc1View commit details
Commits on Mar 23, 2016
-
Remove ungrammatical dots from the error index.
They were probably meant as a shorthand for omitted code. Part of rust-lang#32446 but there should be a separate fix for the issue. Signed-off-by: NODA, Kai <nodakai@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0950dc3 - Browse repository at this point
Copy the full SHA 0950dc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for be87650 - Browse repository at this point
Copy the full SHA be87650View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80e7a1b - Browse repository at this point
Copy the full SHA 80e7a1bView commit details
Commits on Mar 24, 2016
-
Accept 0 as a valid str char boundary
Index 0 must be a valid char boundary (invariant of str that it contains valid UTF-8 data). If we check explicitly for index == 0, that removes the need to read the byte at index 0, so it avoids a trip to the string's memory, and it optimizes out the slicing index' bounds check whenever it is zero. With this change, the following examples all change from having a read of the byte at 0 and a branch to possibly panicing, to having the bounds checking optimized away. ```rust pub fn split(s: &str) -> (&str, &str) { s.split_at(0) } pub fn both(s: &str) -> &str { &s[0..s.len()] } pub fn first(s: &str) -> &str { &s[..0] } pub fn last(s: &str) -> &str { &s[0..] } ```
Configuration menu - View commit details
-
Copy full SHA for f621193 - Browse repository at this point
Copy the full SHA f621193View commit details -
Configuration menu - View commit details
-
Copy full SHA for 180d6b5 - Browse repository at this point
Copy the full SHA 180d6b5View commit details -
make available monomorphizations shared by CGU
The current setup means that all generics are local to a codegen-unit, which means massive duplication.
Configuration menu - View commit details
-
Copy full SHA for 13877ac - Browse repository at this point
Copy the full SHA 13877acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d4b1d1 - Browse repository at this point
Copy the full SHA 8d4b1d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77f033b - Browse repository at this point
Copy the full SHA 77f033bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b418cd2 - Browse repository at this point
Copy the full SHA b418cd2View commit details
Commits on Mar 25, 2016
-
Fix unsound behaviour with null characters in thread names (issue rus…
…t-lang#32475) Previously, the thread name (&str) was converted to a CString in the new thread, but outside unwind::try, causing a panic to continue into FFI. This patch changes that behaviour, so that the panic instead happens in the parent thread (where panic infrastructure is properly set up), not the new thread. This could potentially be a breaking change for architectures who don't support thread names. Signed-off-by: David Henningsson <diwic@ubuntu.com>
Configuration menu - View commit details
-
Copy full SHA for 78495d5 - Browse repository at this point
Copy the full SHA 78495d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bc2868 - Browse repository at this point
Copy the full SHA 5bc2868View commit details -
modify #[deriving(Eq)] to emit #[structural_match]
to careful use of the span from deriving, we can permit it in stable code if it derives from deriving (not-even-a-pun intended)
Configuration menu - View commit details
-
Copy full SHA for 99c2a6b - Browse repository at this point
Copy the full SHA 99c2a6bView commit details -
do not overwrite spans as eagerly
this was required to preserve the span from the #[structural_match] attribute -- but honestly I am not 100% sure if it makes sense.
Configuration menu - View commit details
-
Copy full SHA for 05baf64 - Browse repository at this point
Copy the full SHA 05baf64View commit details -
issue a future-compat lint for constants of invalid type
This is a [breaking-change]: according to RFC rust-lang#1445, constants used as patterns must be of a type that *derives* `Eq`. If you encounter a problem, you are most likely using a constant in an expression where the type of the constant is some struct that does not currently implement `Eq`. Something like the following: ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` The easiest and most future compatible fix is to annotate the type in question with `#[derive(Eq)]` (note that merely *implementing* `Eq` is not enough, it must be *derived*): ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` Another good option is to rewrite the match arm to use an `if` condition (this is also particularly good for floating point types, which implement `PartialEq` but not `Eq`): ```rust match foo { c if c == SOME_CONST => ... } ``` Finally, a third alternative is to tag the type with `#[structural_match]`; but this is not recommended, as the attribute is never expected to be stabilized. Please see RFC rust-lang#1445 for more details.
Configuration menu - View commit details
-
Copy full SHA for f69eb8e - Browse repository at this point
Copy the full SHA f69eb8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 73b4f06 - Browse repository at this point
Copy the full SHA 73b4f06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56ebf2b - Browse repository at this point
Copy the full SHA 56ebf2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f661ec - Browse repository at this point
Copy the full SHA 7f661ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 93e4443 - Browse repository at this point
Copy the full SHA 93e4443View commit details -
Configuration menu - View commit details
-
Copy full SHA for e539b74 - Browse repository at this point
Copy the full SHA e539b74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 944dc4a - Browse repository at this point
Copy the full SHA 944dc4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2536ae5 - Browse repository at this point
Copy the full SHA 2536ae5View commit details
Commits on Mar 26, 2016
-
Rollup merge of rust-lang#32131 - petrochenkov:prim, r=eddyb
resolve: Minimize hacks in name resolution of primitive types When resolving the first unqualified segment in a path with `n` segments and `n - 1` associated item segments, e.g. (`a` or `a::assoc` or `a::assoc::assoc` etc) try to resolve `a` without considering primitive types first. If the "normal" lookup fails or results in a module, then try to resolve `a` as a primitive type as a fallback. This way backward compatibility is respected, but the restriction from E0317 can be lifted, i.e. primitive names mostly can be shadowed like any other names. Furthermore, if names of primitive types are [put into prelude](https://github.com/petrochenkov/rust/tree/prim2) (now it's possible to do), then most of names will be resolved in conventional way and amount of code relying on this fallback will be greatly reduced. Although, it's not entirely convenient to put them into prelude right now due to temporary conflicts like `use prelude::v1::*; use usize;` in libcore/libstd, I'd better wait for proper glob shadowing before doing it. I wish the `no_prelude` attribute were unstable as intended :( cc @jseyfried @arielb1 r? @eddyb
Configuration menu - View commit details
-
Copy full SHA for b8b17a5 - Browse repository at this point
Copy the full SHA b8b17a5View commit details -
Rollup merge of rust-lang#32199 - nikomatsakis:limiting-constants-in-…
…patterns-2, r=pnkfelix Restrict constants in patterns This implements [RFC 1445](https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md). The primary change is to limit the types of constants used in patterns to those that *derive* `Eq` (note that implementing `Eq` is not sufficient). This has two main effects: 1. Floating point constants are linted, and will eventually be disallowed. This is because floating point constants do not implement `Eq` but only `PartialEq`. This check replaces the existing special case code that aimed to detect the use of `NaN`. 2. Structs and enums must derive `Eq` to be usable within a match. This is a [breaking-change]: if you encounter a problem, you are most likely using a constant in an expression where the type of the constant is some struct that does not currently implement `Eq`. Something like the following: ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` The easiest and most future compatible fix is to annotate the type in question with `#[derive(Eq)]` (note that merely *implementing* `Eq` is not enough, it must be *derived*): ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` Another good option is to rewrite the match arm to use an `if` condition (this is also particularly good for floating point types, which implement `PartialEq` but not `Eq`): ```rust match foo { c if c == SOME_CONST => ... } ``` Finally, a third alternative is to tag the type with `#[structural_match]`; but this is not recommended, as the attribute is never expected to be stabilized. Please see RFC rust-lang#1445 for more details. cc rust-lang#31434 r? @pnkfelix
Configuration menu - View commit details
-
Copy full SHA for 128b2ad - Browse repository at this point
Copy the full SHA 128b2adView commit details -
Rollup merge of rust-lang#32257 - alexcrichton:fix-status-stdin, r=at…
…uron std: Fix inheriting stdin on status() This regression was accidentally introduced in rust-lang#31618, and it's just flipping a boolean! Closes rust-lang#32254
Configuration menu - View commit details
-
Copy full SHA for a8d59e0 - Browse repository at this point
Copy the full SHA a8d59e0View commit details -
Rollup merge of rust-lang#32435 - nrc:fix-err-recover, r=nikomatsakis
Some fixes for error recovery in the compiler
Configuration menu - View commit details
-
Copy full SHA for b55d772 - Browse repository at this point
Copy the full SHA b55d772View commit details -
Rollup merge of rust-lang#32447 - nodakai:dots-in-err-idx, r=Manishearth
Remove ungrammatical dots from the error index. They were probably meant as a shorthand for omitted code. Part of rust-lang#32446 but there should be a separate fix for the issue.
Configuration menu - View commit details
-
Copy full SHA for 515e87d - Browse repository at this point
Copy the full SHA 515e87dView commit details -
Rollup merge of rust-lang#32448 - sfackler:time-augmented-assignment,…
… r=alexcrichton Add augmented assignment operator impls for time types r? @alexcrichton
Configuration menu - View commit details
-
Copy full SHA for 023fae6 - Browse repository at this point
Copy the full SHA 023fae6View commit details -
Rollup merge of rust-lang#32456 - bluss:str-zero, r=alexcrichton
Hardcode accepting 0 as a valid str char boundary If we check explicitly for index == 0, that removes the need to read the byte at index 0, so it avoids a trip to the string's memory, and it optimizes out the slicing index' bounds check whenever it is (a constant) zero.
Configuration menu - View commit details
-
Copy full SHA for 6710278 - Browse repository at this point
Copy the full SHA 6710278View commit details -
Rollup merge of rust-lang#32469 - nikomatsakis:shared-cgu, r=eddyb
make available monomorphizations shared by CGU The current setup means that all generics are local to a codegen-unit, which means massive duplication.
Configuration menu - View commit details
-
Copy full SHA for e3e5824 - Browse repository at this point
Copy the full SHA e3e5824View commit details -
Rollup merge of rust-lang#32476 - diwic:63-null-thread-name, r=alexcr…
…ichton Fix unsound behaviour with null characters in thread names (issue rust-lang#32475) Previously, the thread name (&str) was converted to a CString in the new thread, but outside unwind::try, causing a panic to continue into FFI. This patch changes that behaviour, so that the panic instead happens in the parent thread (where panic infrastructure is properly set up), not the new thread. This could potentially be a breaking change for architectures who don't support thread names.
Configuration menu - View commit details
-
Copy full SHA for d36cb22 - Browse repository at this point
Copy the full SHA d36cb22View commit details -
Rollup merge of rust-lang#32482 - nikomatsakis:erase-via-visitor, r=n…
…agisa use new visitor to erase regions r? @nagisa
Configuration menu - View commit details
-
Copy full SHA for 317acb7 - Browse repository at this point
Copy the full SHA 317acb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c10866 - Browse repository at this point
Copy the full SHA 6c10866View commit details