Commit graph

143363 commits

Author SHA1 Message Date
Igor Matuszewski 3a17b01058 Update RLS 2021-05-08 01:10:51 +02:00
Dylan DPC 885231768b
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`
2021-05-08 01:06:27 +02:00
Dylan DPC b5092627c7
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.
2021-05-08 01:06:26 +02:00
Dylan DPC b4a00205d8
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`
2021-05-08 01:06:25 +02:00
Dylan DPC bba8f99281
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`
2021-05-08 01:06:24 +02:00
Dylan DPC 44bee536fe
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.
2021-05-08 01:06:23 +02:00
Dylan DPC eb36bc666a
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`
2021-05-08 01:06:22 +02:00
Cameron Steffen 2e2bba94be Fix duplicate unknown lint errors 2021-05-07 17:26:32 -05:00
bors 467253ff6a Auto merge of #83901 - cjgillot:hash-attr, r=wesleywiser
Integrate attributes as part of the crate hash

r? `@Aaron1011`
2021-05-07 21:56:31 +00:00
Joshua Nelson 6f5ace2729 rustdoc: Link to the docs on namespaces when an unknown disambiguator is found 2021-05-07 17:17:25 -04:00
Joshua Nelson e4b57e1884 Allow checking miri and RLS with x.py check src/tools/{miri,rls} 2021-05-07 17:15:20 -04:00
LeSeulArtichaut 6717f81b96 Also take unions and enums into account 2021-05-07 22:49:47 +02:00
LeSeulArtichaut 1e642f0a61 Add basic test 2021-05-07 21:50:22 +02:00
LeSeulArtichaut cecb3be49a Improve diagnostics for functions in struct definitions 2021-05-07 21:44:10 +02:00
Camille GILLOT 1891da0378 Hash attributes as part of the crate hash. 2021-05-07 21:42:42 +02:00
bors 770792ff8d Auto merge of #84980 - flip1995:clippyup, r=Manishearth
Update Clippy

Bi-weekly Clippy update.

r? `@Manishearth`
2021-05-07 19:28:03 +00:00
Fabian Wolff 439ef6d762 Fix suggestions for missing return type lifetime parameters 2021-05-07 20:46:49 +02:00
Chris Denton d9a58f4c87
Use path.exists() instead of fs::metadata(path).is_ok()
It's more explicit and allows platforms to optimize the existence check.
2021-05-07 17:32:40 +01:00
bors ca712bc425 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
2021-05-07 16:24:46 +00:00
Ralf Jung 6386656d45 bless 32bit 2021-05-07 17:24:50 +02:00
Guillaume Gomez 919bfd86d9 Don't stop running rustdoc-gui tests at first failure 2021-05-07 16:51:00 +02:00
Dylan DPC 42848090b5
Rollup merge of #85033 - lcnr:nits2, r=jackh726
some further small cleanups
2021-05-07 16:19:25 +02:00
Dylan DPC 62b68f9688
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.
2021-05-07 16:19:24 +02:00
Dylan DPC 73d3544fb9
Rollup merge of #85029 - jethrogb:jb/sgx-movable-mutex, r=m-ou-se
SGX mutex is movable

r? ``@m-ou-se``
2021-05-07 16:19:23 +02:00
Dylan DPC a3fbde4240
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.
2021-05-07 16:19:22 +02:00
Dylan DPC cea6e4d6b9
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
2021-05-07 16:19:21 +02:00
Dylan DPC 6e4c842305
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
2021-05-07 16:19:20 +02:00
Dylan DPC 8f0b1863d0
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````
2021-05-07 16:19:20 +02:00
Dylan DPC 0c8c21d224
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`````````
2021-05-07 16:19:19 +02:00
Dylan DPC cd37b95058
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.
2021-05-07 16:19:18 +02:00
Ralf Jung 4dddc3818e fix null pointer error messages 2021-05-07 15:13:23 +02:00
Jethro Beekman bfa84842e5 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-07 13:55:03 +02:00
Jethro Beekman 30b82e0f96 SGX mutex is movable 2021-05-07 13:21:38 +02:00
lcnr e00146f504 fulfillment typo 2021-05-07 12:17:58 +02:00
lcnr 3c3cf08e39 wfcheck fcx <-> tcx cleanup 2021-05-07 12:15:38 +02:00
bors e5f83d24ae 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](0b0d293c7c)).

r? `@tmandry`
cc: `@wesleywiser`
2021-05-07 10:06:40 +00:00
Stein Somers 728204b40e BTree: no longer copy keys and values before dropping them 2021-05-07 10:53:53 +02:00
Stefan Lankes 76f884abb9 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>
2021-05-07 10:09:11 +02:00
bors ac888e8675 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
2021-05-07 07:44:53 +00:00
Ralf Jung 2d2ed21615 array-to-raw-elem cast: test that Retag covers entire array 2021-05-07 09:36:45 +02:00
Yuki Okushi 87faf2e64f
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.
2021-05-07 15:20:30 +09:00
Yuki Okushi 47050275f4
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`
2021-05-07 15:20:29 +09:00
Yuki Okushi 326fec27a6
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`
2021-05-07 15:20:28 +09:00
Yuki Okushi 343a094aa1
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`
2021-05-07 15:20:26 +09:00
Yuki Okushi b088318985
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`
2021-05-07 15:20:25 +09:00
Yuki Okushi 283ef86784
Rollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tmandry
Update coverage docs and command line help

r? `@tmandry`
cc: `@wesleywiser`
2021-05-07 15:20:24 +09:00
Yuki Okushi 246e8d17ff
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
2021-05-07 15:20:23 +09:00
Yuki Okushi 1224e1341a
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.
2021-05-07 15:20:22 +09:00
Yuki Okushi 2d496f46bf
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.
2021-05-07 15:20:21 +09:00
hi-rustin f6dd332820 shrinking the deprecated method span 2021-05-07 10:41:04 +08:00