Skip to content
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

Rollup of 9 pull requests #128883

Merged
merged 30 commits into from
Aug 9, 2024
Merged

Rollup of 9 pull requests #128883

merged 30 commits into from
Aug 9, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

biabbas and others added 30 commits August 8, 2024 12:59
Co-authored-by: lcnr <rust@lcnr.de>
Co-authored-by: Trevor Gross <t.gross35@gmail.com>
Parser has error recovery for Unicode-confusables, which includes the
right parentheses `)`. If a multi-byte right parentheses look-alike
reaches the argument removal suggestion diagnostics, it would trigger an
assertion because the diagnostics used `- BytePos(1)` which can land
within a multi-byte codepoint.

This is fixed by using `SourceMap::end_point` to find the final right
delimiter codepoint, which correctly respects codepoint boundaries.
For codepoint boundary assertion triggered by a let stmt compound
assignment removal suggestion when encountering recovered multi-byte
compound ops.

Issue: <rust-lang#128845>
…t codepoint boundaries

Previously we would try to issue a suggestion for `let x <op>= 1`, i.e.
a compound assignment within a `let` binding, to remove the `<op>`. The
suggestion code unfortunately incorrectly assumed that the `<op>` is an
exactly-1-byte ASCII character, but this assumption is incorrect because
we also recover Unicode-confusables like `➖=` as `-=`. In this example,
the suggestion code used a `+ BytePos(1)` to calculate the span of the
`<op>` codepoint that looks like `-` but the mult-byte Unicode
look-alike would cause the suggested removal span to be inside a
multi-byte codepoint boundary, triggering a codepoint boundary
assertion.

Issue: <rust-lang#128845>
This will be useful for certain scenarios where developers want to know
how the tarball sources were generated. We also want this to check for CI
rustc incompatible options on bootstrap.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Add `Steal::is_stolen()`

Writers of rustc drivers (such as myself) often encounter stealing issues. It is currently impossible to gracefully handle them. This PR adds a `Steal::is_stolen()` function for that purpose.
VxWorks code refactored

1. Extern TaskNameSet as minimum supported version of os is VxWorks 7 which would have taskNameSet
2. Vx_TASK_NAME_LEN is 31 on VxWorks7, defined variable res.
3. Add unsafe blocks on Non::Zero usage in available_parallelism()
4. Update vxworks docs.
r? `@tgross35`
cc `@devnexen`
…balls, r=Kobzol

add `builder-config` into tarball sources

This will be useful for certain scenarios where developers want to know how the tarball sources were generated. We also want this to check for CI rustc incompatible options on bootstrap.

Blocker for rust-lang#122709

r? Kobzol
…-not-rust, r=GuillaumeGomez

rustdoc: do not run doctests with invalid langstrings

rust-lang#124577 (comment)

CC ``@decathorpe``
…able-sort, r=compiler-errors

use stable sort to sort multipart diagnostics

I think a stable sort should be used to sort the different parts of a multipart selection. The current unstable sort uses the text of the suggestion as a tie-breaker. That just doesn't seem right, and the order of the input is a better choice I think, because it gives the diagnostic author more control.

This came up when I was building a suggestion where

```rust
fn foo() {}
```

must be turned into an unsafe function, and an attribute must be added

```rust
#[target_feature(enable = "...")]
unsafe fn foo() {}
```

In this example, the two suggestions occur at the same position, but the order is extremely important: unsafe must come after the attribute. But the situation changes if there is a pub/pub(crate), and if the unsafe is already present. It just out that because of the suggestion text, there is no way for me to order the suggestions correctly.

This change probably should be tested, but are there tests of the diagnostics code itself in the tests?

r? ```@estebank```
Fix the name of signal 19 in library/std/src/sys/pal/unix/process/process_unix/tests.rs for mips/sparc linux

relate to rust-lang#128816
Use `SourceMap::end_point` instead of `- BytePos(1)` in arg removal suggestion

Previously, we tried to remove extra arg commas when providing extra arg removal suggestions. One of
the edge cases is having to account for an arg that has a closing delimiter `)` following it.
However, the previous suggestion code assumed that the delimiter is in fact exactly the 1-byte `)`
character. This assumption was proven incorrect, because we recover from Unicode-confusable
delimiters in the parser, which means that the ending delimiter could be a multi-byte codepoint
that looks *like* a `)`. Subtracing 1 byte could land us in the middle of a codepoint, triggering a
codepoint boundary assertion.

This is fixed by using `SourceMap::end_point` which properly accounts for codepoint boundaries.

Fixes rust-lang#128717.

cc ````@fmease```` and rust-lang#128790
Ensure let stmt compound assignment removal suggestion respect codepoint boundaries

Previously we would try to issue a suggestion for `let x <op>= 1`, i.e.
a compound assignment within a `let` binding, to remove the `<op>`. The
suggestion code unfortunately incorrectly assumed that the `<op>` is an
exactly-1-byte ASCII character, but this assumption is incorrect because
we also recover Unicode-confusables like `➖=` as `-=`. In this example,
the suggestion code used a `+ BytePos(1)` to calculate the span of the
`<op>` codepoint that looks like `-` but the mult-byte Unicode
look-alike would cause the suggested removal span to be inside a
multi-byte codepoint boundary, triggering a codepoint boundary
assertion.

The fix is to use `SourceMap::start_point(token_span)` which properly accounts for codepoint boundaries.

Fixes rust-lang#128845.

cc rust-lang#128790

r? ````@fmease````
…-ozkan

Disable verbose bootstrap command failure logging by default

One of my recent bootstrap command refactoring PRs enabled verbose logging of command failures by default. While this is great for debugging bootstrap, in many situations it's just too verbose and prevents the user from seeing the actual printed stdout/stderr, which usually contains much more useful information.

This PR reverts that logic, and only prints a detailed error when `-v` is passed to bootstrap.

r? ````@onur-ozkan````
@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 9, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Aug 9, 2024

📌 Commit cea3b42 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 9, 2024
@bors
Copy link
Contributor

bors commented Aug 9, 2024

⌛ Testing commit cea3b42 with merge 19ebdce...

@bors
Copy link
Contributor

bors commented Aug 9, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 19ebdce to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 9, 2024
@bors bors merged commit 19ebdce into rust-lang:master Aug 9, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 9, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#128815 Add Steal::is_stolen() 08d71a8a4ff0e5e95b03675e7638bc70464d85fb (link)
#128817 VxWorks code refactored 81026bc8aff24861d759af1b424559c0f72b27e7 (link)
#128822 add builder-config into tarball sources 4b32afbcfcae17ed4eea563605cdabc4b161feb0 (link)
#128838 rustdoc: do not run doctests with invalid langstrings 4c986287558ae22bbd7b3caecb44a681ad6dc6cf (link)
#128852 use stable sort to sort multipart diagnostics c809b1ea2d1c7cc7ed3727a8a15f3a1e931ec620 (link)
#128859 Fix the name of signal 19 in library/std/src/sys/pal/unix/p… 2c84138647a2d777dfbad855a755424b7461c661 (link)
#128864 Use SourceMap::end_point instead of - BytePos(1) in arg… 1c3fb629844ddc8f4a7b3ffdfc1d4f682dac4b25 (link)
#128865 Ensure let stmt compound assignment removal suggestion resp… 32e1f87daf1b30047a5a8b24563c63f572fca5c2 (link)
#128874 Disable verbose bootstrap command failure logging by default f951f32a36c8d44456af583287d60fcaef1ad619 (link)

previous master: 899eb03926

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (19ebdce): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.9%, secondary 3.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
-4.5% [-4.5%, -4.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-4.5%, 2.8%] 2

Cycles

Results (secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
7.0% [7.0%, 7.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 759.636s -> 762.414s (0.37%)
Artifact size: 337.10 MiB -> 337.15 MiB (0.02%)

@matthiaskrgr matthiaskrgr deleted the rollup-mkzi7my branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.