Skip to content

Rustup #2738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 57 commits into from
Dec 24, 2022
Merged

Rustup #2738

merged 57 commits into from
Dec 24, 2022

Conversation

RalfJung
Copy link
Member

No description provided.

RalfJung and others added 30 commits December 12, 2022 11:10
Use non-ascribed type as field's type in mir

Fixes rust-lang/rust#96514

r? `@lcnr`
Implement DerefMut for PathBuf

Without this, there's no way to get a `&mut Path` from `PathBuf` without
going through `into_boxed_path`. This is relevant now that #105002 adds
`PathBuf::as_mut_os_string` and `Path::as_mut_os_str`.
Stabilize default_alloc_error_handler

Tracking issue: #66741

This turns `feature(default_alloc_error_handler)` on by default, which causes the compiler to automatically generate a default OOM handler which panics if `#[alloc_error_handler]` is not provided.

The FCP completed over 2 years ago but the stabilization was blocked due to an issue with unwinding. This was fixed by #88098 so stabilization can be unblocked.

Closes #66741
Check AArch64 branch-protection earlier in the pipeline.

As suggested in #93516.

r? `@nagisa`
…mulacrum

Add batch flag to remote-test-server

When using this flag, the stdout and stderr are sent in a single batch instead of being streamed. It also used `Command::output` instead of `Command::spawn`. This is useful for targets that might support std but not threading (Eg: UEFI).

Signed-off-by: Ayush Singh <[email protected]>
Update crossbeam

This fixes builds for Gentoo

This should fix rust-lang/rust#104866 (cc `@stefson)`
fs: Fix #50619 (again) and add a regression test

Bug #50619 was fixed by adding an end_of_stream flag in #50630.
Unfortunately, that fix only applied to the readdir_r() path.  When I
switched Linux to use readdir() in #92778, I inadvertently reintroduced
the bug on that platform.  Other platforms that had always used
readdir() were presumably never fixed.

This patch enables end_of_stream for all platforms, and adds a
Linux-specific regression test that should hopefully prevent the bug
from being reintroduced again.
Run `x test tidy` sooner in mingw-check

It takes less time to run than the other tests and is more likely to fail. `expand-yaml-anchors` is still run first to make sure the CI files are internally consistent.

Note that changing to `--stage 0` doesn't actually do anything since bootstrap tools are always built with the bootstrap compiler, this just makes it less confusing.

cc rust-lang/rust@83bab41
Add 0..=isize::MAX range metadata to size loads from vtables

This is the (much belated) size counterpart to #91569.

Inspired by https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Range.20metadata.20for.20.60size_of_val.60.20and.20other.20isize.3A.3AMAX.20limits. This could help optimize layout computations based on the size of a dyn trait. Though, admittedly, adding this to vtables wouldn't be as beneficial as adding it to slice len, which is used much more often.

Miri detects this UB already: https://github.com/rust-lang/rust/blob/b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573/compiler/rustc_const_eval/src/interpret/traits.rs#L119-L121
(In fact Miri goes further, [assuming a 48-bit address space on 64-bit platforms](https://github.com/rust-lang/rust/blob/9db224fc908059986c179fc6ec433944e9cfce50/compiler/rustc_abi/src/lib.rs#L312-L331), but I don't think we can assume that in an optimization.)
Use a more efficient `Once` on platforms without threads

The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.
Make `VecDeque::new` const

(See #105072)
Implement `From<bool>` for f32, f64

As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version.

`@rustbot` label +A-floating-point +C-feature-request +needs-fcp +relnotes +S-waiting-on-review +T-libs-api -T-libs
Rename `assert_uninit_valid` intrinsic

It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.

This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager.

r? `@RalfJung`
add assert messages if chunks/windows are length 0
interpret: add read_machine_[ui]size convenience methods

We have `read_pointer`, so it felt inconsistent to not also have these.

r? ```@oli-obk```
str.lines() docstring: clarify that line endings are not returned

Previously, the str.lines() docstring stated that lines are split at line endings, but not whether those were returned or not.  This new version of the docstring states this explicitly, avoiding the need of getting to doctests to get an answer to this FAQ.
Refer to "Waker" rather than "RawWaker" in `drop` comment

In my view this is technically more correct as `Waker` actually implements `Drop` (which calls the `drop` method) whereas `RawWaker` does not.
Fix typo in reading_half_a_pointer.rs

gurantee -> guarantee
Add regression test for #96530

Closes #96530
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <[email protected]>
Sort lint_groups in no_lint_suggestion

The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name.  That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name.

However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x.

To fix this, always sort the lint groups before using their names as input to find_best_match_for_name.  In doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order.

Fixes rust-lang/rust#105379
…examples-toggle, r=notriddle

Add comment explaining what the scrape-examples-toggle.goml GUI test is about

r? `@notriddle`
Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity

These expressions are just used for their spans, so make it best-effort here.

Fixes #105728
Rollup of 8 pull requests

Successful merges:

 - #105584 (add assert messages if chunks/windows are length 0)
 - #105602 (interpret: add read_machine_[ui]size convenience methods)
 - #105824 (str.lines() docstring: clarify that line endings are not returned)
 - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment)
 - #105986 (Fix typo in reading_half_a_pointer.rs)
 - #105995 (Add regression test for #96530)
 - #106008 (Sort lint_groups in no_lint_suggestion)
 - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
bors and others added 16 commits December 23, 2022 00:02
Support documenting cargo

The primary motivation is to have the cargo docs show up on https://doc.rust-lang.org/nightly/nightly-rustc/cargo, but as a nice side effect this makes `x doc cargo` work locally.

cc `@rust-lang/cargo`
Remove old version of `cfg-if` by bumping `packed_simd_2` and `getrandom v0.2` versions

```console
> cargo update --package packed_simd_2 --package [email protected]
    Updating crates.io index
    Removing cfg-if v0.1.10
    Updating getrandom v0.2.0 -> v0.2.8
    Updating packed_simd_2 v0.3.4 -> v0.3.8
```

`packed_simd_2` is only used as a dependency of `bytecount` which in turn is only used by `rustfmt`. I can't see any issue with the minor version bump.

The bigger jump is `[email protected]` which is used by a number of things, but 0.2.8 is still semver compatible and there doesn't seem to be any worrying changes (see the [changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)). The only breaking change are the removal of XP, stdweb and CloudAbi support but these are not host targets and rustc lacks support for them in any case (stdweb development was [abandonded](https://rustsec.org/advisories/RUSTSEC-2020-0056.html), XP is [tier 3 and `no_std`](https://doc.rust-lang.org/beta/rustc/platform-support.html#tier-3) and CloubAbi is [no longer supported](rust-lang/rust#78439)).

Note that this doesn't affect `[email protected]` which is what std depends on and which is already using the latest version of `cfg-if` (besides, there are already plans to remove that entirely).
…mulacrum

Take revision into account in non-incremental-mode `// incremental` tests

A UI test I added in #105983 confusingly [failed](rust-lang/rust#106031 (comment)) in a merge because two different revisions raced with each other for the same incremental directory for a (non-incremental-mode, i.e. `src/test/ui`) UI test.

Let's take the revision name into account when generating an incremental directory so that other UI tests that combine `// incremental` and `// revisions` won't race and cause possible flakiness in CI.
Use `DepKind` instead of `&'static str` in `QueryStackFrame`

`@rustbot` author

Fixes #105168
docs/test: add UI test and long-form error docs for E0462

Another UI test/ docs combo.

r? ``@GuillaumeGomez``
fix vec::IntoIter::drop on high-alignment ZST

This fixes a soundness bug: IntoIter would call `drop_in_place` on an insufficiently aligned pointer. So if a ZST with alignment greater 1 had drop glue, that would be called with an unaligned reference. Since rust-lang/rust#103957, Miri checks alignment even if the type does not have drop glue, which is how this bug was found.

r? ``@thomcc``
…r=notriddle

Use correct CSS pseudo-element selector

Pseudo-element should use "::" to not be confused with pseudo selectors (nice explanation here: https://css-tricks.com/to-double-colon-or-not-do-double-colon/).

r? ``@notriddle``
…, r=GuillaumeGomez

rustdoc: remove no-op CSS from `.docblock-short`

The rules `overflow:hidden` and `text-overflow:ellipses` only have an effect if overflow occurs, which cannot happen because it will just line wrap instead.

These rules definitely became obsolete by rust-lang/rust#77699, when the stylesheet was decidedly changed to have line wrapping in short docblocks, but given the bug it was fixing, this probably got broken earlier.
Rollup of 7 pull requests

Successful merges:

 - #105970 (docs/test: add UI test and long-form error docs for E0462)
 - #105975 (rustc: Remove needless lifetimes)
 - #106069 (rustdoc: use a more evocative name for CSS/JS `#titles`)
 - #106084 (fix vec::IntoIter::drop on high-alignment ZST)
 - #106091 (Use correct CSS pseudo-element selector)
 - #106093 (rustdoc: remove no-op CSS from `.docblock-short`)
 - #106102 (Fix `triagebot.toml`)

Failed merges:

 - #106028 (docs/test: add UI test and long-form error docs for `E0461`)

r? `@ghost`
`@rustbot` modify labels: rollup
…Simulacrum

Use u32 methods instead of manual shifting

Switch to `to_le_bytes()` and `from_le_bytes()` instead of manual shifting

This was suggested [`here`](rust-lang/rust#105145 (comment))

Signed-off-by: Ayush Singh <[email protected]>
@RalfJung
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Dec 24, 2022

📌 Commit 2b4c38f has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 24, 2022

⌛ Testing commit 2b4c38f with merge 9dd1fe2...

bors added a commit that referenced this pull request Dec 24, 2022
@bors
Copy link
Contributor

bors commented Dec 24, 2022

💔 Test failed - checks-actions

@RalfJung
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Dec 24, 2022

📌 Commit f93d956 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 24, 2022

⌛ Testing commit f93d956 with merge be82560...

@bors
Copy link
Contributor

bors commented Dec 24, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing be82560 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants