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 7 pull requests #136292

Merged
merged 35 commits into from
Jan 30, 2025
Merged

Rollup of 7 pull requests #136292

merged 35 commits into from
Jan 30, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

dianne and others added 30 commits January 20, 2025 16:03
The debug assertion ensuring that the pattern mutability cap holds
assumes the presence of Rule 3, so it now checks for that. I
considered going back to only tracking the mutability cap when Rule 3
is present, but since the mutability cap is used in Rule 5's
implementation too, the debug assertion would still need to check
which typing rules are present.

This also required some changes to tests:
- `ref_pat_eat_one_layer_2021.rs` had a test for Rule 3; I'll be
handling tests for earlier editions in a later commit, so as a stopgap
I've #[cfg]ed it out.
- One test case had to be moved from `well-typed-edition-2024.rs` to
`borrowck-errors.rs` in order to get borrowck to run on it and emit an
error.
These come directly from the "Compare" tab of Typing Rust Patterns,
though they had to be split across multiple files. They're not
comprehensive, but they do provide some previously-missing coverage and
are easier to check against the spec. Possibly they should be split up
some more, since `pattern-errors.rs` is getting a bit unwieldy, but I'm
not sure how best to go about that.
…back for inherited ref mutability mismatches

I think the diagnostic could use some work, but it's more helpful than
the alternative. The previous error was misleading, since it ignored the
inherited reference altogether.
…e pattern doesn't match the mutability of an inner reference

This is the `Deref(EatInner, FallbackToOuter)` rule in Typing Rust Patterns.
- Removes some excess parens

- Removes 3 duplicated tests
This serves two purposes.

First, they're additional tests that stable Rust behavior hasn't been
messed with. There's plenty of other pattern tests, so this is less
important, but these at least are targeted at what's being changed.

Second, this helps document exactly where the new rulesets agree and
disagree with stable pattern typing. This will be especially important
after the new rules for old editions are updated, since they need to be
strictly more permissive; any patterns well-typed on stable should also
be well-typed with the same resultant bindings on the (upcoming) new new
old-edition rules.

The unusual test ordering on `borrowck-errors.rs` and
`ref-binding-on-inh-ref-errors.rs` are to hopefully reduce how much
adding new tests will mess with line numbers in their stderr.
This doesn't (or at least shouldn't!) add, remove, or change any test
cases. I've grouped them by which rule variants they test.
…rules)

Since there are so many ways to write these, I've opted to only include
two sorts of test: simple tests that directly target the rules differing
between rulesets and nuanced tests that produce different errors under
different rulesets. I've also tried not to add any duplicate tests.

`well-typed-edition-2024.rs` already has tests disagreeing with stable,
so I've opted not to include any in this commit that are well-typed
under the new rules.
These are very bare-bones, only intended to provide some documentation
of what these feature gates are and aren't yet implementing.
- Consolidate calculation of the effective value.
- Check the target `DebuginfoKind` instead of using `is_like_msvc`.
[rustdoc] Add sans-serif font setting

Fixes rust-lang#52449.

This PR adds a new setting introducing the possibility to switch to a sans-serif font (`Fira Sans`) for the text.

Can be tested [here](https://rustdoc.crud.net/imperio/sans-serif/std/index.html).

cc ```@rust-lang/rustdoc-frontend```
r? ```@notriddle```
…, r=Nadrieril

Match Ergonomics 2024: update edition 2024 behavior of feature gates

This updates the edition 2024 behavior of the feature gates `ref_pat_eat_one_layer_2024_structural` and `ref_pat_eat_one_layer_2024` to correspond to the left and right typing rules compared [here](https://nadrieril.github.io/typing-rust-patterns/?compare=true&opts2=AQEBAAABAQABAgIAAQEBAAEBAAABAAA%3D&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=true&ty_d=3&style=SequentBindingMode), respectively. I'll implement the proposed new behavior for editions ≤ 2021 in another PR.

The tests are split up a bit awkwardly for practical reasons, but I've added new tests from 3 places:
- I got tests for where the typing rules differ from the "Compare" tab of the page linked above. These had to be split up based on where the errors are emitted and how rustfixable they are, so they've ended up in different files to keep tidy. Within each file, though, the order of the tests matches the order the typing differences appear in that comparison (as of when this was written).
- I used [this other comparison](https://nadrieril.github.io/typing-rust-patterns/?q=%5B%26mut+%26%28mut+x%29%5D%3A+%26mut+%5B%26CT%5D&compare=true&opts2=AQEBAgABAQEBAgIAAQEBAAEBAAABAAA%3D&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=compare&do_cmp=true&ty_d=3&style=SequentBindingMode) to test the `Deref(EatInner, FallbackToOuter)` rule of the left/"structural"/eat-inner ruleset. These are all in `well-typed-edition-2024.rs`.
- I added some select tests for cases where the new typing rules differ from current stable Rust. I had to be pickier about what I included here, but I tried to make sure each typing rule got some coverage. That said, my approach for these tests was a bit ad-hoc, so I may have missed something.

Relevant tracking issue: rust-lang#123076

r? ````@ghost````
…, r=lqd

Clean up uses of the unstable `dwarf_version` option

- Consolidate calculation of the effective value.
- Check the target `DebuginfoKind` instead of using `is_like_msvc`.
- Add the tracking issue to the unstable book page for this feature.

cc rust-lang#103057
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
Allow transmuting generic pattern types to and from their base

Pattern types always have the same size as their base type, so we can just ignore the pattern and look at the base type for figuring out whether transmuting is possible.
…jieyouxu

Fix a couple Emscripten tests

This fixes a couple Emscripten tests where the correct fix is more or less obvious. A couple UI tests are still broken with this PR:

- `tests/ui/abi/numbers-arithmetic/return-float.rs` (rust-lang#136197)
- `tests/ui/no_std/no-std-unwind-binary.rs` (haven't debugged yet)
- `tests/ui/test-attrs/test-passed.rs` (haven't debugged this either)

`````@rustbot````` label +T-compiler +O-emscripten
use impl Into<String> instead of explicit type args with bounds
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 30, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jan 30, 2025

📌 Commit 9b7af17 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 Jan 30, 2025
@bors
Copy link
Contributor

bors commented Jan 30, 2025

⌛ Testing commit 9b7af17 with merge 6ac8878...

@bors
Copy link
Contributor

bors commented Jan 30, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 6ac8878 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 30, 2025
@bors bors merged commit 6ac8878 into rust-lang:master Jan 30, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 30, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#133636 [rustdoc] Add sans-serif font setting 6aa9e3c60dd5a65c1553f54356c267bd3220d390 (link)
#135434 Match Ergonomics 2024: update edition 2024 behavior of feat… 924dc7e596cbaed41d588477ffe17b01b88da899 (link)
#135739 Clean up uses of the unstable dwarf_version option e9dc6e056a74bbc9403d4e86db4b3801bcf0064c (link)
#135882 simplify similar_tokens from Option<Vec<_>> to &[_] 0c9bef5b6ce807805261989b28ae50a039efaa9b (link)
#136179 Allow transmuting generic pattern types to and from their b… c24a00e558bd23097b4a3df3b61c100fc7195df2 (link)
#136199 Fix a couple Emscripten tests 1b991eff7179ec6a0b4dae996462ff7888195902 (link)
#136251 use impl Into instead of explicit type args with bo… 32a0fdcbc7f45a4e6f845da90030b30b27a06748 (link)

previous master: a6434ef9c0

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 (6ac8878): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary 1.5%, secondary -3.3%)

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

Cycles

Results (secondary 2.1%)

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

Binary size

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

Bootstrap: 778.54s -> 778.592s (0.01%)
Artifact size: 328.55 MiB -> 328.95 MiB (0.12%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. 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-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.

10 participants