]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMake -Z new-llvm-pass-manager an Option<bool>
Nikita Popov [Sun, 4 Apr 2021 19:38:34 +0000 (21:38 +0200)]
Make -Z new-llvm-pass-manager an Option<bool>

To allow it to have an LLVM version dependent default.

3 years agoAuto merge of #85059 - ehuss:update-cargo, r=ehuss
bors [Sat, 8 May 2021 05:50:00 +0000 (05:50 +0000)]
Auto merge of #85059 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in f3e13226d6d17a2bc5f325303494b43a45f53b7f..e51522ab3db23b0d8f1de54eb1f0113924896331
2021-04-30 21:50:27 +0000 to 2021-05-07 21:29:52 +0000
- Add CARGO_TARGET_TMPDIR env var for integration tests & benches (rust-lang/cargo#9375)
- Bump to 0.55.0, update changelog (rust-lang/cargo#9464)
- Some updates to the unstable documentation (rust-lang/cargo#9457)
- Add CARGO_PROFILE_&lt;name&gt;_SPLIT_DEBUGINFO to env docs. (rust-lang/cargo#9456)
- Add `report` subcommand. (rust-lang/cargo#9438)
- Respect Cargo.toml `[package.exclude]` even not in a git repo. (rust-lang/cargo#9186)
- Document the other crates in the codebase in the contrib guide. (rust-lang/cargo#9439)

3 years agoAuto merge of #85058 - Xanewok:update-rls, r=Xanewok
bors [Sat, 8 May 2021 02:57:40 +0000 (02:57 +0000)]
Auto merge of #85058 - Xanewok:update-rls, r=Xanewok

Update RLS

This mostly just includes https://github.com/rust-lang/rls/commit/e33f4e68496b296dedb100e297dc4451f169b2b3 so that this fixes #85055 (clippy-related breakage).

3 years agoAuto merge of #85057 - Dylan-DPC:rollup-efaseq2, r=Dylan-DPC
bors [Sat, 8 May 2021 00:37:38 +0000 (00:37 +0000)]
Auto merge of #85057 - Dylan-DPC:rollup-efaseq2, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #76808 (Improve diagnostics for functions in `struct` definitions)
 - #84887 (Remove SpanInterner::get)
 - #85034 (fix null pointer error messages)
 - #85038 (Don't stop running rustdoc-gui tests at first failure)
 - #85044 (Use `path.exists()` instead of `fs::metadata(path).is_ok()`)
 - #85052 (rustdoc: Link to the docs on namespaces when an unknown disambiguator is found)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoUpdate cargo
Eric Huss [Fri, 7 May 2021 23:51:52 +0000 (16:51 -0700)]
Update cargo

3 years agoUpdate RLS
Igor Matuszewski [Fri, 7 May 2021 23:10:51 +0000 (01:10 +0200)]
Update RLS

3 years agoRollup merge of #85052 - jyn514:disambiguator, r=camelid
Dylan DPC [Fri, 7 May 2021 23:06:27 +0000 (01:06 +0200)]
Rollup merge of #85052 - jyn514:disambiguator, r=camelid

rustdoc: Link to the docs on namespaces when an unknown disambiguator is found

This was reverted in https://github.com/rust-lang/rust/pull/84950; this re-lands the changes, but without different behavior depending on the channel.

r? `@camelid` cc `@pietroalbini`

3 years agoRollup merge of #85044 - ChrisDenton:file-exists, r=jackh726
Dylan DPC [Fri, 7 May 2021 23:06:26 +0000 (01:06 +0200)]
Rollup merge of #85044 - ChrisDenton:file-exists, r=jackh726

Use `path.exists()` instead of `fs::metadata(path).is_ok()`

It's more explicit and potentially allows platforms to optimize the existence check.

3 years agoRollup merge of #85038 - GuillaumeGomez:dont-stop-first-rustdoc-gui-failure, r=Mark...
Dylan DPC [Fri, 7 May 2021 23:06:25 +0000 (01:06 +0200)]
Rollup merge of #85038 - GuillaumeGomez:dont-stop-first-rustdoc-gui-failure, r=Mark-Simulacrum

Don't stop running rustdoc-gui tests at first failure

I just realized that before this PR, the rustdoc-gui test suite was stopping at the first failure, which isn't very convenient. All tests are now running and if one failed, it returns an error at the end once all tests have run.

r? `@Mark-Simulacrum`

3 years agoRollup merge of #85034 - RalfJung:null-ptr, r=oli-obk
Dylan DPC [Fri, 7 May 2021 23:06:24 +0000 (01:06 +0200)]
Rollup merge of #85034 - RalfJung:null-ptr, r=oli-obk

fix null pointer error messages

I got the `match` in https://github.com/rust-lang/rust/pull/84972 wrong, this fixes that.
Also avoid redundant "inbounds test failed:" prefix.

Should fix https://github.com/rust-lang/rust/issues/85027

r? `@oli-obk`

3 years agoRollup merge of #84887 - jyn514:index-span, r=Xanewok
Dylan DPC [Fri, 7 May 2021 23:06:23 +0000 (01:06 +0200)]
Rollup merge of #84887 - jyn514:index-span, r=Xanewok

Remove SpanInterner::get

- It's used exactly once, so it's trivial to replace
- It doesn't match the normal convention for containers: normally
`get()` returns an option and indexing panics. Instead `SpanInterner::get()` panics
  and there's no indexing operation available.

3 years agoRollup merge of #76808 - LeSeulArtichaut:diagnose-functions-struct, r=jackh726
Dylan DPC [Fri, 7 May 2021 23:06:22 +0000 (01:06 +0200)]
Rollup merge of #76808 - LeSeulArtichaut:diagnose-functions-struct, r=jackh726

Improve diagnostics for functions in `struct` definitions

Tries to implement #76421.
This is probably going to need unit tests, but I wanted to hear from review all the cases tests should cover.

I'd like to follow up with the "mechanically applicable suggestion here that adds an impl block" step, but I'd need guidance. My idea for now would be to try to parse a function, and if that succeeds, create a dummy `ast::Item` impl block to then format it using `pprust`. Would that be a viable approach? Is there a better alternative?

r? `@matklad` cc `@estebank`

3 years agoAuto merge of #83901 - cjgillot:hash-attr, r=wesleywiser
bors [Fri, 7 May 2021 21:56:31 +0000 (21:56 +0000)]
Auto merge of #83901 - cjgillot:hash-attr, r=wesleywiser

Integrate attributes as part of the crate hash

r? `@Aaron1011`

3 years agorustdoc: Link to the docs on namespaces when an unknown disambiguator is found
Joshua Nelson [Mon, 5 Apr 2021 00:02:32 +0000 (20:02 -0400)]
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found

3 years agoAlso take unions and enums into account
LeSeulArtichaut [Fri, 7 May 2021 20:49:47 +0000 (22:49 +0200)]
Also take unions and enums into account

3 years agoAdd basic test
LeSeulArtichaut [Thu, 17 Sep 2020 16:44:09 +0000 (18:44 +0200)]
Add basic test

3 years agoImprove diagnostics for functions in `struct` definitions
LeSeulArtichaut [Wed, 16 Sep 2020 21:10:05 +0000 (23:10 +0200)]
Improve diagnostics for functions in `struct` definitions

3 years agoHash attributes as part of the crate hash.
Camille GILLOT [Mon, 5 Apr 2021 20:09:49 +0000 (22:09 +0200)]
Hash attributes as part of the crate hash.

3 years agoAuto merge of #84980 - flip1995:clippyup, r=Manishearth
bors [Fri, 7 May 2021 19:28:03 +0000 (19:28 +0000)]
Auto merge of #84980 - flip1995:clippyup, r=Manishearth

Update Clippy

Bi-weekly Clippy update.

r? `@Manishearth`

3 years agoUse `path.exists()` instead of `fs::metadata(path).is_ok()`
Chris Denton [Fri, 7 May 2021 16:32:40 +0000 (17:32 +0100)]
Use `path.exists()` instead of `fs::metadata(path).is_ok()`

It's more explicit and allows platforms to optimize the existence check.

3 years agoAuto merge of #85036 - Dylan-DPC:rollup-4qfabo3, r=Dylan-DPC
bors [Fri, 7 May 2021 16:24:46 +0000 (16:24 +0000)]
Auto merge of #85036 - Dylan-DPC:rollup-4qfabo3, r=Dylan-DPC

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

3 years agobless 32bit
Ralf Jung [Fri, 7 May 2021 15:24:50 +0000 (17:24 +0200)]
bless 32bit

3 years agoDon't stop running rustdoc-gui tests at first failure
Guillaume Gomez [Fri, 7 May 2021 14:51:00 +0000 (16:51 +0200)]
Don't stop running rustdoc-gui tests at first failure

3 years agoRollup merge of #85033 - lcnr:nits2, r=jackh726
Dylan DPC [Fri, 7 May 2021 14:19:25 +0000 (16:19 +0200)]
Rollup merge of #85033 - lcnr:nits2, r=jackh726

some further small cleanups

3 years agoRollup merge of #85030 - jethrogb:jb/sgx-rearrange-files, r=nagisa
Dylan DPC [Fri, 7 May 2021 14:19:24 +0000 (16:19 +0200)]
Rollup merge of #85030 - jethrogb:jb/sgx-rearrange-files, r=nagisa

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.

3 years agoRollup merge of #85029 - jethrogb:jb/sgx-movable-mutex, r=m-ou-se
Dylan DPC [Fri, 7 May 2021 14:19:23 +0000 (16:19 +0200)]
Rollup merge of #85029 - jethrogb:jb/sgx-movable-mutex, r=m-ou-se

SGX mutex is movable

r? ``@m-ou-se``

3 years agoRollup merge of #84991 - alexcrichton:target-feature-remap, r=nagisa
Dylan DPC [Fri, 7 May 2021 14:19:22 +0000 (16:19 +0200)]
Rollup merge of #84991 - alexcrichton:target-feature-remap, r=nagisa

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.

3 years agoRollup merge of #84930 - hermitcore:target, r=nagisa
Dylan DPC [Fri, 7 May 2021 14:19:21 +0000 (16:19 +0200)]
Rollup merge of #84930 - hermitcore:target, r=nagisa

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

3 years agoRollup merge of #84866 - petrochenkov:wholesome, r=Mark-Simulacrum
Dylan DPC [Fri, 7 May 2021 14:19:20 +0000 (16:19 +0200)]
Rollup merge of #84866 - petrochenkov:wholesome, r=Mark-Simulacrum

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

3 years agoRollup merge of #84655 - CDirkx:wasm, r=m-ou-se
Dylan DPC [Fri, 7 May 2021 14:19:20 +0000 (16:19 +0200)]
Rollup merge of #84655 - CDirkx:wasm, r=m-ou-se

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````

3 years agoRollup merge of #84442 - jyn514:doc-cfg, r=petrochenkov
Dylan DPC [Fri, 7 May 2021 14:19:19 +0000 (16:19 +0200)]
Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkov

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`````````

3 years agoRollup merge of #84254 - jclulow:illumos-link-order, r=petrochenkov
Dylan DPC [Fri, 7 May 2021 14:19:18 +0000 (16:19 +0200)]
Rollup merge of #84254 - jclulow:illumos-link-order, r=petrochenkov

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.

3 years agofix null pointer error messages
Ralf Jung [Fri, 7 May 2021 13:11:18 +0000 (15:11 +0200)]
fix null pointer error messages

3 years agoRearrange SGX split module files
Jethro Beekman [Fri, 7 May 2021 11:40:43 +0000 (13:40 +0200)]
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.

3 years agoSGX mutex is movable
Jethro Beekman [Fri, 7 May 2021 11:21:38 +0000 (13:21 +0200)]
SGX mutex is movable

3 years agofulfillment typo
lcnr [Fri, 7 May 2021 10:17:58 +0000 (12:17 +0200)]
fulfillment typo

3 years agowfcheck fcx <-> tcx cleanup
lcnr [Fri, 7 May 2021 10:15:38 +0000 (12:15 +0200)]
wfcheck fcx <-> tcx cleanup

3 years agoAuto merge of #84797 - richkadel:cover-unreachable-statements, r=tmandry
bors [Fri, 7 May 2021 10:06:40 +0000 (10:06 +0000)]
Auto merge of #84797 - richkadel:cover-unreachable-statements, r=tmandry

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`

3 years agorename LLVM target for RustyHermit
Stefan Lankes [Tue, 4 May 2021 23:03:50 +0000 (01:03 +0200)]
rename LLVM target for RustyHermit

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>
3 years agoAuto merge of #85022 - JohnTitor:rollup-2q4706v, r=JohnTitor
bors [Fri, 7 May 2021 07:44:53 +0000 (07:44 +0000)]
Auto merge of #85022 - JohnTitor:rollup-2q4706v, r=JohnTitor

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

3 years agoRollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, r=Mark-Simulacrum
Yuki Okushi [Fri, 7 May 2021 06:20:30 +0000 (15:20 +0900)]
Rollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, 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.

3 years agoRollup merge of #84972 - RalfJung:null-ptr-msg, r=oli-obk
Yuki Okushi [Fri, 7 May 2021 06:20:29 +0000 (15:20 +0900)]
Rollup merge of #84972 - RalfJung:null-ptr-msg, r=oli-obk

CTFE inbounds-error-messages tweak

* use CheckInAllocMsg::PointerArithmeticTest for ptr_offset error
* nicer errors for some null pointer cases

r? `@oli-obk`

3 years agoRollup merge of #84911 - Mark-Simulacrum:retry-clang, r=pietroalbini
Yuki Okushi [Fri, 7 May 2021 06:20:28 +0000 (15:20 +0900)]
Rollup merge of #84911 - Mark-Simulacrum:retry-clang, r=pietroalbini

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`

3 years agoRollup merge of #84897 - richkadel:cover-closure-macros, r=tmandry
Yuki Okushi [Fri, 7 May 2021 06:20:26 +0000 (15:20 +0900)]
Rollup merge of #84897 - richkadel:cover-closure-macros, r=tmandry

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`

3 years agoRollup merge of #84875 - richkadel:no-coverage-dont-check-unused, r=tmandry
Yuki Okushi [Fri, 7 May 2021 06:20:25 +0000 (15:20 +0900)]
Rollup merge of #84875 - richkadel:no-coverage-dont-check-unused, r=tmandry

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`

3 years agoRollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tmandry
Yuki Okushi [Fri, 7 May 2021 06:20:24 +0000 (15:20 +0900)]
Rollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tmandry

Update coverage docs and command line help

r? `@tmandry`
cc: `@wesleywiser`

3 years agoRollup merge of #84787 - klensy:deps-bump, r=Mark-Simulacrum
Yuki Okushi [Fri, 7 May 2021 06:20:23 +0000 (15:20 +0900)]
Rollup merge of #84787 - klensy:deps-bump, r=Mark-Simulacrum

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

3 years agoRollup merge of #84781 - jyn514:check-bootstrap, r=Mark-Simulacrum
Yuki Okushi [Fri, 7 May 2021 06:20:22 +0000 (15:20 +0900)]
Rollup merge of #84781 - jyn514:check-bootstrap, r=Mark-Simulacrum

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.

3 years agoRollup merge of #84779 - jyn514:cargotest-args, r=Mark-Simulacrum
Yuki Okushi [Fri, 7 May 2021 06:20:21 +0000 (15:20 +0900)]
Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-Simulacrum

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.

3 years agoAuto merge of #85014 - Dylan-DPC:rollup-jzpbkdu, r=Dylan-DPC
bors [Fri, 7 May 2021 01:16:08 +0000 (01:16 +0000)]
Auto merge of #85014 - Dylan-DPC:rollup-jzpbkdu, r=Dylan-DPC

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

3 years agoillumos should put libc last in library search order
Joshua M. Clulow [Fri, 7 May 2021 00:01:50 +0000 (17:01 -0700)]
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.

3 years agoRollup merge of #84987 - lcnr:nits, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 22:38:45 +0000 (00:38 +0200)]
Rollup merge of #84987 - lcnr:nits, r=Mark-Simulacrum

small nits

3 years agoRollup merge of #84953 - GuillaumeGomez:remove-unneeded-with_default_session_globals...
Dylan DPC [Thu, 6 May 2021 22:38:44 +0000 (00:38 +0200)]
Rollup merge of #84953 - 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`````

3 years agoRollup merge of #84905 - RalfJung:copy, r=oli-obk
Dylan DPC [Thu, 6 May 2021 22:38:43 +0000 (00:38 +0200)]
Rollup merge of #84905 - RalfJung:copy, r=oli-obk

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``````

3 years agoRollup merge of #84896 - estebank:issue-84772, r=jackh726
Dylan DPC [Thu, 6 May 2021 22:38:42 +0000 (00:38 +0200)]
Rollup merge of #84896 - estebank:issue-84772, r=jackh726

Handle incorrect placement of parentheses in trait bounds more gracefully

Fix #84772.

CC ``````@jonhoo``````

3 years agoRollup merge of #84872 - bjorn3:cg_clif_tidy, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 22:38:41 +0000 (00:38 +0200)]
Rollup merge of #84872 - bjorn3:cg_clif_tidy, r=Mark-Simulacrum

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.

3 years agoRollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisa
Dylan DPC [Thu, 6 May 2021 22:38:40 +0000 (00:38 +0200)]
Rollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisa

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````

3 years agoRollup merge of #84755 - jyn514:core-links, r=kennytm
Dylan DPC [Thu, 6 May 2021 22:38:38 +0000 (00:38 +0200)]
Rollup merge of #84755 - jyn514:core-links, r=kennytm

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.

3 years agoRollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 22:38:37 +0000 (00:38 +0200)]
Rollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-Simulacrum

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````

3 years agoRollup merge of #84728 - camelid:sized-param-sugg-test, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 22:38:36 +0000 (00:38 +0200)]
Rollup merge of #84728 - camelid:sized-param-sugg-test, r=Mark-Simulacrum

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.

3 years agoRollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 22:38:35 +0000 (00:38 +0200)]
Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-Simulacrum

Add --run flag to compiletest

This controls whether run-* tests actually get run.

r? ```@Mark-Simulacrum```

3 years agoRollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=jethrogb
Dylan DPC [Thu, 6 May 2021 22:38:33 +0000 (00:38 +0200)]
Rollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=jethrogb

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

3 years agoAuto merge of #84806 - Mark-Simulacrum:try-start-entry, r=cjgillot
bors [Thu, 6 May 2021 22:35:06 +0000 (22:35 +0000)]
Auto merge of #84806 - Mark-Simulacrum:try-start-entry, r=cjgillot

Streamline try_start code

This shifts some branches around and avoids interleaving parallel and
non-parallel versions of the function too much.

3 years agoAuto merge of #79930 - tgnottingham:bufwriter_performance, r=m-ou-se
bors [Thu, 6 May 2021 20:04:32 +0000 (20:04 +0000)]
Auto merge of #79930 - tgnottingham:bufwriter_performance, r=m-ou-se

Optimize BufWriter

3 years agoRemoves unneeded check of `#[no_coverage]` in mapgen
Rich Kadel [Mon, 3 May 2021 18:23:40 +0000 (11:23 -0700)]
Removes unneeded check of `#[no_coverage]` in mapgen

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.

3 years agoRenamed compiler-flags file to name of compiler-flag: instrument-coverage
Rich Kadel [Thu, 6 May 2021 19:21:24 +0000 (12:21 -0700)]
Renamed compiler-flags file to name of compiler-flag: instrument-coverage

And redirect users from the old file name.

3 years agoUpdate coverage docs and command line help
Rich Kadel [Mon, 3 May 2021 01:25:57 +0000 (18:25 -0700)]
Update coverage docs and command line help

3 years agoAdd test for suggestion to borrow unsized function parameters
Camelid [Thu, 29 Apr 2021 23:22:31 +0000 (16:22 -0700)]
Add test for suggestion to borrow unsized function parameters

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.

3 years agolinker: Avoid library duplication with `/WHOLEARCHIVE`
Vadim Petrochenkov [Mon, 3 May 2021 14:04:59 +0000 (17:04 +0300)]
linker: Avoid library duplication with `/WHOLEARCHIVE`

3 years agoCoverage instruments closure bodies in macros (not the macro body)
Rich Kadel [Tue, 4 May 2021 06:21:24 +0000 (23:21 -0700)]
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.

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.

3 years agoAuto merge of #84559 - jackh726:issue-84398, r=nikomatsakis
bors [Thu, 6 May 2021 17:42:32 +0000 (17:42 +0000)]
Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakis

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`

3 years agojoin_orders_after_tls_destructors: ensure thread 2 is launched before thread 1 enters...
Mohsen Zohrevandi [Thu, 6 May 2021 16:36:26 +0000 (09:36 -0700)]
join_orders_after_tls_destructors: ensure thread 2 is launched before thread 1 enters TLS destructors

3 years agorustc: Support Rust-specific features in -Ctarget-feature
Alex Crichton [Thu, 6 May 2021 15:47:55 +0000 (08:47 -0700)]
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.

3 years agoAuto merge of #84982 - Dylan-DPC:rollup-q4cbec2, r=Dylan-DPC
bors [Thu, 6 May 2021 15:19:39 +0000 (15:19 +0000)]
Auto merge of #84982 - Dylan-DPC:rollup-q4cbec2, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #83507 (Implement RFC 2951: Native link modifiers)
 - #84328 (Stablize {HashMap,BTreeMap}::into_{keys,values})
 - #84712 (Simplify chdir implementation and minimize unsafe block)
 - #84851 (:arrow_up: rust-analyzer)
 - #84923 (Only compute Obligation `cache_key` once  in `register_obligation_at`)
 - #84945 (E0583: Include secondary path in error message)
 - #84949 (Fix typo in `MaybeUninit::array_assume_init` safety comment)
 - #84950 (Revert PR 83866)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoSort rustdoc-gui tests
Guillaume Gomez [Thu, 6 May 2021 14:51:04 +0000 (16:51 +0200)]
Sort rustdoc-gui tests

3 years agooutdated comment
lcnr [Thu, 6 May 2021 14:27:59 +0000 (16:27 +0200)]
outdated comment

3 years agoPick candidate with fewer bound vars
Jack Huey [Thu, 6 May 2021 14:19:51 +0000 (10:19 -0400)]
Pick candidate with fewer bound vars

3 years agoremove unused variant
lcnr [Thu, 6 May 2021 12:59:53 +0000 (14:59 +0200)]
remove unused variant

3 years agoRollup merge of #84950 - pietroalbini:revert-3478f83c0, r=Mark-Simulacrum
Dylan DPC [Thu, 6 May 2021 11:31:01 +0000 (13:31 +0200)]
Rollup merge of #84950 - pietroalbini:revert-3478f83c0, r=Mark-Simulacrum

Revert PR 83866

https://github.com/rust-lang/rust/pull/83866 caused multiple test failures when Rust's channel is changed from nightly to anything else. The PR will have to be landed again after the test suite is fixed.

The two kinds of test failures were:

* Rustdoc tests failed because the links in the generated HTML didn't point at nightly anymore, see https://github.com/rust-lang/rust/pull/84909#issuecomment-832028701
* Rustdoc UI tests failed because the links included in error messages didn't point at nightly anymore, see https://github.com/rust-lang/rust/pull/84909#issuecomment-832517722

r? ``@Mark-Simulacrum``
cc ``@jyn514``

3 years agoRollup merge of #84949 - sdroege:maybe-unint-typo, r=m-ou-se
Dylan DPC [Thu, 6 May 2021 11:31:00 +0000 (13:31 +0200)]
Rollup merge of #84949 - sdroege:maybe-unint-typo, r=m-ou-se

Fix typo in `MaybeUninit::array_assume_init` safety comment

And also add backticks around `MaybeUninit`.

3 years agoRollup merge of #84945 - fee1-dead:E0583-better-message, r=petrochenkov
Dylan DPC [Thu, 6 May 2021 11:30:59 +0000 (13:30 +0200)]
Rollup merge of #84945 - fee1-dead:E0583-better-message, r=petrochenkov

E0583: Include secondary path in error message

Fixes #84819.

3 years agoRollup merge of #84923 - estebank:as_cache_key-once, r=petrochenkov
Dylan DPC [Thu, 6 May 2021 11:30:58 +0000 (13:30 +0200)]
Rollup merge of #84923 - estebank:as_cache_key-once, r=petrochenkov

Only compute Obligation `cache_key` once  in `register_obligation_at`

3 years agoRollup merge of #84851 - lnicola:rust-analyzer-2021-05-03, r=jonas-schievink
Dylan DPC [Thu, 6 May 2021 11:30:56 +0000 (13:30 +0200)]
Rollup merge of #84851 - lnicola:rust-analyzer-2021-05-03, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #84712 - joshtriplett:simplify-chdir, r=yaahc
Dylan DPC [Thu, 6 May 2021 11:30:55 +0000 (13:30 +0200)]
Rollup merge of #84712 - joshtriplett:simplify-chdir, r=yaahc

Simplify chdir implementation and minimize unsafe block

3 years agoRollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-se
Dylan DPC [Thu, 6 May 2021 11:30:54 +0000 (13:30 +0200)]
Rollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-se

Stablize {HashMap,BTreeMap}::into_{keys,values}

I would propose to stabilize `{HashMap,BTreeMap}::into_{keys,values}`( aka. `map_into_keys_values`).

Closes #75294.

3 years agoRollup merge of #83507 - luqmana:native-link-modifiers, r=petrochenkov
Dylan DPC [Thu, 6 May 2021 11:30:51 +0000 (13:30 +0200)]
Rollup merge of #83507 - luqmana:native-link-modifiers, r=petrochenkov

Implement RFC 2951: Native link modifiers

A first attempt at implementing https://github.com/rust-lang/rfcs/pull/2951 / https://github.com/rust-lang/compiler-team/issues/356.

Tracking Issue: https://github.com/rust-lang/rust/issues/81490

Introduces feature flags for the general syntax (`native_link_modifiers`) and each modifier (`native_link_modifiers_{as_needed,bundle,verbatim,whole_archive}`).

r? `@petrochenkov`

3 years agoAuto merge of #84965 - the8472:lazy-delayed-diagnostics, r=Mark-Simulacrum
bors [Thu, 6 May 2021 11:29:29 +0000 (11:29 +0000)]
Auto merge of #84965 - the8472:lazy-delayed-diagnostics, r=Mark-Simulacrum

lazify backtrace formatting for delayed diagnostics

Formatting backtraces causes debug info to be parsed, which is superfluous work if the delayed bugs get cleared later.

Lazifying them results in these speedups for the UI testsuite:

|       | debuginfo = 0 | debuginfo = 1 | debuginfo = 2 |
|-------|---------------|---------------|---------------|
| eager | 31.59s        | 37.55s        | 42.64s        |
| lazy  | 30.44s        | 30.86s        | 34.07s        |

3 years agoUpdate Cargo.lock
flip1995 [Thu, 6 May 2021 10:21:46 +0000 (12:21 +0200)]
Update Cargo.lock

3 years agoMerge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup
flip1995 [Thu, 6 May 2021 09:51:22 +0000 (11:51 +0200)]
Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup

3 years ago32bit bless
Ralf Jung [Thu, 6 May 2021 10:00:19 +0000 (12:00 +0200)]
32bit bless

3 years agoAuto merge of #7178 - flip1995:rustup, r=flip1995
bors [Thu, 6 May 2021 09:45:37 +0000 (09:45 +0000)]
Auto merge of #7178 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoBump Clippy version -> 0.1.54
flip1995 [Thu, 6 May 2021 09:32:34 +0000 (11:32 +0200)]
Bump Clippy version -> 0.1.54

3 years agoBump nightly version -> 2021-05-06
flip1995 [Thu, 6 May 2021 09:32:27 +0000 (11:32 +0200)]
Bump nightly version -> 2021-05-06

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 6 May 2021 09:22:33 +0000 (11:22 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7177 - giraffate:add_a_missing_lint_to_msrv_config_doc, r=flip1995
bors [Thu, 6 May 2021 08:43:36 +0000 (08:43 +0000)]
Auto merge of #7177 - giraffate:add_a_missing_lint_to_msrv_config_doc, r=flip1995

Add a missing lint to MSRV config doc

A follow-up of https://github.com/rust-lang/rust-clippy/pull/6859.

changelog: Add a missing lint to MSRV config doc

3 years agouse CheckInAllocMsg::PointerArithmeticTest for ptr_offset error
Ralf Jung [Wed, 5 May 2021 22:16:27 +0000 (00:16 +0200)]
use CheckInAllocMsg::PointerArithmeticTest for ptr_offset error

3 years agoAuto merge of #7166 - TaKO8Ki:refactor_misc_early_module, r=llogiq
bors [Thu, 6 May 2021 07:46:52 +0000 (07:46 +0000)]
Auto merge of #7166 - TaKO8Ki:refactor_misc_early_module, r=llogiq

Refactor: arrange lints in misc_early module

This PR arranges misc_early lints so that they can be accessed more easily.
Basically, I refactored them following the instruction described in #6680.

cc: `@Y-Nak,` `@flip1995,` `@magurotuna`

changelog: Move lints in misc_early module into their own modules.

3 years agoAuto merge of #84468 - iladin:iladin/fix-84467, r=petrochenkov
bors [Thu, 6 May 2021 07:02:06 +0000 (07:02 +0000)]
Auto merge of #84468 - iladin:iladin/fix-84467, r=petrochenkov

Fix#84467 linker_args with --target=sparcv9-sun-solaris

Trying to cross-compile for sparcv9-sun-solaris
getting a error message for -zignore

Introduced when -z -ignore was seperated here
22d0ab0

No formatting done

Reproduce

``` bash
rustup target add sparcv9-sun-solaris
cargo new --bin hello && cd hello && cargo run --target=sparcv9-sun-solaris
```

config.toml

[target.sparcv9-sun-solaris]
linker = "gcc"

3 years agoAdd a missing lint to MSRV config doc
Takayuki Nakata [Thu, 6 May 2021 05:04:50 +0000 (14:04 +0900)]
Add a missing lint to MSRV config doc

3 years agoAuto merge of #84266 - QuiltOS:statically-disallow-global-oom-handling, r=Mark-Simulacrum
bors [Thu, 6 May 2021 04:41:20 +0000 (04:41 +0000)]
Auto merge of #84266 - QuiltOS:statically-disallow-global-oom-handling, r=Mark-Simulacrum

alloc: Add unstable Cfg feature `no-global_oom_handling

For certain sorts of systems, programming, it's deemed essential that
all allocation failures be explicitly handled where they occur. For
example, see Linus Torvald's opinion in [1]. Merely not calling global
panic handlers, or always `try_reserving` first (for vectors), is not
deemed good enough, because the mere presence of the global OOM handlers
is burdens static analysis.

One option for these projects to use rust would just be to skip `alloc`,
rolling their own allocation abstractions.  But this would, in my
opinion be a real shame. `alloc` has a few `try_*` methods already, and
we could easily have more. Features like custom allocator support also
demonstrate and existing to support diverse use-cases with the same
abstractions.

A natural way to add such a feature flag would a Cargo feature, but
there are currently uncertainties around how std library crate's Cargo
features may or not be stable, so to avoid any risk of stabilizing by
mistake we are going with a more low-level "raw cfg" token, which
cannot be interacted with via Cargo alone.

Note also that since there is no notion of "default cfg tokens" outside
of Cargo features, we have to invert the condition from
`global_oom_handling` to to `not(no_global_oom_handling)`. This breaks
the monotonicity that would be important for a Cargo feature (i.e.
turning on more features should never break compatibility), but it
doesn't matter for raw cfg tokens which are not intended to be
"constraint solved" by Cargo or anything else.

To support this use-case we create a new feature, "global-oom-handling",
on by default, and put the global OOM handler infra and everything else
it that depends on it behind it. By default, nothing is changed, but
users concerned about global handling can make sure it is disabled, and
be confident that all OOM handling is local and explicit.

For this first iteration, non-flat collections are outright disabled.
`Vec` and `String` don't yet have `try_*` allocation methods, but are
kept anyways since they can be oom-safely created "from parts", and we
hope to add those `try_` methods in the future.

[1]: https://lore.kernel.org/lkml/CAHk-=wh_sNLoz84AUUzuqXEsYH35u=8HV3vK-jbRbJ_B-JjGrg@mail.gmail.com/