Commit Graph

143258 Commits

Author SHA1 Message Date
Joshua Nelson
ebbc949575 Note why Handler::fatal is different from Sesssion::fatal 2021-05-08 23:13:04 -04:00
Joshua Nelson
96509b4835 Make Diagnostic::span_fatal unconditionally raise an error
It had no callers which didn't immediately call `raise()`, and this
unifies the behavior with `Session`.
2021-05-08 23:12:04 -04:00
Joshua Nelson
e49f4471aa Remove some unnecessary uses of struct_span_fatal
All of them immediately called `emit()` then `raise()`, so they could
just call `span_fatal` directly.
2021-05-08 23:12:04 -04:00
Joshua Nelson
955fdaea4a Rename Parser::span_fatal_err -> Parser::span_err
The name was misleading, it wasn't actually a fatal error.
2021-05-08 23:11:59 -04:00
Charles Lew
89a67051a7 Add primary marker on codegen unit to take charge of main_wrapper for non-local cases. 2021-05-09 10:52:03 +08:00
bors
d6d028369b Auto merge of #83089 - Aaron1011:bootstrap-semi, r=Mark-Simulacrum
Enable `-W semicolon_in_expressions_from_macros` in bootstrap

Now that stdarch has been updated, we can do this without breaking the
build.
2021-05-08 23:11:45 +00:00
Camelid
4b7c8b0b53 Add #[track_caller] to FakeDefId::expect_real()
Now, in the case that the function is not inlined, the panic location
will be the caller's location, which is more helpful since the panic is
not `expect_real()`'s fault.
2021-05-08 15:35:44 -07:00
Camelid
ba13225ba1 Remove FakeDefId::expect_local()
This function returned a fake `DefIndex`, with no indication that it was
fake, when it was provided with a `FakeDefId::Fake`. Every use of the
function uses the returned `DefIndex` in a call to
`tcx.local_def_id_to_hir_id()`, which I'm pretty sure would panic if it
were given a fake `DefIndex`.

I removed the function and replaced all calls to it with a call to
`expect_real()` followed by `DefId::expect_local()` (that's a function
on the *real* `DefId`).
2021-05-08 15:35:44 -07:00
Aaron Hill
020d83d9f5
Enable -W semicolon_in_expressions_from_macros in bootstrap
Now that stdarch has been updated, we can do this without breaking the
build.
2021-05-08 18:15:14 -04:00
bors
881c1ac408 Auto merge of #83278 - Amanieu:bump_stdarch, r=Mark-Simulacrum
Bump stdarch submodule

Major changes:
- More AVX-512 intrinsics.
- More ARM & AArch64 NEON intrinsics.
- Updated unstable WASM intrinsics to latest draft standards.
- Intrinsics that previously used `#[rustc_args_required_const]` now use const generics. See #83167 for more details.
- `std_detect` is now a separate crate instead of a submodule of `std`.
2021-05-08 18:41:16 +00:00
Amanieu d'Antras
bf8b15f553 Bump stdarch submodule 2021-05-08 19:40:27 +01:00
bors
ff34b91907 Auto merge of #85072 - hyd-dev:miri, r=RalfJung
Update Miri

Fixes #85027

r? `@RalfJung`
2021-05-08 12:11:01 +00:00
hyd-dev
b55d9c0387
Update Miri 2021-05-08 19:53:15 +08:00
bors
bef3dc5b7f Auto merge of #84470 - jyn514:lints, r=GuillaumeGomez
rustdoc: Stop special casing `broken_intra_doc_links` unnecessarily
2021-05-08 09:46:18 +00:00
Nikita Popov
1b928ff8f8 Update LLVM submodule
This updates the LLVM submodule with recent LLVM 12.x fixes. In
particular, it resolves an assertion failure when targeting
AArch64 at O0.
2021-05-08 11:01:09 +02:00
Nikita Popov
c2b15a6b64 Support -C passes in NewPM
And report an error if parsing the additional pass pipeline fails.
Threading through the error accounts for most of the changes here.
2021-05-08 10:58:08 +02:00
Nikita Popov
5519cbfe33 Don't force -O1 with ThinLTO
This doesn't seem to be necessary anymore, although I don't know
at which point or why that changed.

Forcing -O1 makes some tests fail under NewPM, because NewPM also
performs inlining at -O1, so it ends up performing much more
optimization in practice than before.
2021-05-08 10:58:08 +02:00
Nikita Popov
7c4989ab70 Drop -opt-bisect-limit=0 flag from test
This causes an assertion failure under NewPM, because it also ends
up disabling the NameAnonGlobals pass.

Instead pass -Copt-level=0 to disable optimizations. If that should
be insufficient, we can use -C no-prepopulate-passes.
2021-05-08 10:58:08 +02:00
Nikita Popov
db140de8f2 Explicitly register GCOV profiling pass as well 2021-05-08 10:58:08 +02:00
Nikita Popov
5ecbe7fcf8 Explicitly register instrprof pass
Don't use "passes" for this purpose, explicitly insert it into
the correct place in the pipeline instead.
2021-05-08 10:58:08 +02:00
Nikita Popov
0318883cd6 Make -Z new-llvm-pass-manager an Option<bool>
To allow it to have an LLVM version dependent default.
2021-05-08 10:58:08 +02:00
bors
50e1dc1536 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)
2021-05-08 05:50:00 +00:00
bors
e002ac7e8a Auto merge of #85058 - Xanewok:update-rls, r=Xanewok
Update RLS

This mostly just includes e33f4e6849 so that this fixes #85055 (clippy-related breakage).
2021-05-08 02:57:40 +00:00
Mark Rousskov
0367e24f94 Avoid predecessors having Drop impls 2021-05-07 22:44:08 -04:00
bors
abf3ec5b33 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
2021-05-08 00:37:38 +00:00
Eric Huss
b0e49c798b Update cargo 2021-05-07 16:51:52 -07:00
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
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