Commit Graph

143290 Commits

Author SHA1 Message Date
Deadbeef
5068cbc901
Document Rc::from 2021-05-10 18:46:13 +08:00
bors
1b30245ea1 Auto merge of #85053 - camsteffen:duplicate-lint, r=davidtwco
Fix duplicate unknown lint errors

Fixes rust-lang/rust-clippy#6602
2021-05-10 09:45:28 +00:00
bors
2fb1dee14b Auto merge of #85104 - hi-rustin:rustin-patch-typo, r=jonas-schievink
Fix typo
2021-05-10 07:15:23 +00:00
bors
00f2bf40d6 Auto merge of #85074 - GuillaumeGomez:end-toggle-migration, r=jsha
Migrate top doc and non-exhaustive toggles to details tag

Fixes #83332.

r? `@jsha`
2021-05-10 04:05:55 +00:00
hamidreza kalbasi
8f5585ac00 remove big match 2021-05-10 05:53:42 +04:30
bors
d29289c509 Auto merge of #84507 - crlf0710:codegen_nonlocal_main_wrapper, r=nagisa
Add primary marker on codegen unit and generate main wrapper on primary codegen.

This is the codegen part of changes extracted from #84062.

This add a marker called `primary` on each codegen units, where exactly one codegen unit will be `primary = true` at a time. This specific codegen unit will take charge of generating `main` wrapper when `main` is imported from a foreign crate after the implementation of RFC 1260.

cc #28937

I'm not sure who should i ask for review for codegen changes, so feel free to reassign.
r? `@nagisa`
2021-05-10 00:42:31 +00:00
hamidreza kalbasi
48f5f01e8b move logic to a function 2021-05-10 03:31:31 +04:30
Guillaume Gomez
3837c1ce33 Update rustdoc test 2021-05-10 00:09:57 +02:00
Guillaume Gomez
4edcf61479 End toggle migration 2021-05-10 00:09:57 +02:00
bors
c55c26cb36 Auto merge of #83800 - xobs:impl-16351-nightly, r=nagisa
Add default search path to `Target::search()`

The function `Target::search()` accepts a target triple and returns a `Target` struct defining the requested target.

There is a `// FIXME 16351: add a sane default search path?` comment that indicates it is desirable to include some sort of default. This was raised in https://github.com/rust-lang/rust/issues/16351 which was closed without any resolution.

https://github.com/rust-lang/rust/pull/31117 was proposed, however that has platform-specific logic that is unsuitable for systems without `/etc/`.

This patch implements the suggestion raised in https://github.com/rust-lang/rust/issues/16351#issuecomment-180878193 where a `target.json` file may be placed in `$(rustc --print sysroot)/lib/rustlib/<target-triple>/target.json`. This allows shipping a toolchain distribution as a single file that gets extracted to the sysroot.
2021-05-09 22:01:26 +00:00
ltdk
e6b12c8e4f Fix Step feature flag, make tidy lint more useful to find things like this 2021-05-09 17:15:54 -04:00
Fabian Wolff
3c0c3874fc Implement @jackh726's suggestions 2021-05-09 22:35:18 +02:00
ltdk
380bbe8d47 Make unchecked_{add,sub,mul} inherent methods unstably const 2021-05-09 16:29:40 -04:00
bors
ca82264ec7 Auto merge of #85065 - Mark-Simulacrum:preds-no-alloc, r=jackh726
Avoid predecessors having Drop impls

Should be a simple win - but let's make sure with perf.
2021-05-09 19:01:05 +00:00
Joshua Nelson
506031fc78 Remove outdated FIXME for download-rustc 2021-05-09 12:24:59 -04:00
bors
7a2f446889 Auto merge of #83894 - nikic:newpm, r=nagisa
Improve support for NewPM

This adds various missing bits of support for NewPM and allows us to successfully run stage 2 tests with NewPM enabled.

This does not yet enable NewPM by default, as there are still known issue on LLVM 12 (such as a weak fat LTO pipeline). The plan is to make the switch after we update to LLVM 13.
2021-05-09 16:19:21 +00:00
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