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 #127892

Merged
merged 31 commits into from
Jul 18, 2024
Merged

Rollup of 9 pull requests #127892

merged 31 commits into from
Jul 18, 2024

Conversation

tgross35
Copy link
Contributor

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercote and others added 30 commits July 16, 2024 15:03
It has a single call site, it isn't that big, and its name is
confusingly similar to `Parser::parse_item_common`.
Put `attrs` before `e0` because that matches the order in the source
code, where outer attributes appear before expressions.
It has a single call site. Removing it removes the need for an
`ExprKind` check. The commit also clarifies the relevant comment.
It only has two call sites, and it extremely similar to
`Parser::parse_expr_dot_or_call_with`, in both name and behaviour. The
only difference is the latter has an `attrs` argument and an
`ensure_sufficient_stack` call. We can pass in an empty `attrs` as
necessary, as is already done at some `parse_expr_dot_or_call_with` call
sites.
This function is purely informative, answering where a stack starts.
This is a safe operation, even if an answer requires unsafe code,
and even if the result is some unsafe code decides to trust the answer.
It also doesn't need to fetch the PAGE_SIZE when its caller just did so!
Let's complicate its signature and in doing so simplify its operation.

This allows sprinkling around #[forbid(unsafe_op_in_unsafe_fn)]
The line numbers were also made consistent, some examples used the line numbers as shown on the playground while others used the line numbers that you would expect when just seeing the documentation.
The second option was chosen to make everything consistent.
`uname -m` on Linux reports `aarch64`, but on MacOS reports `arm64`.
Commonize this to `aarch64`.

With this fix, it is now possible to run aarch64 CI docker images on Arm
MacOS.
Every time we apply version-sorting, we also say to sort non-lowercase before
lowercase. This seems likely to be what we'll want for future sorting,
as well. For simplicity, just incorporate that into the definition,
"unless otherwise specified".
[`macro_metavar_expr_concat`] Add support for literals

Adds support for literals in macro parameters.

```rust
macro_rules! with_literal {
    ($literal:literal) => {
        const ${concat(FOO, $literal)}: i32 = 1;
    }
}

fn main() {
    with_literal!("_BAR");
    assert_eq!(FOO_BAR, 1);
}
```

cc rust-lang#124225

r? ``@petrochenkov``
Unignore cg_gcc fmt

`rustc_codegen_gcc` uses `rustfmt` now so it can be unignored.

r? ``@Urgau``
…better-sugg-apit, r=oli-obk

Fix precise capturing suggestion for hidden regions when we have APITs

Suggests to turn APITs into type parameters so they can be named in precise capturing syntax for hidden type lifetime errors. We also note that it may change the API.

This is currently done via a note *and* a suggestion, which feels a bit redundant, but I wasn't totally sure of a better alternative for the presentation.

Code is kind of a mess but there's a lot of cases to consider. Happy to iterate on this if you think the approach is too messy.

Based on rust-lang#127619, only the last commit is relevant.
r? oli-obk

Tracking:

- rust-lang#123432
…=spastorino

Some parser improvements

I was looking closely at attribute handling in the parser while debugging some issues relating to rust-lang#124141, and found a few small improvements.

``@spastorino``
…nur-ozkan

Commonize `uname -m` results for `aarch64` in docker runner

`uname -m` on Linux reports `aarch64`, but on MacOS reports `arm64`. Commonize this to `aarch64`.

With this fix, it is now possible to run aarch64 CI docker images on Arm MacOS.
…ig-ass-stack-overflow-fn, r=joboet

unix: break `stack_overflow::install_main_guard` into smaller fn

This was one big deeply-indented function for no reason. This made it hard to reason about the boundaries of its safety. Or just, y'know, read. Simplify it by splitting it into platform-specific functions, but which are still asked to keep compiling (a desirable property, since all of these OS use a similar API).

This is mostly a whitespace change, so I suggest reviewing it only after setting Files changed -> (the options gear) -> [x] Hide whitespace as that will make it easier to see how the code was actually broken up instead of raw line diffs.
ptr::metadata: avoid references to extern types

References to `extern types` are somewhat dubious entities, since generally we say that references must be dereferenceable for their size as determined via `size_of_val`, but with `extern type` that is an ill-defined statement. I'd like to make Miri warn for such cases since it interacts poorly with Stacked Borrows. To avoid warnings people can't fix, this requires not using references to `extern type` in the standard library, and I think `DynMetadata` is the only currently remaining use. so this changes `DynMetadata` to use a NonNull raw pointer instead. Given that the alignment was 1, this shouldn't really change anything meaningful.

I also updated a comment added by `@scottmcm` in rust-lang#125479, since I think the old comment is wrong. The `DynMetadata` type itself is not special, it is a normal aggregate. But computing field types for wide pointers (including references) is special.
Document the column numbers for the dbg! macro

The line numbers were also made consistent, some examples used the line numbers as shown on the playground while others used the line numbers that you would expect when just seeing the documentation.

The second option was chosen to make everything consistent.
…orting, r=compiler-errors

style-guide: Clarify version-sorting

Every time we apply version-sorting, we also say to sort non-lowercase before
lowercase. This seems likely to be what we'll want for future sorting,
as well. For simplicity, just incorporate that into the definition,
"unless otherwise specified".
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-style Relevant to the style team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 18, 2024
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jul 18, 2024

📌 Commit 7c63526 has been approved by tgross35

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 Jul 18, 2024
@bors
Copy link
Contributor

bors commented Jul 18, 2024

⌛ Testing commit 7c63526 with merge 4bb2f27...

@bors
Copy link
Contributor

bors commented Jul 18, 2024

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 4bb2f27 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 18, 2024
@bors bors merged commit 4bb2f27 into rust-lang:master Jul 18, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 18, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#127542 [macro_metavar_expr_concat] Add support for literals 1bb01e538a5dda750fdb3cd4859744afb6deb950 (link)
#127652 Unignore cg_gcc fmt 20ccc80acafece73b5ebb2aebd88fb7220119904 (link)
#127664 Fix precise capturing suggestion for hidden regions when we… 5fe1ec298f97b285097c0b24bf5a2f1f6823bbe1 (link)
#127806 Some parser improvements b035f40bd22ff7b3d6a3acaa2a7881c7b8bded26 (link)
#127828 Commonize uname -m results for aarch64 in docker runner c5b55474875393d378f0cc4ab0eade7756bc331b (link)
#127845 unix: break stack_overflow::install_main_guard into small… 21e5551b3b15bf4ff98ba20376ad6494318f2e8f (link)
#127859 ptr::metadata: avoid references to extern types 38687abfd8ea329fa4d0c16d241622a5a8d106ca (link)
#127861 Document the column numbers for the dbg! macro e5c371ea1c2754ad777d3ff79bbb90672fa78145 (link)
#127875 style-guide: Clarify version-sorting ed6fc7c8af5f747923d25575c3067540798d0b8b (link)

previous master: e35364a521

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 (4bb2f27): 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.4% [0.3%, 0.4%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (primary -2.7%)

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

Binary size

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

Bootstrap: 768.708s -> 768.257s (-0.06%)
Artifact size: 328.63 MiB -> 328.73 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-style Relevant to the style team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.