Commit Graph

168088 Commits

Author SHA1 Message Date
Yuki Okushi
e6fc0c4b43
Rollup merge of #97005 - est31:master, r=petrochenkov
Two small improvements of rustc_expand

I found them while doing #96150

r? ``@petrochenkov``
2022-05-14 13:42:53 +09:00
Yuki Okushi
93a4dfd737
Rollup merge of #96998 - notriddle:notriddle/var-N, r=jsha
rustdoc: remove weird, unused variable from source-files.js
2022-05-14 13:42:52 +09:00
Yuki Okushi
c031413f28
Rollup merge of #96986 - kdashg:save-an-enum-vars, r=oli-obk
[save-analysis] Reference the variant not enum at struct-literal cons…

…truction.

Closes #96985
2022-05-14 13:42:50 +09:00
Yuki Okushi
6c6958b531
Rollup merge of #95365 - mkroening:hermit-alloc-error-handler, r=joshtriplett
Use default alloc_error_handler for hermit

Hermit now properly separates kernel from userspace.
Applications for hermit can now use Rust's default `alloc_error_handler` instead of calling the kernel's `__rg_oom`.

CC: ``@stlankes``
2022-05-14 13:42:49 +09:00
bors
f1f721e640 Auto merge of #97013 - matthiaskrgr:rollup-c1pc6pc, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #96154 (Expand core::hint::unreachable_unchecked() docs)
 - #96615 (Add a regression test for #54779)
 - #96982 (fix clippy expect_fun_call)
 - #97003 (Remove some unnecessary `rustc_allow_const_fn_unstable` attributes.)
 - #97011 (Add regression test for #28935)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-13 20:26:04 +00:00
bors
9ad4bde042 Auto merge of #95356 - coolreader18:exitstatus-exit-method, r=<try>
ExitCode::exit_process() method

cc `@yaahc` / #93840

(eeek, hit ctrl-enter before I meant to and right after realizing the branch name was wrong. oh, well)

I feel like it makes sense to have the `exit(ExitCode)` function as a method or at least associated function on ExitCode, but maybe that would hurt discoverability? Probably not as much if it's at the top of the `process::exit()` documentation or something, but idk. Also very unsure about the name, I'd like something that communicates that you are exiting with *this* ExitCode, but with a method name being postfix it doesn't seem to flow. `code.exit_process_with()` ? `.exit_process_with_self()` ? Blech. Maybe it doesn't matter, since ideally just `code.exit()` or something would be clear simply by the name and single parameter but 🤷

Also I'd like to touch up the `ExitCode` docs (which I did a bit here), but that would probably be good in a separate PR, right? Since I think the beta deadline is coming up.
2022-05-13 18:29:13 +00:00
Noa
a9e29d204e
Guarantee less in docs 2022-05-13 13:28:24 -05:00
Noa
688dcc68fe
Add ExitCode::exit_process example 2022-05-13 13:28:22 -05:00
Matthias Krüger
cc357bd000
Rollup merge of #97011 - JohnTitor:issue-28935, r=compiler-errors
Add regression test for #28935

Closes #28935, one of the ancient issues can be closed :)
r? `@compiler-errors`
2022-05-13 16:03:26 +02:00
Matthias Krüger
a56211a44e
Rollup merge of #97003 - nnethercote:rm-const_fn-attrs, r=fee1-dead
Remove some unnecessary `rustc_allow_const_fn_unstable` attributes.

r? `@fee1-dead`
2022-05-13 16:03:25 +02:00
Matthias Krüger
384caefbb6
Rollup merge of #96982 - klensy:no-expect, r=Dylan-DPC
fix clippy expect_fun_call
2022-05-13 16:03:24 +02:00
Matthias Krüger
281be096c1
Rollup merge of #96615 - JohnTitor:test-54779, r=compiler-errors
Add a regression test for #54779

Closes #54779
r? `@jackh726`
2022-05-13 16:03:23 +02:00
Matthias Krüger
feb18d102a
Rollup merge of #96154 - lukaslueg:unreachablehint, r=scottmcm
Expand core::hint::unreachable_unchecked() docs

Rework the docs for `unreachable_unchecked`, encouraging deliberate use, and providing a better example for action at a distance.

Fixes #95865
2022-05-13 16:03:22 +02:00
Yuki Okushi
9ff4d34923
Add regression test for #28935 2022-05-13 22:04:47 +09:00
bors
a7d6408b05 Auto merge of #96899 - oli-obk:closure_wf_check_bounds, r=nikomatsakis
Check that closures satisfy their where bounds

fixes https://github.com/rust-lang/rust/issues/53092
fixes https://github.com/rust-lang/rust/issues/90409

based on https://github.com/rust-lang/rust/pull/96736
2022-05-13 11:18:01 +00:00
Oli Scherer
7a4ac84a90 For non-defining opaque type usage errors, don't try to also prove all trait bounds 2022-05-13 10:09:11 +00:00
Oli Scherer
253408b409 Check that closures satisfy their where bounds 2022-05-13 10:09:11 +00:00
bors
1c80ac003b Auto merge of #96930 - ayrtonm:mips32-tmp-file, r=petrochenkov
Fix e_flags for 32-bit MIPS targets in generated object file

In #95604 the compiler started generating a temporary symbols.o which is added to the linker invocation. This object file has an `e_flags` which is invalid for 32-bit MIPS targets. Even though symbols.o doesn't contain code, linking these targets with [lld fails](https://github.com/llvm/llvm-project/blob/main/lld/ELF/Arch/MipsArchTree.cpp#L76-L79) with
```
rust-lld: error: foo-cgu.0.rcgu.o: ABI 'o32' is incompatible with target ABI 'n64'
```
because it omits the ABI bits (`EF_MIPS_ABI_O32`) so lld assumes it's using the N64 ABI. This breaks linking on nightly for the out-of-tree [mipsel-sony-psx target](https://github.com/ayrtonm/psx-sdk-rs/issues/9), the builtin mipsel-sony-psp target (cc `@overdrivenpotato)` and probably any other 32-bit MIPS target using lld.

This PR sets the ABI in `e_flags` to O32 since that's the only ABI for 32-bit MIPS that LLVM supports. It also sets other `e_flags` bits based on the target to avoid similar issues with the object file arch and PIC. I had to bump the object crate version since some of these constants were [added recently](https://github.com/gimli-rs/object/pull/433). I'm not sure if this PR needs a test, but I can confirm that it fixes the linking issue on both targets I mentioned.
2022-05-13 08:48:31 +00:00
est31
e6ccf9b5d8 Use pluralize in one instance 2022-05-13 08:48:35 +02:00
est31
cc3c5d2700 Improve name and documentation of generic_extension
This function doesn't *create* a (rules based) macro, it *expands* it.
Thus, the documentation was wrong.
2022-05-13 08:42:39 +02:00
bors
97d48bec2d Auto merge of #96965 - oli-obk:flaky_inliner_ice, r=cjgillot
Gracefully handle normalization failures in the prospective inliner cycle detector

Preliminary work for adding the regression test in #96950 to our test suite (it was flaky on glacier).

If this PR solves the flakiness on glacier, we can then merge #96950
2022-05-13 06:20:56 +00:00
Nicholas Nethercote
fd01fbc058 Remove some unnecessary rustc_allow_const_fn_unstable attributes. 2022-05-13 16:01:18 +10:00
bors
f001f9301c Auto merge of #97000 - matthiaskrgr:rollup-qh3lhu8, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #96932 (Clarify what values `BorrowedHandle`, `OwnedHandle` etc. can hold.)
 - #96948 (Add test of matches macro for trailing commas)
 - #96988 (Fix platform support links.)
 - #96989 (Be more precise than DefPathData::Misc.)
 - #96993 (rustdoc: fix GUI crash when searching for magic JS property values)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-13 03:40:37 +00:00
Matthias Krüger
5a111dff3b
Rollup merge of #96993 - notriddle:notriddle/prototype, r=GuillaumeGomez
rustdoc: fix GUI crash when searching for magic JS property values
2022-05-13 05:33:14 +02:00
Matthias Krüger
f2100daf32
Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwco
Be more precise than DefPathData::Misc.

This variant was used for two unrelated things. Let's make this cleaner.
2022-05-13 05:33:13 +02:00
Matthias Krüger
ececa7f79c
Rollup merge of #96988 - ehuss:fix-platform-links, r=JohnTitor
Fix platform support links.

Hermitkernel was removed in #95299.  nvptx was added in #95896 without being added to the SUMMARY.
2022-05-13 05:33:12 +02:00
Matthias Krüger
7debc95bab
Rollup merge of #96948 - ludfo774:macro-trailing-comma-test, r=joshtriplett
Add test of matches macro for trailing commas

Almost all macros are tested for trailing commas.
The macro matches! was however not tested.
This PR adds that test case.
Related to #46238
2022-05-13 05:33:11 +02:00
Matthias Krüger
f38b7ff3b6
Rollup merge of #96932 - sunfishcode:sunfishcode/document-borrowed-handle, r=joshtriplett
Clarify what values `BorrowedHandle`, `OwnedHandle` etc. can hold.

Reword the documentation to clarify that when `BorrowedHandle`, `OwnedHandle`, or `HandleOrNull` hold the value `-1`, it always means the current process handle, and not `INVALID_HANDLE_VALUE`.

`-1` should only mean `INVALID_HANDLE_VALUE` after a call to a function documented to return that to report errors, which should lead I/O functions to produce errors rather than succeeding and producing `OwnedHandle` or `BorrowedHandle` values. So if a consumer of an `OwnedHandle` or `BorrowedHandle` ever sees them holding a `-1`, it should always mean the current process handle.
2022-05-13 05:33:10 +02:00
bors
925e774edc Auto merge of #96493 - chbaker0:issue-96342-fix, r=Mark-Simulacrum
Add compiletest and bootstrap "--skip" option forwarded to libtest

With this PR,  "x.py test --skip SKIP ..." will run the specified test suite, but forward "--skip SKIP" to the test tool. libtest already supports this option. The PR also adds it to compiletest which itself just forwards it to libtest.

Adds the functionality requested in https://github.com/rust-lang/rust/issues/96342. This is useful to work around tests broken upstream.

https://github.com/rust-lang/rust/issues/96362#issuecomment-1108609893 is the specific test issue my project is trying to work around.
2022-05-13 01:25:28 +00:00
Michael Howell
1b41d11d74 rustdoc: remove weird, unused variable from source-files.js 2022-05-12 17:34:46 -07:00
Kelsey Gilbert
5fde765df0 [save-analysis] Reference the variant not enum at struct-literal construction.
Closes #96985
2022-05-12 16:34:02 -07:00
bors
ebb80ec4e9 Auto merge of #96966 - nikic:llvm-update-2, r=cuviper
Update LLVM submodule

Merge upstream release/14.x branch.

Fixes #96672.
2022-05-12 22:29:50 +00:00
Michael Howell
d3fd6bfd30 rustdoc: fix GUI crash when searching for magic JS property values 2022-05-12 14:15:31 -07:00
bors
a5ad0d29a4 Auto merge of #96984 - ehuss:update-cargo, r=ehuss
Update cargo

20 commits in a44758ac805600edbb6ba51e7e6fb81a6077c0cd..3f052d8eed98c6a24f8b332fb2e6e6249d12d8c1
2022-05-04 02:29:34 +0000 to 2022-05-12 15:19:04 +0000
- pre-stabilization documentation for workspace inheritance (rust-lang/cargo#10659)
- test: Make curr_dir work in/out of workspace (rust-lang/cargo#10658)
- Fix no_cross_doctests race condition. (rust-lang/cargo#10660)
- Fix typo (rust-lang/cargo#10657)
- feat(install): Support `foo@version` like cargo-add (rust-lang/cargo#10650)
- fix typos found by the `typos-cli` crate (rust-lang/cargo#10649)
- feat(yank): Support foo@version like cargo-add (rust-lang/cargo#10597)
- add `cargo-features` to unstable docs for workspace inheritance (rust-lang/cargo#10648)
- Use the traits added to the Rust 2021 Edition prelude (rust-lang/cargo#10646)
- Pass `--target` to `rustdoc` for `cargo test` if specified with host target. (rust-lang/cargo#10594)
- Fix use of .. in dep-info-basedir (rust-lang/cargo#10281)
- fix some typos (rust-lang/cargo#10639)
- Move snapshot tests into testsuite (rust-lang/cargo#10638)
- Improve support of condition compilation checking (rust-lang/cargo#10566)
- When documenting private items in a binary, ignore warnings about links to private items (rust-lang/cargo#10142)
- Extend pkgid syntax with ``@`` support (rust-lang/cargo#10582)
- move one `snapshot/add` test into `testsuite/cargo_add/` (rust-lang/cargo#10631)
- Add caveat for covering features (rust-lang/cargo#10605)
- Improve CARGO_ENCODED_RUSTFLAGS and CARGO_ENCODED_RUSTDOCFLAGS variables docs (rust-lang/cargo#10633)
- reorganize `snapshot` tests to better work in contexts that sort by extension (rust-lang/cargo#10629)
2022-05-12 19:49:13 +00:00
Camille GILLOT
b7f0509588 Bless mir-opt tests. 2022-05-12 21:37:57 +02:00
Camille GILLOT
2b2dc5c035 Bless tests. 2022-05-12 20:29:11 +02:00
Camille GILLOT
ecbda428ec Correct comment. 2022-05-12 20:16:11 +02:00
Camille GILLOT
dde7bff574 Replace DefPathData::Misc by two appropriately-named variants. 2022-05-12 20:12:35 +02:00
Eric Huss
d692805a65 Fix platform support links. 2022-05-12 11:07:32 -07:00
Eric Huss
e353579b8b Update cargo 2022-05-12 10:12:50 -07:00
klensy
7f318256c9 fix clippy expect_fun_call 2022-05-12 19:26:52 +03:00
bors
c6499fd998 Auto merge of #96974 - matthiaskrgr:rollup-jd4otnc, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #95896 (Note the contacts for the nvptx64 target(s))
 - #96860 (openbsd: convert futex timeout managment to Timespec usage)
 - #96939 (Fix settings page CSS)
 - #96941 (update graphviz links)
 - #96968 (Add tests for #96806)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-12 15:07:35 +00:00
Matthias Krüger
5656ea22ad
Rollup merge of #96968 - cjgillot:codegen-fulfill-nice, r=oli-obk
Add tests for #96806

I messed up the rebase in https://github.com/rust-lang/rust/pull/96806.

I took the opportunity to add an extra mir-opt test from https://github.com/rust-lang/rust/pull/91743.

r? `@oli-obk`
2022-05-12 16:41:06 +02:00
Matthias Krüger
47e4c9efdc
Rollup merge of #96941 - nannany:master, r=lcnr,JohnTitor
update graphviz links

Update graphviz links.
2022-05-12 16:41:05 +02:00
Matthias Krüger
231cd0fd7d
Rollup merge of #96939 - GuillaumeGomez:settings-css, r=notriddle
Fix settings page CSS

In https://github.com/rust-lang/rust/pull/96741, I moved the CSS loading outside of `settings.js`. The result was that on the settings page, there isn't the settings CSS anymore:

![Screenshot from 2022-05-11 11-09-24](https://user-images.githubusercontent.com/3050060/167817969-6750931b-3e6e-4178-b5a9-ee3851e983be.png)

I also used this opportunity to remove unused CSS rules (we don't have `<select>` elements anymore in the settings).

cc `@jsha`
r? `@notriddle`
2022-05-12 16:41:04 +02:00
Matthias Krüger
80e1dec10e
Rollup merge of #96860 - semarie:openbsd-futex-time64, r=cuviper
openbsd: convert futex timeout managment to Timespec usage

unbreak openbsd build after #96657

r? cuviper

please note I made `Timespec::zero()` public to be able to use it. OpenBSD is using relative timeout for `futex(2)` and I don't find simple way to use `Timespec` this way.
2022-05-12 16:41:03 +02:00
Matthias Krüger
43dabbf485
Rollup merge of #95896 - nagisa:nvptx-contacts, r=Mark-Simulacrum
Note the contacts for the nvptx64 target(s)

cc `@RDambrosio016` `@kjetilkjeka`
2022-05-12 16:41:01 +02:00
bors
481db40311 Auto merge of #95562 - lcnr:attr-no-encode, r=davidtwco
don't encode only locally used attrs

Part of https://github.com/rust-lang/compiler-team/issues/505.

We now filter builtin attributes before encoding them in the crate metadata in case they should only be used in the local crate. To prevent accidental misuse `get_attrs` now requires the caller to state which attribute they are interested in. For places where that isn't trivially possible, I've added a method `fn get_attrs_unchecked` which I intend to remove in a followup PR.

After this pull request landed, we can then slowly move all attributes to only be used in the local crate while being certain that we don't accidentally try to access them from extern crates.

cc https://github.com/rust-lang/rust/pull/94963#issuecomment-1082924289
2022-05-12 12:48:30 +00:00
Camille GILLOT
bd41874eea Add mir-opt test. 2022-05-12 12:46:28 +02:00
bors
18bd2dd5cd Auto merge of #96853 - davidtwco:diagnostic-translation-unit-and-more-porting, r=oli-obk
diagnostics: port more diagnostics to derive + support for `()` fields

- Extend diagnostic derive so that spanless subdiagnostics (e.g. some uses of `help`/`note`) can be applied via attributes to fields of type `()` (currently spanless subdiagnostics are applied via attributes on the diagnostic struct itself). A consequence of this is that `Option<()>` fields can be used to represent optional spanless subdiagnostics, which are sometimes useful (e.g. for a `help` that should only show on nightly builds).
- Simplify the "explicit generic args with impl trait" diagnostic struct (from #96760) using support for `Option<()>` spanless subdiagnostics.
- Change `DiagnosticBuilder::set_arg`, used to provide context for Fluent messages, so that it takes anything that implements `IntoDiagnosticArg`, rather than `DiagnosticArgValue` - this improves the ergonomics of manual implementations of `SessionDiagnostic` which are translatable.
- Port "the type parameter `T` must be explicitly specified", "manual implementations of `X` are experimental", "could not resolve substs on overridden impl" diagnostics to diagnostic structs.
- When testing macros from `rustc_macros` in `ui-fulldeps` tests, sometimes paths from the compiler source tree can be shown in error messages - these need to be normalized in `compiletest`.

r? `@oli-obk`
cc `@pvdrz`
2022-05-12 10:22:07 +00:00