Commit graph

168103 commits

Author SHA1 Message Date
Guillaume Gomez 44e5b3bf3e Update GUI tests 2022-05-14 17:21:52 +02:00
Guillaume Gomez e8762757c3 Remove theme picker button 2022-05-14 17:21:52 +02:00
Guillaume Gomez 5e01ba36c9 Improve settings menu display 2022-05-14 17:21:52 +02:00
bors 17180f4a56 Auto merge of #94872 - mati865:mingw-llvm-target, r=petrochenkov
Add MVP LLVM based mingw-w64 targets

Fixes https://github.com/rust-lang/rust/issues/72241

Those are `rustc` side changes to create working x86_64 and AArch64 Rustc hosts and targets.
Apart from this PR changes to various crates are required which I'll do once this is accepted.

I'm expecting more changes on `rustc` side later on as I cannot even run full testsuite at this moment because passing JSON spec breaks paths in various tests.

Tier 3 policy:

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I pledge to do my best maintaining it, MSYS2 is one of interested consumers so it should have enough testing (after the releases).

 > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

This triple name was discussed at [`t-compiler/LLVM+mingw-w64 Windows targets`](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/LLVM.2Bmingw-w64.20Windows.20targets)

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

I think the explanation in platform support doc is enough to make this aspect clear.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

It's using open source tools only.

> The target must not introduce license incompatibilities.

It's even more liberal than already existing `*-pc-windows-gnu`.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Understood.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

There are no new dependencies/features required.

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

As previously said it's using open source tools only.

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

There are no such terms present/

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

I'm not the reviewer here.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Again I'm not the reviewer here.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Building is described in platform support doc, running tests doesn't work right now (without hacks) because Rust's build system doesn't seem to support testing targets built from `.json`.
Docs will be updated once this lands in beta allowing master branch to build and run tests without `.json` files.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Understood.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Understood.

 > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

I believe I didn't break any other target.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

I think there are no such problems in this PR.
2022-05-14 08:20:11 +00:00
bors c31879922e Auto merge of #97035 - JohnTitor:rollup-00ko07z, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #95365 (Use default alloc_error_handler for hermit)
 - #96986 ([save-analysis] Reference the variant not enum at struct-literal cons…)
 - #96998 (rustdoc: remove weird, unused variable from source-files.js)
 - #97005 (Two small improvements of rustc_expand)
 - #97018 (Ensure that test fail if a JS error occurs)
 - #97031 (Drop tracking: handle invalid assignments better)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-14 05:53:39 +00:00
Yuki Okushi e239fd2b88
Rollup merge of #97031 - eholk:drop-tracking-type-error, r=compiler-errors
Drop tracking: handle invalid assignments better

Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
2022-05-14 13:42:55 +09:00
Yuki Okushi ec14d946ae
Rollup merge of #97018 - GuillaumeGomez:fail-on-js-error, r=notriddle
Ensure that test fail if a JS error occurs

Fixes #96902.

r? ``@notriddle``
2022-05-14 13:42:54 +09:00
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 9fbbe75fd7 Auto merge of #95602 - scottmcm:faster-array-intoiter-fold, r=the8472
Fix `array::IntoIter::fold` to use the optimized `Range::fold`

It was using `Iterator::by_ref` in the implementation, which ended up pessimizing it enough that, for example, it didn't vectorize when we tried it in the <https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/Reducing.20sum.20into.20wider.20types> conversation.

Demonstration that the codegen test doesn't pass on the current nightly: <https://rust.godbolt.org/z/Taxev5eMn>
2022-05-14 03:12:53 +00:00
Eric Holk 6665a4328b Fix nit 2022-05-13 19:32:53 -07:00
Eric Holk 5c98737715 Drop tracking: handle invalid assignments better
Previously this test case was crashing with an index out of bounds error
deep in the call to `needs_drop`. We avoid this by detecting clearly
invalid assignees in the `mutate` callback and ignoring these.
2022-05-13 16:25:22 -07: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
Mateusz Mikuła 60361f2ca3 Add LLVM based mingw-w64 targets 2022-05-13 20:14:15 +02:00
Guillaume Gomez 5ec5a762e9 Emit an error if there is a JS failure on rustdoc pages 2022-05-13 17:05:17 +02:00
Guillaume Gomez a50ad35dda Update browser-ui-test version 2022-05-13 17:03:33 +02: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
Scott McMurray e8fc7ba6a7 Slap #[inline] on all the ByRefSized methods, per the8472's suggestion 2022-05-13 00:43:15 -07: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