Commit Graph

143407 Commits

Author SHA1 Message Date
Paul Trojahn
8f14592aa2 Improve "panic message is not a string literal" warning
This warning always referenced panic! even in case of an
assert. Related to #84656
2021-05-09 17:56:50 +02:00
Ralf Jung
7a01160ce4 more erroneous-const tests 2021-05-09 16:07:00 +02:00
bors
bba8710616 Auto merge of #83596 - jyn514:session-dead-code, r=oli-obk
Remove dead or useless code from Session

This is a more principled follow-up to https://github.com/rust-lang/rust/pull/83185#discussion_r601753839.

- Rename `Parser::span_fatal_err` -> `Parser::span_err`
- Remove some unnecessary uses of `struct_span_fatal`
- Make `Diagnostic::span_fatal` unconditionally raise an error
- Add `impl Deref<Target = Handler>` for Session and remove all functions that are exactly the same as their Handler counterparts
- Note why `Handler::fatal` is different from `Sesssion::fatal`
- Remove unused `opt_span_warn` function

r? `@oli-obk` or `@estebank`
2021-05-09 13:38:17 +00:00
Ralf Jung
8a878f07e9 ensure failing promoteds in const/static bodies are handled correctly 2021-05-09 14:56:34 +02:00
Ralf Jung
bafc51e01a remove const_fn feature gate 2021-05-09 14:29:31 +02:00
bors
19dae7b453 Auto merge of #85093 - camelid:remove-fake-expect_local, r=GuillaumeGomez
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-09 11:17:17 +00:00
hi-rustin
fc544abe03 Fix typo 2021-05-09 12:24:58 +08:00
Joshua Nelson
f25aa5767f Remove unused opt_span_warn function 2021-05-08 23:14:09 -04:00
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
hamidreza kalbasi
efc8f65b85 Try to fix issue 68049 2021-05-09 05:26:59 +04:30
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
LeSeulArtichaut
f2077c728c Error on conflicting #[doc(inline)]/#[doc(no_inline)] attributes 2021-05-08 17:22:26 +02:00
LeSeulArtichaut
245f582139 Emit invalid_doc_attributes warnings in more cases 2021-05-08 16:42:22 +02: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
hi-rustin
7c5bc204fa Address comments 2021-05-08 09:02:22 +08: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
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