about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-08-29Auto merge of #76034 - flip1995:clippyup, r=Manishearthbors-1092/+4160
Update Clippy Bi-weekly Clippy update, as per the [new policy](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#syncing-back-changes-in-clippy-to-rust-langrust). r? @Manishearth
2020-08-29Auto merge of #75370 - simonvandel:optimize-if-condition-on-int-to-switch, ↵bors-0/+662
r=oli-obk New pass to optimize `if`conditions on integrals to switches on the integer Fixes #75144 Pass to convert `if` conditions on integrals into switches on the integral. For an example, it turns something like ``` _3 = Eq(move _4, const 43i32); StorageDead(_4); switchInt(_3) -> [false: bb2, otherwise: bb3]; ``` into: ``` switchInt(_4) -> [43i32: bb3, otherwise: bb2]; ```
2020-08-29New pass to optimize `if`conditions on integrals to switches on the integerSimon Vandel Sillesen-0/+662
Fixes #75144
2020-08-29Auto merge of #75985 - csmoe:issue-61076-1, r=estebankbors-7/+11
Should not apply field accessing on enum Closes #75977 But I'm surprised that `x.py test --stage 1` and CI didn't catch this with existing testcase. r? @estebank
2020-08-29Auto merge of #75916 - jyn514:unify-error-reporting, r=eucliobors-116/+154
Unify error reporting for intra-doc links - Give a suggestion even if there is no span available - Give a more accurate description of the change than 'use the disambiguator' - Write much less code Closes #75836. r? @euclio cc @pickfire - this gets rid of 'disambiguator' like you suggested in https://github.com/rust-lang/rust/pull/75079#discussion_r464464195.
2020-08-29Auto merge of #74922 - joshtriplett:ninja-by-default, r=Mark-Simulacrumbors-8/+52
Set ninja=true by default Ninja substantially improves LLVM build time. On a 96-way system, using Make took 248s, and using Ninja took 161s, a 35% improvement. We already require a variety of tools to build Rust. If someone wants to build without Ninja (for instance, to minimize the set of packages required to bootstrap a new target), they can easily set `ninja=false` in `config.toml`. Our defaults should help people build Rust (and LLVM) faster, to speed up development.
2020-08-29Auto merge of #75939 - Amanieu:fix_asm2, r=nagisabors-6/+12
Fix a typo in #75781
2020-08-28Auto merge of #76035 - tiagolam:master, r=pietroalbinibors-0/+1
Build dist-x86_64-musl with --enable-profiler. Trying to build a Rust project with `-Zprofile` for target x86_64-unknown-linux-musl using rustc 1.46.0-nightly (346aec9b0 2020-07-11), installed with rustup, results in the following error. ``` export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"export CARGO_INCREMENTAL=0$ cargo build --target=x86_64-unknown-linux-muslCompiling hello_world v0.1.0 (…)error[E0463]: can't find crate for `profiler_builtins` | = note: the compiler may have been built without the profiler runtime error: aborting due to previous error For more information about this error, try `rustc --explain E0463`.error: could not compile `hello_world`. To learn more, run the command again with --verbose. ``` `-Zprofile` is required here to enable grcov profiling. This is similar in nature to issue https://github.com/rust-lang/rust/issues/57257, which has been fixed in asimilar way at https://github.com/rust-lang/rust/pull/60476 . A fix for Android has also landed not long ago: https://github.com/rust-lang/rust/pull/70054 . Signed-off-by: Tiago Lam <tiagol@hadean.com>
2020-08-28Fix testAmanieu d'Antras-10/+11
2020-08-28Build dist-x86_64-musl with --enable-profiler.Tiago Lam-0/+1
Trying to build a Rust project with `-Zprofile` for target x86_64-unknown-linux-musl using rustc 1.46.0-nightly (346aec9b0 2020-07-11), installed with rustup, results in the following error. ``` export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"export CARGO_INCREMENTAL=0$ cargo build --target=x86_64-unknown-linux-muslCompiling hello_world v0.1.0 (…)error[E0463]: can't find crate for `profiler_builtins` | = note: the compiler may have been built without the profiler runtime error: aborting due to previous error For more information about this error, try `rustc --explain E0463`.error: could not compile `hello_world`. To learn more, run the command again with --verbose. ``` `-Zprofile` is required here to enable grcov profiling. This is similar in nature to issue https://github.com/rust-lang/rust/issues/57257, which has been fixed in asimilar way at https://github.com/rust-lang/rust/pull/60476 . A fix for Android has also landed not long ago: https://github.com/rust-lang/rust/pull/70054 . Signed-off-by: Tiago Lam <tiagol@hadean.com>
2020-08-28Auto merge of #76018 - pietroalbini:ci-left-fallible-finish-2, r=Mark-Simulacrumbors-9/+9
Run cancel-outdated-builds after fully setting up the env This PR fixes #75995 not working as expected. Due to GitHub Actions limitations the environment variables set in the build matrix definition are not added by the GHA runner, but by the `setup-environment.sh` script. Before this PR the `cancel-outdated-builds` action was started before that script, so it was never able to detect the "suppression" variable added in #75995. This PR reorders the jobs to make sure `setup-environment.sh` runs before the action. r? @Mark-Simulacrum
2020-08-28Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyupflip1995-1092/+4160
2020-08-28Disable ninja on the dry-run builderJosh Triplett-0/+1
2020-08-28Rollup merge of #76000 - richkadel:llvm-coverage-map-gen-6b.2, r=wesleywiserPietro Albini-0/+12
Adds --bless support to test/run-make-fulldeps The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #76004 . r? @tmandry FYI: @wesleywiser
2020-08-28Rollup merge of #75989 - matklad:renamerustdoctest, r=GuillaumeGomezPietro Albini-7/+7
Rename rustdoc/test -> rustdoc/doctest This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity.
2020-08-28Rollup merge of #75972 - JulianKnodt:i70381, r=rollupPietro Albini-1/+15
Fix ICE due to carriage return w/ multibyte char Based off of this [commit](https://github.com/kfitch/rust/commit/972560b83f80e1219b5735ff3d751c034115b08e) Fixes #70381 CC: @Dylan-DPC
2020-08-28Rollup merge of #75941 - GuillaumeGomez:cleanup-e0761, r=Dylan-DPCPietro Albini-7/+3
Clean up E0761 explanation r? @Dylan-DPC
2020-08-28Rollup merge of #75330 - Nemo157:improve-doc-cfg-features, r=GuillaumeGomezPietro Albini-33/+154
Improve rendering of crate features via doc(cfg) The current rendering of crate features with `doc(cfg(feature = ".."))` is verbose and unwieldy for users, `doc(cfg(target_feature = ".."))` is special-cased to make it render nicely, and a similar rendering can be applied to `doc(cfg(feature))` to make it easier for users to read. I also added special casing of `all`/`any` cfgs consisting of just `feature`/`target-feature` to remove the repetitive "target/crate feature" prefix. The downside of this current rendering is that there is no distinction between `feature` and `target_feature` in the shorthand display. IMO this is ok, or if anything `target_feature` should have a more verbose shorthand, because `doc(cfg(feature = ".."))` usage is going to vastly outstrip `doc(cfg(target_feature = ".."))` usage in non-stdlib crates when it eventually stabilizes (or even before that given the number of crates using `cfg_attr(docsrs)` like constructs). ## Previously <img width="259" alt="Screenshot 2020-08-09 at 13 32 42" src="https://user-images.githubusercontent.com/81079/89731110-d090c000-da44-11ea-96fa-56adc6339123.png"> <img width="438" alt="image" src="https://user-images.githubusercontent.com/81079/89731116-d7b7ce00-da44-11ea-87c6-022d192d6eca.png"> <img width="765" alt="image" src="https://user-images.githubusercontent.com/81079/89731152-24030e00-da45-11ea-9552-1c270bff2729.png"> <img width="671" alt="image" src="https://user-images.githubusercontent.com/81079/89731158-28c7c200-da45-11ea-8acb-97d8a4ce00eb.png"> ## Now <img width="216" alt="image" src="https://user-images.githubusercontent.com/81079/89731123-e1d9cc80-da44-11ea-82a8-5900bd9448a5.png"> <img width="433" alt="image" src="https://user-images.githubusercontent.com/81079/89731127-e8684400-da44-11ea-9d18-572fd810f19f.png"> <img width="606" alt="image" src="https://user-images.githubusercontent.com/81079/89731162-2feed000-da45-11ea-98d2-8a88c364d903.png"> <img width="669" alt="image" src="https://user-images.githubusercontent.com/81079/89731991-ccb46c00-da4b-11ea-9416-cd20a3193826.png"> cc #43781
2020-08-28ci: run cancel-outdated-builds after fully setting up the envPietro Albini-9/+9
2020-08-28Auto merge of #70212 - Amanieu:catch_foreign, r=Mark-Simulacrumbors-61/+194
Abort when foreign exceptions are caught by catch_unwind Prior to this PR, foreign exceptions were not caught by catch_unwind, and instead passed through invisibly. This represented a painful soundness hole in some libraries ([take_mut](https://github.com/Sgeo/take_mut/blob/master/src/lib.rs#L37)), which relied on `catch_unwind` to handle all possible exit paths from a closure. With this PR, foreign exceptions are now caught by `catch_unwind` and will trigger an abort since catching foreign exceptions is currently UB according to the latest proposals by the FFI unwind project group. cc @rust-lang/wg-ffi-unwind
2020-08-27Auto merge of #75995 - pietroalbini:ci-let-fallible-finish, r=Mark-Simulacrumbors-1/+15
Disable cancel-outdated-builds for auto-fallible `cancel-outdated-builds` doesn't need to be enabled on fallible jobs, and it's actually making it harder for us to see if https://github.com/rust-lang/rust/issues/71988 is fixed. This adds some temporary code to avoid `auto-fallible` jobs from being cancelled by our tooling. r? @Mark-Simulacrum
2020-08-27Auto merge of #75976 - GuillaumeGomez:help-popup, r=jyn514bors-4/+5
Improve help popup Fixes #75623. The second commit is just a slight improvement: the help popup won't be created until someone presses "?" or ESC. Not a big improvement in itself but considering the low amount of code required, I think it was worth the shot. r? @jyn514
2020-08-27Abort when catch_unwind catches a foreign exceptionAmanieu d'Antras-61/+194
2020-08-27Adds --bless support to test/run-make-fulldepsRich Kadel-0/+12
The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #75828 (or its derivative).
2020-08-27ci: disable cancel-outdated-builds for auto-falliblePietro Albini-1/+15
2020-08-27Auto merge of #75933 - Aaron1011:feature/closure-move-err, r=oli-obkbors-18/+102
Point to a move-related span when pointing to closure upvars Fixes #75904 When emitting move/borrow errors, we may point into a closure to indicate why an upvar is used in the closure. However, we use the 'upvar span', which is just an arbitrary usage of the upvar. If the upvar is used in multiple places (e.g. a borrow and a move), we may end up pointing to the borrow. If the overall error is a move error, this can be confusing. This PR tracks the span that caused an upvar to become captured by-value instead of by-ref (assuming that it's not a `move` closure). We use this span instead of the 'upvar' span when we need to point to an upvar usage during borrow checking.
2020-08-27Rename rustdoc/test -> rustdoc/doctestAleksey Kladov-7/+7
This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity.
2020-08-27Auto merge of #74941 - dylanmckay:replace-broken-avr-unknown-unknown-target, ↵bors-52/+60
r=oli-obk [AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target The `avr-unknown-unknown` target has never worked correctly, always trying to invoke the host linker and failing. It aimed to be a mirror of AVR-GCC's default handling of the `avr-unknown-unknown' triple (assume bare minimum chip features, silently skip linking runtime libraries, etc). This behaviour is broken-by-default as it will cause a miscompiled executable when flashed. This patch improves the AVR builtin target specifications to instead expose only a 'avr-unknown-gnu-atmega328' target. This target system is `gnu`, as it uses the AVR-GCC frontend along with avr-binutils. The target triple ABI is 'atmega328'. In the future, it should be possible to replace the dependency on AVR-GCC and binutils by using the in-progress AVR LLD and compiler-rt support. Perhaps at that point it would make sense to add an 'avr-unknown-unknown-atmega328' target as a better default when implemented. There is no current intention to add in-tree AVR target specifications for other AVR microcontrollers - this one can serve as a reference implementation for other devices via `rustc --print target-spec-json avr-unknown-gnu-atmega328p`. There should be no users of the existing 'avr-unknown-unknown' Rust target as a custom target specification JSON has always been recommended, and the avr-unknown-unknown target could never pass the linking step anyway.
2020-08-27should not try to apply field accessing on enumcsmoe-7/+11
2020-08-27Delay help popup creation to when it's neededGuillaume Gomez-2/+3
2020-08-27Improve helper wordingGuillaume Gomez-2/+2
2020-08-27Auto merge of #75947 - pietroalbini:bootstrap-update, r=Mark-Simulacrumbors-2/+2
Bump version to 1.48 and update cfg(bootstrap)s r? @Mark-Simulacrum
2020-08-27Auto merge of #72784 - csmoe:issue-61076, r=estebankbors-7/+299
Await on mismatched future types Closes #61076 This PR suggests to `await` on: 1. `async_fn().bar() => async_fn().await.bar()` 2. `async_fn().field => async_fn().await.field` 3. ` if let x = async() {} => if let x = async().await {}` r? @tmandry @estebank
2020-08-27add projection_ty_from_predicates querycsmoe-32/+31
2020-08-27Fix ICE due to carriage return w/ multibyte charkadmin-1/+15
Based off of https://github.com/kfitch/rust/commit/972560b83f80e1219b5735ff3d751c034115b08e
2020-08-26Debian 6 doesn't have ninja, so use make for the dist buildsJosh Triplett-2/+2
2020-08-27Auto merge of #75842 - camelid:highlight-crate-links, r=jyn514bors-1/+5
Highlight crate links like normal links Fixes #75823. Cc @jyn514
2020-08-27Auto merge of #75966 - Dylan-DPC:rollup-srfpces, r=Dylan-DPCbors-21/+38
Rollup of 10 pull requests Successful merges: - #74730 (Hexagon libstd: update type defs) - #75758 (Fixes for VxWorks) - #75780 (Unconfuse Unpin docs a bit) - #75806 (Prevent automatic page change when using history) - #75818 (Update docs for SystemTime Windows implementation) - #75837 (Fix font color for help button in ayu and dark themes) - #75870 (Unify theme choices border color in ayu theme) - #75875 (Shorten liballoc vec resize intra-doc link) - #75953 (Fix swapped stability attributes for rustdoc lints) - #75958 (Avoid function-scoping global variables) Failed merges: r? @ghost
2020-08-26Add new lint to prevent usage of unwrap in fns that return resultJane Lusby-0/+7
2020-08-27Rollup merge of #75958 - Mark-Simulacrum:fix-toolstate, r=kennytmDylan DPC-9/+9
Avoid function-scoping global variables In 2e6f2e885506ee4, we added a main function to the publish_toolstate.py script. Unfortunately, we missed that the Python program implicitly declares global variables in that code, which means that adding a function changes variable scoping and breaks other code. This commit avoids introducing that function and adds a warning to future editors of the code.
2020-08-27Rollup merge of #75953 - jyn514:missing-lints, r=ManishearthDylan DPC-6/+6
Fix swapped stability attributes for rustdoc lints This fixes a regression introduced in https://github.com/rust-lang/rust/pull/74855. Previously, `missing_doc_code_examples` would be run on stable and `private_doc_tests` would only be run on nightly. Now, it correctly does the reverse. Closes https://github.com/rust-lang/rust/issues/75951. r? @ehuss
2020-08-27Rollup merge of #75870 - GuillaumeGomez:unify-border-color-theme-ayu, r=pickfireDylan DPC-1/+1
Unify theme choices border color in ayu theme There was a slight color difference in the theme choice menu borders: ![Screenshot from 2020-08-24 10-37-05](https://user-images.githubusercontent.com/3050060/91022913-22654880-e5f6-11ea-8165-302b2d4e701e.png) ![Screenshot from 2020-08-24 10-37-58](https://user-images.githubusercontent.com/3050060/91022918-242f0c00-e5f6-11ea-989a-e26a28196d09.png) r? @Cldfire
2020-08-27Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=CldfireDylan DPC-0/+2
Fix font color for help button in ayu and dark themes A nice before/after: ![Screenshot from 2020-08-23 14-47-07](https://user-images.githubusercontent.com/3050060/90979230-0dd07400-e554-11ea-85f7-046dfca65e8e.png) ![Screenshot from 2020-08-23 14-47-03](https://user-images.githubusercontent.com/3050060/90979233-145eeb80-e554-11ea-8e63-1864c3f2699b.png) For the ayu theme, the change is very "light", the font color was already close to white, so I unified the color with the pictures of the other buttons: ![Screenshot from 2020-08-23 15-20-45](https://user-images.githubusercontent.com/3050060/90979281-5e47d180-e554-11ea-9993-8595057481ab.png) ![Screenshot from 2020-08-23 15-20-50](https://user-images.githubusercontent.com/3050060/90979279-5daf3b00-e554-11ea-8d39-beb57091aba7.png)
2020-08-27Rollup merge of #75806 - ↵Dylan DPC-4/+14
GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire Prevent automatic page change when using history Fixes #75774.
2020-08-27Rollup merge of #75758 - bpangWR:master, r=Mark-SimulacrumDylan DPC-1/+6
Fixes for VxWorks r? @alexcrichton
2020-08-26Auto merge of #75898 - lcnr:variant-def-recovered, r=petrochenkovbors-6/+15
VariantDef: move `recovered` into `VariantFlags`
2020-08-26Provide a better diagnostic if ninja isn't installedJosh Triplett-2/+10
Let people know that they can set ninja=false if they don't want to install ninja.
2020-08-26Install ninja on CI buildersJosh Triplett-0/+34
Windows CI builds already install ninja. Install it in all the Docker-based builds as well.
2020-08-26Disable ninja on macOS CIJosh Triplett-6/+6
Should be re-enabled when we have a recipe for installing ninja on macOS.
2020-08-26Set ninja=true by defaultJosh Triplett-0/+1
Ninja substantially improves LLVM build time. On a 96-way system, using Make took 248s, and using Ninja took 161s, a 35% improvement. We already require a variety of tools to build Rust. If someone wants to build without Ninja (for instance, to minimize the set of packages required to bootstrap a new target), they can easily set `ninja=false` in `config.toml`. Our defaults should help people build Rust (and LLVM) faster, to speed up development.