David Koloski [Wed, 4 Jan 2023 20:55:48 +0000 (15:55 -0500)]
Update Fuchsia walkthrough with new configs
The new `download-ci-llvm` configuration option dosn't work with `lld =
true` (see #100853). The Fuchsia walkthrough should recommend setting it
to `false`.
Michael Howell [Wed, 4 Jan 2023 20:04:30 +0000 (13:04 -0700)]
rustdoc: remove unnecessary wrapper around sidebar and mobile logos
This commit changes `.sidebar a:hover:not(.logo-container)` to add the `:not()` pseudo-class, retaining the old appearance of the logo when mousing over it.
This didn't used to be necessary because the `a.sidebar-logo` was `display:inline`, and was what got the `background` changed on hover, while the `div.logo-container` inside it was `display:block`. This resulted in the hover rule not having any effect, because the logo-container box was not actually nested inside the sidebar-logo box:
> When an inline box contains an in-flow block-level box, the inline box (and its inline ancestors within the same line box) are broken around the block-level box (and any block-level siblings that are consecutive or separated only by collapsible whitespace and/or out-of-flow elements), splitting the inline box into two boxes (even if either side is empty), one on each side of the block-level box(es). The line boxes before the break and after the break are enclosed in anonymous block boxes, and the block-level box becomes a sibling of those anonymous boxes. When such an inline box is affected by relative positioning, any resulting translation also affects the block-level box contained in the inline box.
bors [Wed, 4 Jan 2023 18:43:32 +0000 (18:43 +0000)]
Auto merge of #106330 - weihanglo:update-cargo, r=weihanglo
Update cargo
8 commits in 2381cbdb4e9b07090f552d34a44a529b6e620e44..8c460b2237a6359a7e3335890db8da049bdd62fc
2022-12-23 12:19:27 +0000 to 2023-01-04 14:30:01 +0000
- test: revive nightly plugin tests to work (rust-lang/cargo#11534)
- Add note to release notes about rejecting multiple registries. (rust-lang/cargo#11531)
- Fix a typo `fresheness` -> `freshness` (rust-lang/cargo#11529)
- Reasons for rebuilding (rust-lang/cargo#11407)
- Asymmetric tokens (rust-lang/cargo#10771)
- Use proper git URL for GitHub repos (rust-lang/cargo#11517)
- Add `registry.default` example (rust-lang/cargo#11516)
- Support vendoring with different revs from same git repo (rust-lang/cargo#10690)
Also update license exceptions and permitted dependencies
for new cargo dependency "pasetors".
A new dependency `getrandom` is added into `rustc-workspace-hacks`,
since it requires feature `js`.
Weihang Lo [Wed, 4 Jan 2023 15:33:59 +0000 (15:33 +0000)]
Update cargo
8 commits in 2381cbdb4e9b07090f552d34a44a529b6e620e44..8c460b2237a6359a7e3335890db8da049bdd62fc
2022-12-23 12:19:27 +0000 to 2023-01-04 14:30:01 +0000
- test: revive nightly plugin tests to work (rust-lang/cargo#11534)
- Add note to release notes about rejecting multiple registries. (rust-lang/cargo#11531)
- Fix a typo `fresheness` -> `freshness` (rust-lang/cargo#11529)
- Reasons for rebuilding (rust-lang/cargo#11407)
- Asymmetric tokens (rust-lang/cargo#10771)
- Use proper git URL for GitHub repos (rust-lang/cargo#11517)
- Add `registry.default` example (rust-lang/cargo#11516)
- Support vendoring with different revs from same git repo (rust-lang/cargo#10690)
Also update license exceptions and permitted dependencies
for new cargo dependency "pasetors".
A new dependency `getrandom` is added into `rustc-workspace-hacks`,
since it requires feature `js`.
Giacomo Pasini [Sat, 31 Dec 2022 12:45:22 +0000 (13:45 +0100)]
Merge borrowck permission checks
Merge `check_access_permission` and
`check_if_reassignment_to_immutable_state`.
The goal of this commit is twofold:
First, we simplify the codebase by removing duplicate logic.
Second, we avoid duplicate reporting of illegal reassignment
errors by reusing the exiting de-duplicating logic of
access_place.
bors [Wed, 4 Jan 2023 09:41:43 +0000 (09:41 +0000)]
Auto merge of #106442 - matthiaskrgr:rollup-wivf7gh, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions)
- #106274 (Add JSON output to -Zdump-mono-stats)
- #106292 (Add codegen test for `Box::new(uninit)` of big arrays)
- #106327 (Add tidy check for dbg)
- #106361 (Note maximum integer literal for `IntLiteralTooLarge`)
- #106396 (Allow passing a specific date to `bump-stage0`)
- #106436 (Enable doctests for rustc_query_impl)
Matthias Krüger [Wed, 4 Jan 2023 06:28:56 +0000 (07:28 +0100)]
Rollup merge of #106396 - jyn514:bump-stage-date, r=pietroalbini
Allow passing a specific date to `bump-stage0`
This allows regenerating `src/stage0.json` on changes to the tool, without needing to hard-code the date in the source. It was useful for https://github.com/rust-lang/rust/pull/106394, which added clippy to the list of required components.
Use the `<T as Pointee>::Metadata` associated type to calculate the layout of a pointee's metadata, instead of hard-coding rules about certain types.
Maybe this approach is overkill -- we could instead hard-code this approach as a fallback, with the matching on `Slice`/`Dynamic`/etc. happening first
Fixes this issue here https://github.com/rust-lang/rust/pull/104338#issuecomment-1312595844 .. But is also useful with transmutes, for example, given the UI test I added below.
Michael Goulet [Wed, 4 Jan 2023 01:19:28 +0000 (17:19 -0800)]
Rollup merge of #106411 - notriddle:notriddle/font-feature-settings, r=GuillaumeGomez
rustdoc: remove legacy font-feature-settings CSS
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985].
* The last version of Chrome that required a vendor prefix was version 47. The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1. The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.
Michael Goulet [Wed, 4 Jan 2023 01:19:26 +0000 (17:19 -0800)]
Rollup merge of #106045 - RalfJung:oom-nounwind-panic, r=Amanieu
default OOM handler: use non-unwinding panic, to match std handler
The OOM handler in std will by default abort. This adjusts the default in liballoc to do the same, using the `can_unwind` flag on the panic info to indicate a non-unwinding panic.
In practice this probably makes little difference since the liballoc default will only come into play in no-std situations where people write a custom panic handler, which most likely will not implement unwinding. But still, this seems more consistent.
Cc `@rust-lang/wg-allocators,` https://github.com/rust-lang/rust/issues/66741
Michael Goulet [Wed, 4 Jan 2023 01:19:25 +0000 (17:19 -0800)]
Rollup merge of #104748 - lqd:download_lld, r=jyn514
Ensure `lld` is supported with `download-ci-llvm`
This PR:
- ensures LLD's step in bootstrap's dist, but it's not strictly necessary since dist will already package it when it's present.
- makes bootstrap's `native::LLD` step support using the packaged `ci-llvm/bin/lld`, instead of building it from source (which would most likely not be available today, nor in the future where `download-ci-llvm = if-available` is the default).
If I understand correctly, `--enable-full-tools` will also enable `rust.lld`, and this is why LLD is already packaged today in the `rust-dev` component on the main targets (and why `-Zgcc-ld=lld` does work there).
That means it's likely that this PR will not be able to land before I've reworked and landed #101792: if LLD is available in `download-ci-llvm`, the `needs-rust-lld` tests should start being executed on the x64 macOS test builders, and CI would fail today.
I've tested locally that building with `download-ci-llvm = true` and `lld = true` with the LLVM submodule unregistered was successful, and that `rust-lld` and the various `lld-wrapper`s are present and `-Zgcc-ld=lld` works as well, on a few different platforms:
- `x86_64-unknown-linux-gnu`
- `aarch64-apple-darwin`
- `x86_64-pc-windows-msvc` (with `-Clinker=rust-lld` rather than `-Zgcc-ld=lld`)
- `x86_64-apple-darwin`, with the `MACOSX_DEPLOYMENT_TARGET` workaround for #101653
I don't think we really need to bump the `download-ci-llvm-stamp` in this case, since `./build/$triple/ci-llvm/bin/lld` is present on all the above targets already, but have added it mechanically, and it should probably be removed to avoid unnecessary downloads/churn.
bors [Tue, 3 Jan 2023 20:44:40 +0000 (20:44 +0000)]
Auto merge of #105752 - chenyukang:yukang/refactor-method-error, r=compiler-errors
Refactoring report_method_error
While working on #105732, I found it's hard to follow this long function,
so I tried to make it shorter.
It's not easy for code reviewing, since so many lines of code changes,
but only the positions are changed.
Generally, I extract two sub-methods from `report_method_error`:
https://github.com/rust-lang/rust/blob/397b66e77b279de5006facf87979f9ecff5c7f87/compiler/rustc_hir_typeck/src/method/suggest.rs#L117
to `note_candidates_on_method_error`
Joshua Nelson [Tue, 3 Jan 2023 04:13:19 +0000 (04:13 +0000)]
Fix a few clippy lints in libtest
- Remove unnecessary references and dereferences
- Use `.contains` instead of `a <= x && x <= b`
- Use `mem::take` instead of `mem::replace` where possible
Michael Howell [Tue, 3 Jan 2023 17:23:55 +0000 (10:23 -0700)]
rustdoc: remove legacy font-feature-settings CSS
According to [caniuse], these vendor prefixes aren't needed in any supported
web browsers as defined in [RFC 1985].
* The last version of Chrome that required a vendor prefix was version 47.
The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The
[current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1.
The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version
9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.
bors [Tue, 3 Jan 2023 17:08:17 +0000 (17:08 +0000)]
Auto merge of #106409 - matthiaskrgr:rollup-b58z1hz, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #104552 (warn newer available version of the x tool)
- #105681 (some fixes/improvements to mir::visit module)
- #106005 (Test the borrowck behavior of if-let guards)
- #106356 (clean: Remove `ctor_kind` from `VariantStruct`.)
- #106365 (Grammar : Missing "is" in format specifier diagnostic)
- #106388 (rustdoc: remove legacy box-sizing CSS)
- #106392 (`has_overflow` only if value is *not* within limit)
- #106402 (Fix dupe word typos)
Matthias Krüger [Tue, 3 Jan 2023 16:12:12 +0000 (17:12 +0100)]
Rollup merge of #106388 - notriddle:notriddle/box-sizing, r=camelid
rustdoc: remove legacy box-sizing CSS
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]
* The last version of Chrome that required a vendor prefix was version 9. The current version is 108.
* Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 5. The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.
Matthias Krüger [Tue, 3 Jan 2023 16:12:11 +0000 (17:12 +0100)]
Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, r=Nilstrieb
Test the borrowck behavior of if-let guards
Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`.
This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419.
cc `@pnkfelix` are there any other tests that you would want to see?
cc tracking issue #51114
Matthias Krüger [Tue, 3 Jan 2023 16:12:10 +0000 (17:12 +0100)]
Rollup merge of #104552 - DebugSteven:warn-newer-x, r=jyn514
warn newer available version of the x tool
This PR adds a check to `tidy` to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It adds a `--wrapper-version` argument to `x` to determine the version at runtime, .
It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
jsondoclint: Find selector for missing ID when error is created, not reported.
This is needed for json output, but even without that, it increases
performance massivly. On my machine, in reduces the time to check
core.json from 40.190s to 11.333s.
Without verbose:
0:61941:36627 not in index or paths, but refered to at '$.index["0:62007"].inner.for.inner.id' and 12 more
With verbose:
0:10808:27206 not in index or paths, but refered to at '$.index["0:10813"].inner.for.inner.id', '$.index["0:52495"].inner.for.inner.id', '$.index["a:0:2666:215-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2680:223-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2730:7845-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7731:21706-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7732:21705-0:10808:27206"].inner.for.inner.id'
bors [Tue, 3 Jan 2023 14:05:44 +0000 (14:05 +0000)]
Auto merge of #101792 - lqd:rust-lld, r=petrochenkov
Only specify `--target` by default for `-Zgcc-ld=lld` on wasm
On macOS, it's not yet clear which cases of clang/OS/target/SDK version impact how to find ld/lld/rust-lld. The `--target` argument is not needed on our current targets with a vanilla config to do so, but may be in some cases ?
That is, things look to be different and more subtle than suggested in https://github.com/rust-lang/rust/issues/97402#issuecomment-1147404520.
Specifying this argument unconditionally currently breaks `-Zgcc-ld=lld` on the 10.7+ targets on x64 macOS. Vanilla configs on x64 and aarch64 don't seem to need it to be able to find `rust-lld`.
This fixes #101653 on macOS (I've tried on x64 and aarch64: vanilla installs with the most recent command line tools available for each of the OS versions I have access to, `run-make/issue-71519` passes).
I didn't expect the previous PRs to fail because of the existing tests, but CI does not actually run those tests yet, which explains the regressions. I was hoping to fix those in this PR but it's more involved (building lld is required for the tests to run, llvm/lld is not built on the test builders but on the dist builders, the dist builders don't run tests). This PR is just to unblock current users on macOS who have reported issues, but a regression could happen in the future by mistake until then.
bors [Tue, 3 Jan 2023 11:06:08 +0000 (11:06 +0000)]
Auto merge of #95644 - WaffleLapkin:str_split_as_str_refactor_take2, r=Amanieu
`Split*::as_str` refactor
I've made this patch almost a year ago, so the rename and the behavior change are in one commit, sorry 😅
This fixes #84974, as it's required to make other changes work.
This PR
- Renames `as_str` method of string `Split*` iterators to `remainder` (it seems like the `as_str` name was confusing to users)
- Makes `remainder` return `Option<&str>`, to distinguish between "the iterator is exhausted" and "the tail is empty", this was [required on the tracking issue](https://github.com/rust-lang/rust/issues/77998#issuecomment-832696619)
bors [Tue, 3 Jan 2023 04:54:03 +0000 (04:54 +0000)]
Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikic
do not add noalias in return position
`noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute.
Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/385 (including an actual miscompilation that `@comex` managed to produce).
bors [Tue, 3 Jan 2023 01:45:33 +0000 (01:45 +0000)]
Auto merge of #106386 - compiler-errors:rollup-dxjv18b, r=compiler-errors
Rollup of 8 pull requests
Successful merges:
- #95985 (Add PhantomData marker to Context to make Context !Send and !Sync)
- #104298 (Add notes and examples about non-intuitive `PathBuf::set_extension` behavior)
- #105558 (Reduce HIR debug output)
- #106315 (Cleanup `mingw-tidy` docker job)
- #106354 (Rustdoc-Json: Report discriminant on all kinds of enum variant.)
- #106366 (Fix rustdoc ICE on bad typedef with mismatching types)
- #106376 (Update books)
- #106383 (Document some of the AST nodes)
Failed merges:
- #106356 (clean: Remove `ctor_kind` from `VariantStruct`.)
- Add help for when you update a submodule by accident (rust-lang/rustc-dev-guide#1537)
- Simplify "how to build and run" section (rust-lang/rustc-dev-guide#1528)
- Replace `$TARGET` with `host` (rust-lang/rustc-dev-guide#1514)
- Add more rebasing help (rust-lang/rustc-dev-guide#1536)
- Fix rustc_borrowck crate name typo (rust-lang/rustc-dev-guide#1535)
Michael Goulet [Mon, 2 Jan 2023 23:39:17 +0000 (15:39 -0800)]
Rollup merge of #106315 - jyn514:cleanup-mingw-tidy, r=fee1-dead
Cleanup `mingw-tidy` docker job
Fixes a couple small regressions from https://github.com/rust-lang/rust/pull/106048 and https://github.com/rust-lang/rust/pull/105714.
- Avoid `/checkout/src/ci/run.sh: line 187: [: =: unary operator expected`: https://github.com/rust-lang/rust/actions/runs/3809902408/jobs/6481611301#step:26:1701
- Avoid running `x check` in the tidy test, to get faster feedback. It's already run on the normal `mingw-check` job.
Michael Goulet [Mon, 2 Jan 2023 23:39:17 +0000 (15:39 -0800)]
Rollup merge of #105558 - Nilstrieb:less-spam-hir-tree, r=cjgillot
Reduce HIR debug output
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by.