about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-08-30Auto merge of #76090 - Dylan-DPC:rollup-eksndcr, r=Dylan-DPCbors-125/+213
Rollup of 14 pull requests Successful merges: - #75832 (Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs…) - #75852 (Switch to intra-doc links in `core::hash`) - #75874 (Shorten liballoc doc intra link while readable) - #75881 (Expand rustdoc theme chooser x padding) - #75885 (Fix another clashing_extern_declarations false positive.) - #75892 (Fix typo in TLS Model in Unstable Book) - #75910 (Add test for issue #27130) - #75917 (Move to intra doc links for core::ptr::non_null) - #75975 (Allow --bess ing expect-tests in tools) - #75990 (Add __fastfail for Windows on arm/aarch64) - #76015 (Fix loading pretty-printers in rust-lldb script) - #76022 (Clean up rustdoc front-end source code) - #76029 (Move to intra-doc links for library/core/src/sync/atomic.rs) - #76057 (Move retokenize hack to save_analysis) Failed merges: r? @ghost
2020-08-30Rollup merge of #76057 - matklad:remove-retokenize, r=petrochenkovDylan DPC-87/+35
Move retokenize hack to save_analysis closes #76046
2020-08-30Rollup merge of #76022 - GuillaumeGomez:cleanup-rustdoc-front, r=jyn514Dylan DPC-8/+9
Clean up rustdoc front-end source code r? @jyn514
2020-08-30Rollup merge of #76015 - ortem:fix-lldb-script, r=Mark-SimulacrumDylan DPC-2/+5
Fix loading pretty-printers in rust-lldb script Pretty-printers loading in `rust-lldb` script was broken in https://github.com/rust-lang/rust/pull/72357 This fixes https://github.com/rust-lang/rust/issues/76006
2020-08-30Rollup merge of #75975 - matklad:snapshot-tests, r=Mark-SimulacrumDylan DPC-5/+5
Allow --bess ing expect-tests in tools I haven't tried this, but I think this should do the trick, as `RustdocCrate` is a special step in bootstrap, which uses `tool_caro` r? @ghost
2020-08-30Rollup merge of #75910 - bugadani:testcase, r=oli-obkDylan DPC-0/+22
Add test for issue #27130 #27130 seems to be fixed by the llvm 11 update. The issue is marked with needs-test, so here it is. As some historical context, the generated code was fine until 1.38, and remained unoptimized from 1.38 up until the current nightly. I've also added a pattern matching version that was fine on 1.45.2.
2020-08-30Rollup merge of #75892 - ArekPiekarz:unstable_book_tls_model_typo, ↵Dylan DPC-1/+1
r=petrochenkov Fix typo in TLS Model in Unstable Book
2020-08-30Rollup merge of #75885 - ↵Dylan DPC-21/+135
jumbatm:issue75739-clashing-extern-declarations-transparent-nonzero, r=lcnr Fix another clashing_extern_declarations false positive. Fixes #75739. Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member. r? @lcnr
2020-08-30Rollup merge of #75881 - pickfire:patch-5, r=GuillaumeGomezDylan DPC-1/+1
Expand rustdoc theme chooser x padding ![image](https://user-images.githubusercontent.com/4687791/91057476-d0eea500-e659-11ea-8c9a-e44db937da89.png) ![image](https://user-images.githubusercontent.com/4687791/91057530-e368de80-e659-11ea-9298-fbb00006d91f.png) But I still think there is room for improvement considering mdbook. ![image](https://user-images.githubusercontent.com/4687791/91057583-f7acdb80-e659-11ea-9dc5-317caed92bc5.png) CC @GuillaumeGomez @jyn514
2020-08-29Auto merge of #75775 - matklad:rustc-lexer-rustdoc-highlight, r=GuillaumeGomezbors-414/+297
Use rustc_lexer for rustdoc syntax highlighting r? @ghost
2020-08-29Auto merge of #76016 - RalfJung:miri, r=RalfJungbors-8/+8
bump Miri Fixes https://github.com/rust-lang/rust/issues/75970 Cc @rust-lang/miri r? @ghost
2020-08-29bump MiriRalf Jung-8/+8
2020-08-29Auto merge of #75713 - mati865:netbsd_zlib, r=Mark-Simulacrumbors-3/+3
Enable zlib for NetBSD NetBSD Docker dist job passed locally.
2020-08-29Auto merge of #75754 - joshtriplett:wip-perf-snappy, r=Mark-Simulacrumbors-9/+8
Switch to Snappy compression for metadata
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-29Allow --bess ing expect-tests in toolsAleksey Kladov-5/+5
See #75773 and #75775
2020-08-29Use an id instead of a functionGuillaume Gomez-6/+3
2020-08-29Move retokenize hack to save_analysisAleksey Kladov-87/+35
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-28Clean up rustdoc front-end source codeGuillaume Gomez-8/+12
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-28Fix loading pretty-printers in rust-lldb scriptortem-2/+5
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-28Make sure the functions don't get mergedDániel Buga-1/+1
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-27Add expect test for rustdoc html highlightingAleksey Kladov-61/+66
It's a unit-test in a sense that it only checks syntax highlighting. However, the resulting HTML is written to disk and can be easily inspected in the browser. To update the test, run with `--bless` argument or set `UPDATE_EXPEC=1` env var
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-27Remove dependency on StringReader from rustdoc highlighterAleksey Kladov-356/+234
rustc_lexer is the lossless lexer, which is a better fit for approximate syntax highlighting. As a side-effect, we can now syntax-highlight even broken code.