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 14 pull requests #124015

Merged
merged 33 commits into from Apr 16, 2024
Merged

Rollup of 14 pull requests #124015

merged 33 commits into from Apr 16, 2024

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

davidtwco and others added 30 commits March 12, 2024 13:40
Signed-off-by: David Wood <david@davidtw.co>
This adds a whole bunch of tests checking for any difference with llvm's
archive writer. It also fixes two mistakes in the porting from C++ to
Rust. The first one causes a divergence for Mach-O archives which may or
may not be harmless. The second will definitively cause issues, but only
applies to thin archives, which rustc currently doesn't create.
The `sdk_name` is `xros`/`xrsimulator`, not `visionos`/`visionossimulator`.
The import is used once in this file, inside `posix_spawn`, so let's move the import into that function instead, to reduce the number of `cfg`s that need to be kept in sync.
Checking this was missing from the `link_env_remove` function, so compilation might fail if set when compiling for macOS
A redundant size assertion for `StatementKind` was added in rust-lang#122937, because
the existing assertion was in a different file.

This patch cleans that up, and also moves the `TerminatorKind` assertion into
the same file where it belongs, to avoid the same thing happening again.
Trait predicates for types which have errors may still
evaluate to OK leading to downstream ICEs. Now we return
a selection error for such types in candidate assembly and
thereby prevent such issues
Avoid implying that concatenating data before passing it to `write()` (with
or without `BufWriter`) ensures atomicity.
Correct usage note on OpenOptions::append()

This PR aims to correct the following usage note in `OpenOptions::append()`, which currently contains misleading information:

> One maybe obvious note when using append-mode: make sure that all data that belongs together is written to the file in one operation. This can be done by concatenating strings before passing them to [write()](https://doc.rust-lang.org/std/io/trait.Write.html#tymethod.write), or using a buffered writer (with a buffer of adequate size), and calling [flush()](https://doc.rust-lang.org/std/io/trait.Write.html#tymethod.flush) when the message is complete.

The above is misleading because, despite appearances, neither concatenating data before passing it to `write()`, nor delaying writes using `BufWriter`, ensures atomicity. `File::write()`, as well as the underlying `write(2)` system call, makes no guarantees that the data passed to it will be written out in full. It is allowed to write out only a part of the data, and has a return value that tells you how much it has written, at which point it has already returned and modified the file with partial data. Given this limitation, the only way to ensure atomicity of appends is through external locking.

Attempting to ensure atomicity by issuing data in a single `write()` is a footgun often stumbled upon by beginners, which shouldn't be advertised in the docs. The worst thing about the footgun is that it *appears* to work at first, only failing when the string becomes sufficiently large, or when some internal properties of the output file descriptor change (e.g. it is switched from regular file to a special file that talks to a socket or TTY), making it accept smaller writes. Additionally, the suggestion to use `BufWriter` skims over the issue of buffer sizes, as well as the fact that `BufWriter::flush()` contains a *loop* that can happily issue multiple writes. This loop is completely opaque to the caller, so you can't even assert atomicity after-the-fact.

The PR makes the following changes:

* removes the paragraph that suggests concatenating strings to pass them to `write()` for atomicity or using `BufWriter`
* adds a paragraph explaining why attempting to use `write()` to append atomically is not a good idea.
…=Mark-Simulacrum

sess: stabilize `-Zrelro-level` as `-Crelro-level`

Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
doc(bootstrap): add top-level doc-comment to utils/tarball.rs
…al, r=oli-obk

Fix ICE in `eval_body_using_ecx`

Ensures `TypeckResults` is tainted by failing candidate assembly for types with error

Fixes rust-lang#123154
…oli-obk

Update ar_archive_writer to 0.2.0

This adds a whole bunch of tests checking for any difference with llvm's archive writer. It also fixes two mistakes in the porting from C++ to Rust. The first one causes a divergence for Mach-O archives which may or may not be harmless. The second will definitively cause issues, but only applies to thin archives, which rustc currently doesn't create.
Various visionOS fixes

A few small mistakes was introduced in rust-lang#121419, probably after the rename from `xros` to `visionos`. See the commits for details.

CC `@agg23`

Since you reviewed rust-lang#121419
r? davidtwco
…li-obk

Better graphviz output for SCCs and NLL constraints

This PR modifies the output for `-Z dump-mir-graphviz=yes`. Specifically, it changes the output of the files `.-------.nll.0.regioncx.all.dot` and `nll.0.regioncx.scc.dot` to be easier to read and contain some information that helped me during debugging. In particular:

- SCC indices are contracted to `SCC(n)` instead of `ConstraintSccIndex(n)` to compress the nodes
- SCC regions are in `{}` rather than `[]` (controversial since they are technically ordered by index, but I figured they're more sets than arrays conceptually since they're equivalence classes).
- For regions in other universes than the root, also show the region universe (as ?8/U1)
- For regions with external names, show the external name in parenthesis
- For the region graph where edges are locations, render the All variant of the enum without the file since it's extremely long and often destroys the rendering
- For region graph edge annotations for single locations, remove the wrapping around the Location variant and just add its contents since this can be unambiguously done

Example output (from the function `foo()` of `tests/ui/error-codes/E0582.rs`) for an SCC graph:
![a graph showing SCCs](https://github.com/rust-lang/rust/assets/102855/0b998338-0379-4829-b99e-d8105c094897)

...and for the constraints:
![a graph showing regions and their constraints](https://github.com/rust-lang/rust/assets/102855/e984c4ca-7aa2-4db2-9878-bf38fe8208d5)

This PR also gives `UniverseIndex`es the `is_root()` method since this is now an operation that happens three times in the borrowck crate.
…t-deref, r=oli-obk

Make `suggest_deref_closure_return` more idiomatic/easier to understand

The only functional change here really is just making it not use a fresh type variable for upvars. I'll point that out in the code.

The rest of the changes are just stylistic, because reading this code was really confusing me (variable names were vague, ways of accessing types were unidiomatic, order of operations was kind of strange, etc).

This is stacked on rust-lang#123989.

r? oli-obk since you approved rust-lang#122213
Make `thir_tree` and `thir_flat` into hooks

No need for them to be queries, since they are only called with `-Zunpretty`
…twco

Opaque types have no namespace

Opaques are never referenced by name -- even when we have `type X = impl Sized;`, `X` is the name of the type alias, not the opaque.
…r=compiler-errors

Fix docs for unstable_features lint.

This fixes the `unstable_features` lint documentation (at https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features) so that it correctly displays the output (instead of showing `{{produces}}`). The lint was undeprecated in rust-lang#118639, but this little part was missed when that happened.
Move size assertions for `mir::syntax` types into the same file

A redundant size assertion for `StatementKind` was added in rust-lang#122937, because the existing assertion was in a different file.

This PR cleans that up, and also moves the `TerminatorKind` assertion into the same file where it belongs, to avoid the same thing happening again.

r? `@nnethercote`
… r=GuillaumeGomez

rustdoc: update the module-level docs of `rustdoc::clean`

Let's update this 11-year-old documentation.
This would've helped me greatly when first starting out.

Please point out if I should add, clarify or correct anything.
I plan on looking through the rustc dev guide later to see if anything can be expanded upon over there, too.
@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 Apr 16, 2024
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Apr 16, 2024

📌 Commit f11b21b has been approved by GuillaumeGomez

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 Apr 16, 2024
@bors
Copy link
Contributor

bors commented Apr 16, 2024

⌛ Testing commit f11b21b with merge 1dea922...

@bors
Copy link
Contributor

bors commented Apr 16, 2024

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 1dea922 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 16, 2024
@bors bors merged commit 1dea922 into rust-lang:master Apr 16, 2024
13 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 16, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#120781 Correct usage note on OpenOptions::append() 8fb2dac8c7296b4d4b99a7fa7c39a1539e9cc495 (link)
#121694 sess: stabilize -Zrelro-level as -Crelro-level 0aa06447656771668f775188610e4a5f466dfd31 (link)
#122521 doc(bootstrap): add top-level doc-comment to utils/tarball.… 35d95f8c204ff0d38ffde7519c9915a98e39afc3 (link)
#123491 Fix ICE in eval_body_using_ecx 069f6d7553b3ae77ee3af528020da952b05802ad (link)
#123574 rustdoc: rename issue-\d+.rs tests to have meaningful nam… aabe53b307e43ccfaa9c2e769a28cabe9552763c (link)
#123687 Update ar_archive_writer to 0.2.0 e02496d3da415ee02c101cc0b3ec93a8c501f14f (link)
#123721 Various visionOS fixes 8437ab2c3c09bf007ba6cf767f0ceb6a834e9323 (link)
#123797 Better graphviz output for SCCs and NLL constraints 281cbce3719050bed8722f59883caf137e59cca7 (link)
#123990 Make suggest_deref_closure_return more idiomatic/easier t… 21e91c4a3d75a0b86c9ab44357c05adafce46b59 (link)
#123995 Make thir_tree and thir_flat into hooks 9e0e8522e38f268c2bba2d69020453ac9483bc06 (link)
#123998 Opaque types have no namespace e6ac4f54117691adc33089f82509e498c1956733 (link)
#124001 Fix docs for unstable_features lint. 575860f7b26a452512f379d5ee4d35bf9a6832a5 (link)
#124006 Move size assertions for mir::syntax types into the same … 90a83e0c7d08202809d394f6e0d652f6b120f395 (link)
#124011 rustdoc: update the module-level docs of rustdoc::clean 92418b390df84e83e928abfb1ad6eea4a16e95c6 (link)

previous master: 4e1f5d90bc

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 (1dea922): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

Results

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)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

Cycles

Results

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)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.9% [-9.4%, -7.0%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 678.675s -> 679.507s (0.12%)
Artifact size: 316.10 MiB -> 316.08 MiB (-0.00%)

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.

None yet