about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-03-26Auto merge of #49341 - alexcrichton:more-balance, r=kennytmbors-0/+7
appveyor: Move run-pass-fulldeps to extra builders We've made headway towards splitting the test suite across two appveyor builders and this moves one more tests suite between builders. The last [failed build][fail] had its longest running test suite and I've moved that to the secondary builder. cc #48844 [fail]: https://ci.appveyor.com/project/rust-lang/rust/build/1.0.6782
2018-03-26Auto merge of #49297 - scottmcm:offset-from, r=dtolnaybors-4/+295
Introduce unsafe offset_from on pointers Adds intrinsics::exact_div to take advantage of the unsafe, which reduces the implementation from ```asm sub rcx, rdx mov rax, rcx sar rax, 63 shr rax, 62 lea rax, [rax + rcx] sar rax, 2 ret ``` down to ```asm sub rcx, rdx sar rcx, 2 mov rax, rcx ret ``` (for `*const i32`) See discussion on the `offset_to` tracking issue https://github.com/rust-lang/rust/issues/41079 Some open questions - Would you rather I split the intrinsic PR from the library PR? - Do we even want the safe version of the API? https://github.com/rust-lang/rust/issues/41079#issuecomment-374426786 I've added some text to its documentation that even if it's not UB, it's useless to use it between pointers into different objects. and todos - [x] ~~I need to make a codegen test~~ Done - [x] ~~Can the subtraction use nsw/nuw?~~ No, it can't https://github.com/rust-lang/rust/pull/49297#discussion_r176697574 - [x] ~~Should there be `usize` variants of this, like there are now `add` and `sub` that you almost always want over `offset`? For example, I imagine `sub_ptr` that returns `usize` and where it's UB if the distance is negative.~~ Can wait for later; C gives a signed result https://github.com/rust-lang/rust/issues/41079#issuecomment-375842235, so we might as well, and this existing to go with `offset` makes sense.
2018-03-25Auto merge of #49212 - kyrias:strip-debug-no-debuginfo, r=michaelwoeristerbors-1/+14
Pass --strip-debug to GccLinker when building without debuginfo C.f. #46034 --- This brings a hello-world built by passing rustc no command line options from 2.9M to 592K on Linux. (This might need to special case MacOS or Windows, not sure if the linkers there support `--strip-debug`, and there is an annoying lack of dependable docs for the linkers there.)
2018-03-25Auto merge of #49315 - TheDan64:smaller_unsafe_block, r=joshtriplettbors-7/+5
Reduce scope of unsafe block in sun_path_offset I reduced the scope of the unsafe block to the `uninitialized` call which is the only actual unsafe bit.
2018-03-24Fix doctest mutability copy-pastaScott McMurray-2/+2
2018-03-24Documentation and naming improvementsScott McMurray-15/+33
2018-03-25Auto merge of #49284 - alexcrichton:use-our-own-cache, r=kennytmbors-0/+32
ci: Don't use Travis caches for docker images This commit moves away from caching on Travis to our own caching on S3 for caching docker layers between builds. Unfortunately the Travis caches have over time had a few critical pain points: * Caches are only updated for successful builds, meaning that if a build times out or fails in a different location the sucessfully-created docker images isn't always cached. While this makes sense as a general rule of caches it hurts our use cases. * Caches are per-branch and builder which means that we don't have a separate cache on each release channel. All our merges go through the `auto` branch which means that they're all sharing the same cache, even those for merging to master/beta. This means that PRs which switch between master/beta will keep rebuilting and having cache misses. * Caches have historically been invaliated somewhat regularly a little more aggressively than we'd want (I think). * We don't always need to update the contents of the cache if the Docker image didn't change at all, and saving off the docker layers can sometimes be quite expensive. For all these reasons this commit drops the usage of Travis's built-in caching support. Instead our own caching is used by storing blobs to S3. Normally this would be a very risky endeavour but we're basically priming a cache for a cache (docker) so if we get this wrong the failure mode is longer builds, not stale caches. We'll notice that pretty quickly and hopefully fix it! The logic here is inserted directly into the `src/ci/docker/run.sh` script to download an image based on a shasum of the `Dockerfile` and other assorted files. This blob, if found, is loaded into docker and we record what layers were inserted. After docker finishes the build (hopefully quickly with lots of cache hits) we then see the sha of the final image. If it's one of the layers we loaded then there's no need to update the cache. Otherwise we upload our layers to the global cache, possibly overwriting what we previously just downloaded. This is hopefully a step towards mitigating #49278 although it doesn't completely fix it as it means we'll still probably have to retry builds that bust the cache.
2018-03-24Polyfill LLVMBuildExactUDivScott McMurray-0/+8
It was added 32 days after LLVM 3.9 shipped.
2018-03-25Auto merge of #49141 - gnzlbg:simd_select, r=alexcrichtonbors-0/+259
adds simd_select intrinsic The select SIMD intrinsic is used to select elements from two SIMD vectors using a mask: ```rust let mask = b8x4::new(true, false, false, true); let a = f32x4::new(1., 2., 3., 4.); let b = f32x4::new(5., 6., 7., 8.); assert_eq!(simd_select(mask, a, b), f32x4::new(1., 6., 7., 4.)); ``` The number of lanes between the mask and the vectors must match, but the vector width of the mask does not need to match that of the vectors. The mask is required to be a vector of signed integers. Note: this intrinsic will be exposed via `std::simd`'s vector masks - users are not expected to use it directly.
2018-03-24Add flag for telling the linker to strip debuginfo when building without itJohannes Löthberg-1/+14
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2018-03-24appveyor: Move run-pass-fulldeps to extra buildersAlex Crichton-0/+7
We've made headway towards splitting the test suite across two appveyor builders and this moves one more tests suite between builders. The last [failed build][fail] had its longest running test suite and I've moved that to the secondary builder. cc #48844 [fail]: https://ci.appveyor.com/project/rust-lang/rust/build/1.0.6782
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-171/+26
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25Rollup merge of #49318 - steveklabnik:update-books, r=kennytmkennytm-0/+0
update books for next release
2018-03-25Rollup merge of #49314 - Mark-Simulacrum:remove-getopts, r=alexcrichtonkennytm-1622/+0
Remove getopts leftover from tree This was attempted but left incomplete in PR #42664, where only the toml file was removed. cc @alexcrichton
2018-03-25Rollup merge of #49312 - GuillaumeGomez:fix-ie11-search, r=QuietMisdreavuskennytm-0/+7
Fix IE11 search Fixes #49263. r? @QuietMisdreavus I got this code from: https://stackoverflow.com/a/30867255/7879548
2018-03-25Rollup merge of #49290 - cuviper:unextended-dist-rustfmt, r=nikomatsakiskennytm-1/+0
Allow installing rustfmt without config.extended This assertion was preventing `./x.py install rustfmt` if attempted without an "extended" build configuration, but it actually builds and installs just fine.
2018-03-25Rollup merge of #49274 - oli-obk:slow_miri, r=michaelwoerister,eddybkennytm-58/+44
Remove slow HashSet during miri stack frame creation fixes #49237 probably has a major impact on #48846 r? @michaelwoerister cc @eddyb I know you kept telling me to use vectors instead of hash containers... Now I know why.
2018-03-25Rollup merge of #49273 - michaelwoerister:fix-extern-proc-macro-defkey, r=eddybkennytm-2/+19
Fix DefKey lookup for proc-macro crates. Add a special case for proc-macro crates for `def_key()` in the metadata decoder (like we already have for many other methods in there). In the long run, it would be preferable to get rid of the need for special casing proc-macro crates (see #49271). Fixes https://github.com/rust-lang/rust/issues/48739 (though I wasn't able to come up with a regression test, unfortunately) r? @eddyb
2018-03-25Rollup merge of #49268 - ordovicia:dotdot-pattern-diag, r=petrochenkovkennytm-1/+44
Better diagnostics for '..' pattern fragment not in the last position Fixes #49257.
2018-03-25Rollup merge of #49254 - Tacklebox:atan2_doc, r=QuietMisdreavuskennytm-8/+10
Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 and included that it returns radians None
2018-03-25Rollup merge of #49235 - topecongiro:run-rustfmt/libtest, r=nrckennytm-233/+182
Cargo fmt libtest r? @nrc Using `rustfmt 0.4.1- (87180d9 2018-03-16)` (`rustfmt --version` is a bit broken).
2018-03-25Rollup merge of #49229 - Centril:doc/format_args_display_debug, r=steveklabnikkennytm-6/+78
Document format_args! / Arguments<'a> behavior wrt. Display and Debug This is a follow up PR to #49067 , this documents the behavior of `format_args!` (i.e: `Argument<'a>`) wrt. `Display` and `Debug`. r? @steveklabnik
2018-03-25Rollup merge of #49203 - Eijebong:lets-cleanup-dependencies, r=Mark-Simulacrumkennytm-102/+12
Bump racer and home This removes 10 dependencies from the build :tada:
2018-03-25Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertjkennytm-124/+96
Make resuming generators unsafe instead of the creation of immovable generators cc @withoutboats Fixes #47787
2018-03-25Rollup merge of #49193 - davidtwco:issue-29893, r=alexcrichtonkennytm-45/+202
Host compiler documentation Fixes #29893. Rust Central Station PR: rust-lang/rust-central-station#40 r? @alexcrichton
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-61/+85
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25Rollup merge of #49122 - scottmcm:z-align-attr, r=cramertjkennytm-1/+3
Add a -Z flag for LLVM align attributes on arguments LLVM seems to still put the assume calls in when inlining, so this probably isn't in a place where it can be turned on by default, but it's interesting to experiment with. For example, this makes `mem::swap::<u64x8>` be 8x `vmovaps ymm` instead of 16x `vmovups xmm`, on my cpu.
2018-03-25Rollup merge of #49121 - varkor:stabilise-from_utf8_error_as_bytes, r=blusskennytm-2/+1
Stabilise FromUtf8Error::as_bytes Closes #40895.
2018-03-25Rollup merge of #49120 - Zoxc:parallel-ci, r=alexcrichtonkennytm-0/+9
Add a CI job for parallel rustc using x.py check r? @alexcrichton
2018-03-25Rollup merge of #49089 - alexcrichton:fix-timings, r=Mark-Simulacrumkennytm-54/+60
rustbuild: Tweak where timing information goes This commit tweaks where timing and step information is printed out as part of the build, ensuring that we do it as close to the location where work happens as possible. In rustbuild various functions may perform long blocking work as dependencies are assembled, so if we print out timing information early on we may accidentally time more than just the step we were intending to time!
2018-03-25Rollup merge of #49076 - bobdavelisafrank:filetype-metadata-docfix, r=blusskennytm-3/+32
Fix Issue #48345, is_file, is_dir, and is_symlink note mutual exclusion The methods on the structures `fs::FileType` and `fs::Metadata` of (respectively) `is_file`, `is_dir`, and `is_symlink` had some ambiguity in documentation, where it was not noted whether files will pass those tests exclusively or not. It is now written that the tests are mutually exclusive. Fixes #48345.
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-56/+118
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-24update books for next releasesteveklabnik-0/+0
2018-03-24Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertjbors-1107/+2081
support elision in impl headers You can now do things like: ``` impl MyTrait<'_> for &u32 { ... } ``` Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138). We do not support elision with deprecated forms: ``` impl MyTrait for std::cell::Ref<u32> { } // ERROR ``` Builds on the in-band lifetime stuff. r? @cramertj Fixes #15872
2018-03-23Add a codegen test for exact_div intrinsicScott McMurray-0/+30
2018-03-24Auto merge of #48552 - kennytm:lower-unstable-priority, r=nikomatsakisbors-92/+381
Lower the priority of unstable methods when picking a candidate. Previously, when searching for the impl of a method, we do not consider the stability of the impl. This leads to lots of insta-inference-regressions due to method ambiguity when a popular name is chosen. This has happened multiple times in Rust's history e.g. * `f64::from_bits` #40470 * `Ord::{min, max}` #42496 * `Ord::clamp` #44095 (eventually got reverted due to these breakages) * `Iterator::flatten` #48115 (recently added) This PR changes the probing order so that unstable items are considered last. If a stable item is found, the unstable items will not be considered (but a future-incompatible warning will still be emitted), thus allowing stable code continue to function without using qualified names. Once the unstable feature is stabilized, the ambiguity error will still be emitted, but the user can also use newly stable std methods, while the current situation is that downstream user is forced to update the code without any immediate benefit. (I hope that we could bring back `Ord::clamp` if this PR is merged.)
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-33/+358
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-24Fix test for PR #49268Hidehito Yabuuchi-11/+4
2018-03-23Auto merge of #49311 - SimonSapin:bootstrap-vs-rustflags-the-return, ↵bors-0/+6
r=Mark-Simulacrum Use the same RUSTFLAGS for building and testing `bootstrap` This avoids recompiling the whole dependency graph twice for every `./x.py test` run. Fixes #49215
2018-03-24Track IsSuggestion in ProbeContext. Don't warn stability for suggestions.kennytm-9/+13
2018-03-24Filed a proper tracking issue.kennytm-3/+2
2018-03-24Specialize future-incompatibility warning for UNSTABLE_NAME_COLLISION.kennytm-12/+18
2018-03-24Changed `check_stability` to take an `Option<NodeId>` instead of `NodeId`.kennytm-33/+43
This clarifies the intent of whether to emit deprecated lint or not.
2018-03-24When picking a candidate, consider the unstable ones last.kennytm-41/+317
If there is potential ambiguity after stabilizing those candidates, a warning will be emitted.
2018-03-24Provide a proper span when demanding for the return type of `box x`.kennytm-13/+7
2018-03-24Fix error annotations in testHidehito Yabuuchi-2/+2
2018-03-24Better diagnostics for '..' pattern fragment not in the last positionHidehito Yabuuchi-1/+51
2018-03-23Remove getopts leftover from treeMark Simulacrum-1622/+0
This was attempted but left incomplete in PR #42664, where only the toml file was removed.
2018-03-23Reduce scope of unsafe block in sun_path_offsetDaniel Kolsoi-7/+5
2018-03-23Fix IE11 searchGuillaume Gomez-0/+7