about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2017-04-09Auto merge of #41084 - QuietMisdreavus:rustdoc-format-redux, ↵bors-133/+137
r=frewsxcxv,GuillaumeGomez rustdoc: update formatting of fn signatures and where clauses to match style rfcs Recent updates to style RFCs ([where clauses](https://github.com/rust-lang-nursery/fmt-rfcs/issues/38), [function definitions](https://github.com/rust-lang-nursery/fmt-rfcs/issues/39)) changed the "canonical" style for these items, so this is a rustdoc update to make it emit that style where necessary. This is mainly a conversion from visual indent to block indent, which helps out in situations where there was excessive indent causing lines to wrap regardless. Samples: ![std::iter::IntoIterator](https://cloud.githubusercontent.com/assets/5217170/24712947/e586604c-19e9-11e7-87ae-4fe64d689dc3.png) ![excerpt from std::iter::Iterator](https://cloud.githubusercontent.com/assets/5217170/24713209/91e65112-19ea-11e7-9ff8-d4cf6b31aae1.png) ![std::iter::FromIterator](https://cloud.githubusercontent.com/assets/5217170/24713138/59f36114-19ea-11e7-9dbb-5f5ba7126e2e.png) ![std::cmp::min](https://cloud.githubusercontent.com/assets/5217170/24713038/1bab88b4-19ea-11e7-935d-defed5648de4.png) ![some trait impls on std::collections::HashMap](https://cloud.githubusercontent.com/assets/5217170/24713251/b7ef69e8-19ea-11e7-94a7-e01fbf89fa31.png) ![`fn extract_code_blocks`, an example given in #40687](https://cloud.githubusercontent.com/assets/5217170/24713159/672717cc-19ea-11e7-9acb-6ac278b90339.png) ![excerpt from itertools::Itertools](https://cloud.githubusercontent.com/assets/5217170/24713323/f06716ea-19ea-11e7-94cc-6ef68d9980ec.png) fixes #41025 and #40687 r? @rust-lang/docs
2017-04-09merge with master to pick up pulldown switchQuietMisdreavus-37127/+28764
2017-04-09Auto merge of #40829 - mgattozzi:ChildStderr, r=steveklabnikbors-2/+3
Update ChildStderr docs to be clearer Before the docs only had a line about where it was found and that it was a handle to stderr. This commit changes it so that the summary second line is removed and that it's a bit clearer about what can be done with it. Part of #29370
2017-04-09Auto merge of #40658 - eddyb:lay-more-out, r=arielb1bors-1819/+1442
Use ty::layout for ABI computation instead of LLVM types. This is the first step in creating a backend-agnostic library for computing call ABI details from signatures. I wanted to open the PR *before* attempting to move `cabi_*` from trans to avoid rebase churn in #39999. **EDIT**: As I suspected, #39999 needs this PR to fully work (see https://github.com/rust-lang/rust/pull/39999#issuecomment-287723379). The first 3 commits add more APIs to `ty::layout` and replace non-ABI uses of `sizing_type_of`. These APIs are probably usable by other backends, and miri too (cc @stoklund @solson). The last commit rewrites `rustc_trans::cabi_*` to use `ty::layout` and new `rustc_trans::abi` APIs. Also, during the process, a couple trivial bugs were identified and fixed: * `msp430`, `nvptx`, `nvptx64`: type sizes *in bytes* were compared with `32` and `64` * `x86` (`fastcall`): `f64` was incorrectly not treated the same way as `f32` Although not urgent, this PR also uses the more general "homogenous aggregate" logic to fix #32045.
2017-04-09rustc_trans: use ty::layout for ABI computation instead of LLVM types.Eduard-Mihai Burtescu-1672/+992
2017-04-09Auto merge of #41095 - clarcharr:as_extras, r=alexcrichtonbors-0/+15
Add as_c_str Again, tying up some consistencies with `CString`.
2017-04-09Auto merge of #41163 - nagisa:ldflags-llvm-config, r=alexcrichtonbors-0/+3
Specify type libraries for llvm-config --ldflags This matters on systems where static libraries and dynamic libraries reside in different location
2017-04-09Auto merge of #41154 - bluss:slice-rfind, r=alexcrichtonbors-0/+27
Implement .rfind() for slice iterators Iter and IterMut Just like the forward case find, implement rfind explicitly for slice iterators Iter and IterMut.
2017-04-08Auto merge of #41092 - jonhoo:std-fence-intrinsics, r=alexcrichtonbors-0/+148
Add safe wrapper for atomic_compilerfence intrinsics This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888](https://github.com/rust-lang/rfcs/pull/888). See #41091 for further discussion.
2017-04-08rustc: add some abstractions to ty::layout for a more concise API.Eduard-Mihai Burtescu-80/+188
2017-04-08rustc_trans: avoid sizing_type_of everywhere possible.Eduard-Mihai Burtescu-82/+53
2017-04-08rustc: add a TyLayout helper for type-related layout queries.Eduard-Mihai Burtescu-13/+237
2017-04-08Auto merge of #41148 - arielb1:dead-unwind, r=nagisabors-38/+174
borrowck::mir::dataflow: ignore unwind edges of empty drops This avoids creating drop flags in many unnecessary situations. Fixes #41110. r? @nagisa beta-nominating because regression. However, that is merely a small perf regression and codegen changes are always risky, so we might let this slide for 1.17.
2017-04-08borrowck::mir::dataflow: ignore unwind edges of empty dropsAriel Ben-Yehuda-38/+174
This avoids creating drop flags in many unnecessary situations. Fixes #41110.
2017-04-08Address @parched's commentsJon Gjengset-8/+3
2017-04-08Specify type libraries for llvm-config --ldflagsSimonas Kazlauskas-0/+3
This matters on systems where static libraries and dynamic libraries reside in different location
2017-04-08Auto merge of #41055 - Archytaus:compile-fail/const-match-pattern-arm, r=arielb1bors-12/+33
Fixed ICEs with pattern matching in const expression Fixed 2 ICEs with when pattern matching inside a constant expression. Both of these ICEs now resolve to an appropriate compiler error. 1. ICE was caused by a compiler bug to implement discriminant const qualify. I removed this intentionally thrown bug and changed it to a FIXME as the unimplemented expression type is handled as a compiler error elsewhere. 2. ICE was caused during a drop check when checking if a variable lifetime outlives the current scope if there was no parent scope . I've changed it to stop checking if there is no parent scope for the current scope. It is valid syntax for a const variable to be assigned a match expression with no enclosing scope. The ICE seemed to mainly be used as a defensive check for bugs elsewhere. Fixes #38199. Fixes #31577. Fixes #29093. Fixes #40012.
2017-04-08Auto merge of #40887 - estebank:ty-placeholder, r=petrochenkovbors-5/+113
Introduce `TyErr` independent from `TyInfer` Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ``` Fix #34264.
2017-04-08Auto merge of #40775 - estebank:variant-as-type, r=petrochenkovbors-0/+99
Suggest using enum when a variant is used as a type Given a file: ```rust enum Fruit { Apple(i64), Orange(i64), } fn should_return_fruit() -> Apple { Apple(5) } ``` Provide the following output: ```rust error[E0412]: cannot find type `Apple` in this scope --> file.rs:16:29 | 16 | fn should_return_fruit() -> Apple { | ^^^^^ not found in this scope | help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`? --> file.rs:12:5 | 12 | Apple(i64), | ^^^^^^^^^^ error[E0425]: cannot find function `Apple` in this scope --> file.rs:17:5 | 17 | Apple(5) | ^^^^^ not found in this scope | = help: possible candidate is found in another module, you can import it into scope: `use Fruit::Apple;` ``` Fix #35675.
2017-04-08Auto merge of #41156 - TimNN:rollup, r=TimNNbors-18/+149
Rollup of 4 pull requests - Successful merges: #41135, #41143, #41146, #41152 - Failed merges:
2017-04-08Rollup merge of #41152 - cuviper:bootstrap-armv7, r=japaricTim Neumann-2/+2
bootstrap.py: fix armv7 detection This matches the logic that was in `./configure` before f8ca805422db8.
2017-04-08Rollup merge of #41146 - est31:master, r=nrcTim Neumann-1/+1
pub(restricted) didn't make it into 1.17 Gets shipped in 1.18 instead.
2017-04-08Rollup merge of #41143 - stjepang:optimize-bool-fetch-nand, r=nagisaTim Neumann-11/+23
Optimize AtomicBool::fetch_nand This is an attempt to push the PR #40563 to completion. Benchmark: [source](https://gist.github.com/stjepang/023f5025623f5474184f9f4dfd6379ae) Improvement: ``` name old_ ns/iter new_ce_ ns/iter diff ns/iter diff % 1t 146,440 89,904 -56,536 -38.61% 2t 561,456 316,835 -244,621 -43.57% 4t 2,822,821 1,005,424 -1,817,397 -64.38% ``` r? @eddyb cc @alexcrichton @nagisa
2017-04-08Rollup merge of #41135 - japaric:unstable-docs, r=steveklabnikTim Neumann-4/+123
document some existing unstable features "msp430-interrupt", "ptx-kernel" and #![compiler_builtins_lib] r? @steveklabnik
2017-04-08Auto merge of #41147 - aidanhs:aphs-fix-appveyor-cache, r=TimNNbors-1/+3
Disable errexit for sanity checking git repo Unblock appveyor
2017-04-08slice: Implement .rfind() for slice iterators Iter and IterMutUlrik Sverdrup-0/+27
Just like the forward case find, implement rfind explicitly
2017-04-07Move tests from ui to cfailEsteban Küber-118/+67
2017-04-07bootstrap.py: fix armv7 detectionJosh Stone-2/+2
This matches the logic that was in `./configure` before f8ca805422db8.
2017-04-07Merge branch 'master' into ty-placeholderEsteban Küber-3328/+7309
2017-04-07Add as_c_str.Clar Charr-0/+15
2017-04-07Disable errexit for sanity checking git repoAidan Hobson Sayers-1/+3
2017-04-07pub(restricted) didn't make it into 1.17est31-1/+1
Gets shipped in 1.18 instead.
2017-04-07Replace compare_exchange with swapStjepan Glavina-8/+3
2017-04-07Optimize AtomicBool::fetch_nandStjepan Glavina-10/+27
2017-04-07Auto merge of #41138 - frewsxcv:rollup, r=frewsxcvbors-196/+347
Rollup of 9 pull requests - Successful merges: #40797, #41047, #41056, #41061, #41075, #41080, #41120, #41130, #41131 - Failed merges:
2017-04-07change the format of the linked issue numberJorge Aparicio-2/+3
2017-04-07Rollup merge of #41131 - euclio:collapse-animation, r=GuillaumeGomezCorey Farwell-4/+11
rustdoc: collapse docblock before showing label The animation for collapsing descriptions is currently pretty jarring, as the label starts fading in as the description is collapsing. This causes the description to jump down a line (and sometimes change indentation) while animating. This PR modifies this behavior to collapse the block entirely before starting to fade in the collapse button label. While this PR works well for descriptions of structs, traits, etc., it still does not look ideal for attributes. I'd appreciate any suggestions for improving that animation. Perhaps we want to optimize for the single-attribute case, and try not to collapse the attribute list entirely before fading in the label?
2017-04-07Rollup merge of #41130 - petrhosek:fuchsia-ci-upstream, r=alexcrichtonCorey Farwell-12/+64
travis: Use upstream LLVM repositories for Fuchsia The Fuchsia copies of LLVM repositories contain additional patches for work-in-progress features and there is some amount of churn that may break Rust. Use upstream LLVM repositories instead for building the toolchain used by the Fuchsia builder.
2017-04-07Rollup merge of #41120 - clarcharr:c_str_transmute, r=alexcrichtonCorey Farwell-2/+3
Remove some CStr transmutes. Because dedicated methods exist for these, we don't have to add other transmutes.
2017-04-07Rollup merge of #41080 - cuviper:generic-powerpc, r=alexcrichtonCorey Farwell-10/+5
dist-powerpc-linux: use a pure 32-bit CPU profile With `-mcpu=power4`, code might use instructions like `fcfid`, excluding older CPUs like the PowerPC G4, which apparently some users would like to use. The generic `-mcpu=powerpc` should stick to pure 32-bit PowerPC instructions. Fixes rust-lang/cargo#3852.
2017-04-07Rollup merge of #41075 - aidanhs:aphs-enable-appveyor-cache, r=alexcrichtonCorey Farwell-4/+18
Re-enable appveyor cache After breaking the queue last time, I'm cautiously back with a PR to re-enable caching on appveyor. If you look at https://ci.appveyor.com/project/rust-lang/rust/build/1.0.2623/job/46o90by4ari6gege (one of the multiple runs that started failed, there are actually two errors - one for restoring the cache, one right at the bottom for creating a directory. I only noticed the restore error at the time as I was a bit rushed to revert and didn't stop to wonder why it continued - turns out appveyor [does not abort on cache restore failure](https://github.com/appveyor/ci/issues/723). Turns out the cause of the build failures was the cache directory existing and me being thinking that because mkdir on windows is [recursive by default](http://stackoverflow.com/a/905239/2352259), it ignores the error if the directory already exists. Apparently this is not true, so now it checks if the directory exists before attempting to create. In addition, I've added some more paranoia to double check everything is sane.
2017-04-07Rollup merge of #41061 - arielb1:parent-lock, r=eddybCorey Farwell-6/+55
cstore: return an immutable borrow from `visible_parent_map` This prevents an ICE when `visible_parent_map` is called multiple times, for example when an item referenced in an impl signature is imported from an `extern crate` statement occurs within an impl. Fixes #41053. r? @eddyb
2017-04-07Rollup merge of #41056 - michaelwoerister:central-defpath-hashes, r=nikomatsakisCorey Farwell-131/+161
Handle DefPath hashing centrally as part of DefPathTable (+ save work during SVH calculation) In almost all cases where we construct a `DefPath`, we just hash it and throw it away again immediately. With this PR, the compiler will immediately compute and store the hash for each `DefPath` as it is allocated. This way we + can get rid of any subsequent `DefPath` hash caching (e.g. the `DefPathHashes`), + don't need to allocate a transient `Vec` for holding the `DefPath` (although I'm always surprised how little these small, dynamic allocations seem to hurt performance), and + we don't hash `DefPath` prefixes over and over again. That last part is because we construct the hash for `prefix::foo` by hashing `(hash(prefix), foo)` instead of hashing every component of prefix. The last commit of this PR is pretty neat, I think: ``` The SVH (Strict Version Hash) of a crate is currently computed by hashing the ICHes (Incremental Computation Hashes) of the crate's HIR. This is fine, expect that for incr. comp. we compute two ICH values for each HIR item, one for the complete item and one that just includes the item's interface. The two hashes are are needed for dependency tracking but if we are compiling non-incrementally and just need the ICH values for the SVH, one of them is enough, giving us the opportunity to save some work in this case. ``` r? @nikomatsakis This PR depends on https://github.com/rust-lang/rust/pull/40878 to be merged first (you can ignore the first commit for reviewing, that's just https://github.com/rust-lang/rust/pull/40878).
2017-04-07Rollup merge of #41047 - cuviper:src_is_git, r=alexcrichtonCorey Farwell-24/+27
Only use cargo-vendor if building from git sources The only time we need to vendor sources is when building from git. If one is building from a rustc source tarball, everything should already be in place. This also matters for distros which do offline builds, as they can't install cargo-vendor this way. This adds a common `Build::src_is_git` flag, and then uses it in the dist-src target to decide whether to install or use `cargo-vendor` at all. Fixes #41042.
2017-04-07Rollup merge of #40797 - GAJaloyan:patch-1, r=arielb1Corey Farwell-3/+3
Correcting mistakes in the README.md Correcting the two mistakes in the README.md (issue #40793)
2017-04-07Mention interrupts and green threadsJon Gjengset-1/+6
2017-04-07rustdoc needs space after # to ignoreJon Gjengset-6/+6
2017-04-07Auto merge of #40971 - malbarbo:android-emulator-64, r=alexcrichtonbors-4/+6
Use 64 bits emulator to run android tests Also install headless jre instead of the full jre.
2017-04-07SVH: Don't hash the HIR twice when once is enough.Michael Woerister-1/+9
The SVH (Strict Version Hash) of a crate is currently computed by hashing the ICHes (Incremental Computation Hashes) of the crate's HIR. This is fine, expect that for incr. comp. we compute two ICH values for each HIR item, one for the complete item and one that just includes the item's interface. The two hashes are are needed for dependency tracking but if we are compiling non-incrementally and just need the ICH values for the SVH, one of them is enough, giving us the opportunity to save some work in this case.
2017-04-07ICH: Centrally compute and cache DefPath hashes as part of DefPathTable.Michael Woerister-130/+152