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

Closed
wants to merge 30 commits into from

Conversation

matthiaskrgr
Copy link
Member

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.
…t-lint, r=compiler-errors

Add internal lint for detecting non-glob imports of `rustc_type_ir::inherent`

rust-lang#127627 (comment)

r? compiler-errors
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 about the rust-lang/rust repository. 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 17, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Jul 17, 2024

📌 Commit 5a8d0ec 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 Jul 17, 2024
@bors
Copy link
Contributor

bors commented Jul 18, 2024

⌛ Testing commit 5a8d0ec with merge 3610b45...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 18, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#127542 ([`macro_metavar_expr_concat`] Add support for literals)
 - rust-lang#127652 (Unignore cg_gcc fmt)
 - rust-lang#127664 (Fix precise capturing suggestion for hidden regions when we have APITs)
 - rust-lang#127806 (Some parser improvements)
 - rust-lang#127828 (Commonize `uname -m` results for `aarch64` in docker runner)
 - rust-lang#127845 (unix: break `stack_overflow::install_main_guard` into smaller fn)
 - rust-lang#127854 (Add internal lint for detecting non-glob imports of `rustc_type_ir::inherent`)
 - rust-lang#127861 (Document the column numbers for the dbg! macro)
 - rust-lang#127875 (style-guide: Clarify version-sorting)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "/checkout/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent/auxiliary" "-Z" "unstable-options"
--- stderr -------------------------------
warning: unknown lint: `rustc::non_glob_import_of_type_ir_inherent`
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs:3:9
   |

@bors
Copy link
Contributor

bors commented Jul 18, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 18, 2024
@tgross35 tgross35 closed this Jul 18, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-aczhyuj 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
A-meta Area: Issues about the rust-lang/rust repository. A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like rollup A PR which is a rollup 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.