about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-05-07Auto merge of #85036 - Dylan-DPC:rollup-4qfabo3, r=Dylan-DPCbors-211/+199
Rollup of 9 pull requests Successful merges: - #84254 (illumos should put libc last in library search order) - #84442 (Unify rustc and rustdoc parsing of `cfg()`) - #84655 (Cleanup of `wasm`) - #84866 (linker: Avoid library duplication with `/WHOLEARCHIVE`) - #84930 (rename LLVM target for RustyHermit) - #84991 (rustc: Support Rust-specific features in -Ctarget-feature) - #85029 (SGX mutex is movable) - #85030 (Rearrange SGX split module files) - #85033 (some further small cleanups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-07Rollup merge of #85033 - lcnr:nits2, r=jackh726Dylan DPC-57/+47
some further small cleanups
2021-05-07Rollup merge of #85030 - jethrogb:jb/sgx-rearrange-files, r=nagisaDylan DPC-6/+7
Rearrange SGX split module files In #75979 several inlined modules were split out into multiple files. This PR keeps the multiple files but moves a few things around to organize things in a coherent way.
2021-05-07Rollup merge of #85029 - jethrogb:jb/sgx-movable-mutex, r=m-ou-seDylan DPC-1/+1
SGX mutex is movable r? ``@m-ou-se``
2021-05-07Rollup merge of #84991 - alexcrichton:target-feature-remap, r=nagisaDylan DPC-15/+28
rustc: Support Rust-specific features in -Ctarget-feature Since the beginning of time the `-Ctarget-feature` flag on the command line has largely been passed unmodified to LLVM. Afterwards, though, the `#[target_feature]` attribute was stabilized and some of the names in this attribute do not match the corresponding LLVM name. This is because Rust doesn't always want to stabilize the exact feature name in LLVM for the equivalent functionality in Rust. This creates a situation, however, where in Rust you'd write: #[target_feature(enable = "pclmulqdq")] unsafe fn foo() { // ... } but on the command line you would write: RUSTFLAGS="-Ctarget-feature=+pclmul" cargo build --release This difference is somewhat odd to deal with if you're a newcomer and the situation may be made worse with upcoming features like [WebAssembly SIMD](https://github.com/rust-lang/rust/issues/74372) which may be more prevalent. This commit implements a mapping to translate requests via `-Ctarget-feature` through the same name-mapping functionality that's present for attributes in Rust going to LLVM. This means that `+pclmulqdq` will work on x86 targets where as previously it did not. I've attempted to keep this backwards-compatible where the compiler will just opportunistically attempt to remap features found in `-Ctarget-feature`, but if there's something it doesn't understand it gets passed unmodified to LLVM just as it was before.
2021-05-07Rollup merge of #84930 - hermitcore:target, r=nagisaDylan DPC-1/+1
rename LLVM target for RustyHermit - RustyHermit is a library operating system, where the user- and the kernel-space use the same target - by a mistake a previous patch changes the target to an incorect value - this merge request revert the previous changes
2021-05-07Rollup merge of #84866 - petrochenkov:wholesome, r=Mark-SimulacrumDylan DPC-2/+0
linker: Avoid library duplication with `/WHOLEARCHIVE` Looks like in #72785 I misinterpreted how the `link.exe`'s `/WHOLEARCHIVE` flag works. It's not necessary to write `mylib /WHOLEARCHIVE:mylib` to mark `mylib` as whole archive, `/WHOLEARCHIVE:mylib` alone is enough. https://docs.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-160
2021-05-07Rollup merge of #84655 - CDirkx:wasm, r=m-ou-seDylan DPC-65/+14
Cleanup of `wasm` Some more cleanup of `sys`, this time `wasm` - Reuse `unsupported::args` (functionally equivalent implementation, just an empty iterator). - Split out `atomics` implementation of `wasm::thread`, the non-`atomics` implementation is reused from `unsupported`. - Move all of the `atomics` code to a separate directory `wasm/atomics`. ````@rustbot```` label: +T-libs-impl r? ````@m-ou-se````
2021-05-07Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkovDylan DPC-64/+82
Unify rustc and rustdoc parsing of `cfg()` This extracts a new `parse_cfg` function that's used between both. - Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)] #[doc(cfg(y))]`. Previously it would be completely ignored. - Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)] #[doc(cfg(x))]`. Previously, the cfg would be ignored. - Pass the cfg predicate through to rustc_expand to be validated Technically this is a breaking change, but doc_cfg is still nightly so I don't think it matters. Fixes https://github.com/rust-lang/rust/issues/84437. r? `````````@petrochenkov`````````
2021-05-07Rollup merge of #84254 - jclulow:illumos-link-order, r=petrochenkovDylan DPC-0/+19
illumos should put libc last in library search order Under some conditions, the toolchain will produce a sequence of linker arguments that result in a NEEDED list that puts libc before libgcc_s; e.g., [0] NEEDED 0x2046ba libc.so.1 [1] NEEDED 0x204723 libm.so.2 [2] NEEDED 0x204736 libsocket.so.1 [3] NEEDED 0x20478b libumem.so.1 [4] NEEDED 0x204763 libgcc_s.so.1 Both libc and libgcc_s provide an unwinder implementation, but libgcc_s provides some extra symbols upon which Rust directly depends. If libc is first in the NEEDED list we will find some of those symbols in libc but others in libgcc_s, resulting in undefined behaviour as the two implementations do not use compatible interior data structures. This solution is not perfect, but is the simplest way to produce correct binaries on illumos for now.
2021-05-07Rearrange SGX split module filesJethro Beekman-6/+7
In #75979 several inlined modules were split out into multiple files. This PR keeps the multiple files but moves a few things around to organize things in a coherent way.
2021-05-07SGX mutex is movableJethro Beekman-1/+1
2021-05-07fulfillment typolcnr-3/+3
2021-05-07wfcheck fcx <-> tcx cleanuplcnr-54/+44
2021-05-07Auto merge of #84797 - richkadel:cover-unreachable-statements, r=tmandrybors-65/+102
Report coverage `0` of dead blocks Fixes: #84018 With `-Z instrument-coverage`, coverage reporting of dead blocks (for example, blocks dropped because a conditional branch is dropped, based on const evaluation) is now supported. If `instrument-coverage` is enabled, `simplify::remove_dead_blocks()` finds all dropped coverage `Statement`s and adds their `code_region`s as `Unreachable` coverage `Statement`s to the `START_BLOCK`, so they are still included in the coverage map. Check out the resulting changes in the test coverage reports in this PR (in [commit 1](https://github.com/rust-lang/rust/pull/84797/commits/0b0d293c7c46bdadf80e5304a667e34c53c0cf7e)). r? `@tmandry` cc: `@wesleywiser`
2021-05-07rename LLVM target for RustyHermitStefan Lankes-1/+1
RustyHermit ist is a library operating system. In this case, we link a static library as kernel to the application. The final result is a bootable application. The library and the application have to use the same target. Currently, the targets are different (see also https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/x86_64_unknown_hermit.rs). Consequently, this commit change the LLVM target to 'hermit'. This kernel spec is needed to disable the usage of FPU registers, which are not allowed in kernel space. In contrast to Linux, everything is running in ring 0 and also in the same address space. Signed-off-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
2021-05-07Auto merge of #85022 - JohnTitor:rollup-2q4706v, r=JohnTitorbors-470/+689
Rollup of 9 pull requests Successful merges: - #84779 (Add support for --test-args to cargotest) - #84781 (Don't check bootstrap artifacts by default) - #84787 (bump deps) - #84815 (Update coverage docs and command line help) - #84875 (Removes unneeded check of `#[no_coverage]` in mapgen) - #84897 (Coverage instruments closure bodies in macros (not the macro body)) - #84911 (Retry clang+llvm download) - #84972 (CTFE inbounds-error-messages tweak) - #84990 (Sort rustdoc-gui tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-07Rollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, ↵Yuki Okushi-1/+6
r=Mark-Simulacrum Sort rustdoc-gui tests The rustdoc-gui tests were randomly run. Not really a big issue but I prefer the tests to be sorted.
2021-05-07Rollup merge of #84972 - RalfJung:null-ptr-msg, r=oli-obkYuki Okushi-11/+15
CTFE inbounds-error-messages tweak * use CheckInAllocMsg::PointerArithmeticTest for ptr_offset error * nicer errors for some null pointer cases r? `@oli-obk`
2021-05-07Rollup merge of #84911 - Mark-Simulacrum:retry-clang, r=pietroalbiniYuki Okushi-2/+4
Retry clang+llvm download We've been seeing a pretty high rate of spurious network failures (e.g., openssl connection reset by peer). Not clear why, but let's add a retry. r? `@pietroalbini`
2021-05-07Rollup merge of #84897 - richkadel:cover-closure-macros, r=tmandryYuki Okushi-49/+192
Coverage instruments closure bodies in macros (not the macro body) Fixes: #84884 This solution might be considered a compromise, but I think it is the better choice. The results in the `closure.rs` test correctly resolve all test cases broken as described in #84884. One test pattern (in both `closure_macro.rs` and `closure_macro_async.rs`) was also affected, and removes coverage statistics for the lines inside the closure, because the closure includes a macro. (The coverage remains at the callsite of the macro, so we lose some detail, but there isn't a perfect choice with macros. Often macro implementations are split across the macro and the callsite, and there doesn't appear to be a single "right choice" for which body should be covered. For the current implementation, we can't do both. The callsite is most likely to be the preferred site for coverage. r? `@tmandry` cc: `@wesleywiser`
2021-05-07Rollup merge of #84875 - richkadel:no-coverage-dont-check-unused, r=tmandryYuki Okushi-58/+56
Removes unneeded check of `#[no_coverage]` in mapgen There is an anticipated feature request to support a compiler flag that only adds coverage for specific files (or perhaps mods). As I thought about where that change would need to be supported, I realized that checking the attribute in mapgen (for unused functions) was unnecessary. The unused functions are only synthesized if they have MIR coverage, and functions with the `no_coverage` attribute will not have been instrumented with MIR coverage statements in the first place. New tests confirm this. Also, while adding tests, I updated resolved comments and FIXMEs in other tests, and expanded comments and tests on one remaining issue that is still not resolved. r? `@tmandry` cc: `@wesleywiser`
2021-05-07Rollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tmandryYuki Okushi-331/+385
Update coverage docs and command line help r? `@tmandry` cc: `@wesleywiser`
2021-05-07Rollup merge of #84787 - klensy:deps-bump, r=Mark-SimulacrumYuki Okushi-14/+24
bump deps openssl vulns: https://rustsec.org/advisories/RUSTSEC-2021-0056.html https://rustsec.org/advisories/RUSTSEC-2021-0055.html openssl-src v111.12.0+1.1.1h -> v111.15.0+1.1.1k not latest, but newer openssl-sys v0.9.58 -> v0.9.61 openssl v0.10.30 -> v0.10.33 curl vulns: https://curl.se/docs/vuln-7.74.0.html curl v0.4.34 -> v0.4.36 curl-sys v0.4.39+curl-7.74.0 -> v0.4.42+curl-7.76.0
2021-05-07Rollup merge of #84781 - jyn514:check-bootstrap, r=Mark-SimulacrumYuki Okushi-3/+3
Don't check bootstrap artifacts by default Bootstrap has to build successfully or this won't run, so all it checks are the tests, which are uncommon to change. Fixes https://github.com/rust-lang/rust/issues/76624.
2021-05-07Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-SimulacrumYuki Okushi-1/+4
Add support for --test-args to cargotest This allows running a single test without having to wait for all tests to complete. Closes https://github.com/rust-lang/rust/issues/77260.
2021-05-07Auto merge of #85014 - Dylan-DPC:rollup-jzpbkdu, r=Dylan-DPCbors-258/+763
Rollup of 11 pull requests Successful merges: - #84409 (Ensure TLS destructors run before thread joins in SGX) - #84500 (Add --run flag to compiletest) - #84728 (Add test for suggestion to borrow unsized function parameters) - #84734 (Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest) - #84755 (Allow using `core::` in intra-doc links within core itself) - #84871 (Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating)) - #84872 (Wire up tidy dependency checks for cg_clif) - #84896 (Handle incorrect placement of parentheses in trait bounds more gracefully) - #84905 (CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs) - #84953 (Remove unneeded call to with_default_session_globals in rustdoc highlight) - #84987 (small nits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-06illumos should put libc last in library search orderJoshua M. Clulow-0/+19
Under some conditions, the toolchain will produce a sequence of linker arguments that result in a NEEDED list that puts libc before libgcc_s; e.g., [0] NEEDED 0x2046ba libc.so.1 [1] NEEDED 0x204723 libm.so.2 [2] NEEDED 0x204736 libsocket.so.1 [3] NEEDED 0x20478b libumem.so.1 [4] NEEDED 0x204763 libgcc_s.so.1 Both libc and libgcc_s provide an unwinder implementation, but libgcc_s provides some extra symbols upon which Rust directly depends. If libc is first in the NEEDED list we will find some of those symbols in libc but others in libgcc_s, resulting in undefined behaviour as the two implementations do not use compatible interior data structures. This solution is not perfect, but is the simplest way to produce correct binaries on illumos for now.
2021-05-07Rollup merge of #84987 - lcnr:nits, r=Mark-SimulacrumDylan DPC-8/+0
small nits
2021-05-07Rollup merge of #84953 - ↵Dylan DPC-31/+33
GuillaumeGomez:remove-unneeded-with_default_session_globals, r=jyn514 Remove unneeded call to with_default_session_globals in rustdoc highlight This was the origin of the `Span` bug in https://github.com/rust-lang/rust/pull/84176. cc `````@Aaron1011````` r? `````@jyn514`````
2021-05-07Rollup merge of #84905 - RalfJung:copy, r=oli-obkDylan DPC-34/+34
CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs The `copy` name is confusing for this function because we also have `copy_op` which is pretty different. I hope `copy_intrinsic` is clearer. Also `step.rs` should really just contain the main loop and opcode dispatch, so move this helper function to a more appropriate place. r? ``````@oli-obk``````
2021-05-07Rollup merge of #84896 - estebank:issue-84772, r=jackh726Dylan DPC-3/+130
Handle incorrect placement of parentheses in trait bounds more gracefully Fix #84772. CC ``````@jonhoo``````
2021-05-07Rollup merge of #84872 - bjorn3:cg_clif_tidy, r=Mark-SimulacrumDylan DPC-47/+136
Wire up tidy dependency checks for cg_clif Also contains a fix and improvement to tidy. Required for https://github.com/rust-lang/rust/pull/81746.
2021-05-07Rollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisaDylan DPC-91/+18
Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: #84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ``` r? ````@Mark-Simulacrum```` cc: ````@tmandry```` ````@wesleywiser````
2021-05-07Rollup merge of #84755 - jyn514:core-links, r=kennytmDylan DPC-10/+14
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with https://github.com/rust-lang/rust/issues/73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
2021-05-07Rollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-SimulacrumDylan DPC-8/+44
Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest For the Fuchsia platform we build libstd with `panic=abort` and would like a way to run tests with that enabled. This adds low-level support for this directly to compiletest. In the future I'd like to add high-level support in rustbuild, e.g. having target-specific flags that allow configuring a panic strategy. (Side note: It would be nice if we could also build multiple configurations for the same target, but I'm getting ahead of myself.) This plus #84500 have everything that's needed to get ui tests passing on fuchsia targets. Part of #84766. Note that this change only includes the header on tests which need an unwinder to _build_, not those which need it to _run_. r? ````@Mark-Simulacrum````
2021-05-07Rollup merge of #84728 - camelid:sized-param-sugg-test, r=Mark-SimulacrumDylan DPC-0/+88
Add test for suggestion to borrow unsized function parameters Closes #82820. This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-16/+93
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-07Rollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=jethrogbDylan DPC-10/+173
Ensure TLS destructors run before thread joins in SGX The excellent test is from ```@jethrogb``` For context see: https://github.com/rust-lang/rust/pull/83416#discussion_r617282907
2021-05-06Auto merge of #84806 - Mark-Simulacrum:try-start-entry, r=cjgillotbors-101/+111
Streamline try_start code This shifts some branches around and avoids interleaving parallel and non-parallel versions of the function too much.
2021-05-06Auto merge of #79930 - tgnottingham:bufwriter_performance, r=m-ou-sebors-39/+178
Optimize BufWriter
2021-05-06Removes unneeded check of `#[no_coverage]` in mapgenRich Kadel-95/+56
And adds tests to validate it still works. There is an anticipated feature request to support a compiler flag that only adds coverage for specific files (or perhaps mods). As I thought about where that change would need to be supported, I realized that checking the attribute in mapgen (for unused functions) was unnecessary. The unused functions are only synthesized if they have MIR coverage, and functions with the `no_coverage` attribute will not have been instrumented with MIR coverage statements in the first place. New tests confirm this. Also, while adding tests, I updated resolved comments and FIXMEs in other tests.
2021-05-06Renamed compiler-flags file to name of compiler-flag: instrument-coverageRich Kadel-344/+349
And redirect users from the old file name.
2021-05-06Update coverage docs and command line helpRich Kadel-82/+131
2021-05-06Add test for suggestion to borrow unsized function parametersCamelid-0/+88
This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-06linker: Avoid library duplication with `/WHOLEARCHIVE`Vadim Petrochenkov-2/+0
2021-05-06Coverage instruments closure bodies in macros (not the macro body)Rich Kadel-49/+192
Fixes: #84884 This solution might be considered a compromise, but I think it is the better choice. The results in the `closure.rs` test correctly resolve all test cases broken as described in #84884. One test pattern (in both `closure_macro.rs` and `closure_macro_async.rs`) was also affected, and removes coverage statistics for the lines inside the closure, because the closure includes a macro. (The coverage remains at the callsite of the macro, so we lose some detail, but there isn't a perfect choice with macros. Often macro implementations are split across the macro and the callsite, and there doesn't appear to be a single "right choice" for which body should be covered. For the current implementation, we can't do both. The callsite is most likely to be the preferred site for coverage. I applied this fix to all `MacroKinds`, not just `Bang`. I'm trying to resolve an issue of lost coverage in a `MacroKind::Attr`-based, function-scoped macro. Instead of only searching for a body_span that is "not a function-like macro" (that is, MacroKind::Bang), I'm expanding this to all `MacroKind`s. Maybe I should expand this to `ExpnKind::Desugaring` and `ExpnKind::AstPass` (or subsets, depending on their sub-kinds) as well, but I'm not sure that's a good idea. I'd like to add a test of the `Attr` macro on functions, but I need time to figure out how to constract a good, simple example without external crate dependencies. For the moment, all tests still work as expected (no change), this new commit shouldn't have a negative affect, and more importantly, I believe it will have a positive effect. I will try to confirm this.
2021-05-06Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakisbors-1/+31
Deduplicate ParamCandidates with the same value except for bound vars Fixes #84398 This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution. r? `@nikomatsakis`
2021-05-06join_orders_after_tls_destructors: ensure thread 2 is launched before thread ↵Mohsen Zohrevandi-8/+9
1 enters TLS destructors
2021-05-06rustc: Support Rust-specific features in -Ctarget-featureAlex Crichton-15/+28
Since the beginning of time the `-Ctarget-feature` flag on the command line has largely been passed unmodified to LLVM. Afterwards, though, the `#[target_feature]` attribute was stabilized and some of the names in this attribute do not match the corresponding LLVM name. This is because Rust doesn't always want to stabilize the exact feature name in LLVM for the equivalent functionality in Rust. This creates a situation, however, where in Rust you'd write: #[target_feature(enable = "pclmulqdq")] unsafe fn foo() { // ... } but on the command line you would write: RUSTFLAGS="-Ctarget-feature=+pclmul" cargo build --release This difference is somewhat odd to deal with if you're a newcomer and the situation may be made worse with upcoming features like [WebAssembly SIMD](https://github.com/rust-lang/rust/issues/74372) which may be more prevalent. This commit implements a mapping to translate requests via `-Ctarget-feature` through the same name-mapping functionality that's present for attributes in Rust going to LLVM. This means that `+pclmulqdq` will work on x86 targets where as previously it did not. I've attempted to keep this backwards-compatible where the compiler will just opportunistically attempt to remap features found in `-Ctarget-feature`, but if there's something it doesn't understand it gets passed unmodified to LLVM just as it was before.