Skip to content

Rollup of 14 pull requests #142290

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

Closed
wants to merge 49 commits into from
Closed

Conversation

fmease
Copy link
Member

@fmease fmease commented Jun 10, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mejrs and others added 30 commits June 6, 2025 11:43
…from the execution context, add getters and setters in the config, and update the tests and other relevant areas accordingly.
```
error: cannot find attribute `empty_helper` in this scope
  --> $DIR/derive-helper-legacy-limits.rs:17:3
   |
LL | #[empty_helper]
   |   ^^^^^^^^^^^^
   |
help: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute
   |
LL + #[derive(Empty)]
LL | struct S2;
   |
```

Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> src/main.rs:18:7
   |
18 |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
18 |     #[serde(untagged)]
   |       ~~~~~

error: cannot find attribute `serde` in this scope
  --> src/main.rs:12:7
   |
12 |     #[serde(untagged)]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
10 | #[derive(Serialize, Deserialize)]
   |
```
It's purely internal, and not intended to be a public API, even on
nightly. This stops it showing up and being misleading in rustdoc
search.

It also mirrors the (also internal) `core::slice::sort` module.
This takes the current behavior of `file!` and documents it so it is
safe to make assumptions about.
For example, Cargo could provide a `CARGO_RUSTC_CURRENT_DIR` as a base
path for `file!`.

Example use cases
- Being able to look up test assets relative to the current file
  ([example](https://github.com/rust-lang/cargo/blob/b9026bf654d7fac283465e58b8b76742244ef07d/tests/testsuite/cargo_add/add_basic/mod.rs#L34))
- Inline snapshotting libraries being able to update Rust source code
  ([example](https://github.com/rust-lang/cargo/blob/b9026bf654d7fac283465e58b8b76742244ef07d/tests/testsuite/alt_registry.rs#L36-L45))

T-libs-api discussed two solutions
- `file_absolute!`:
  - Has less meaning in other build tools like buck2
  - Bakes in the assumption that a full path is available (e.g. with
    trim-paths)
- Specifying `file!`s behavior (this PR):
  - Leaves it to the user to deal with trim-paths
  - Even though `file!` is currently unspecified, changing it would
    likely have too large of an impact on the ecosystem at this time.

A future possibility is that rustc could have a flag that controls
modifies the base path used for `file!`.
That seems purely additive with specifying the behavior and we do not
want to block on it.
It would also likely be too disruptive for Cargo users (as mentioned).
However, we tried to keep this in mind when specifying the behavior.
fmease added 7 commits June 10, 2025 13:30
…ing_docs, r=tgross35

docs: Small clarification on the usage of read_to_string and read_to_end trait methods

Small clarification on the usage of read_to_string and read_to_end trait methods. The goal is to make it clear that these trait methods will become locked up if attempting to read to the end of stdin (which is a bit non-sensical unless the other end closes the pipe).

Fixes: rust-lang#141714
Allow transmute casts in pre-runtime-MIR

r? `@scottmcm`

cc `@BoxyUwU`

turns out in rust-lang#138393 I erroneously used transmute casts in https://github.com/rust-lang/rust/blob/fd3da4bebdff63b7529483ff7025986ef16bf463/compiler/rustc_mir_build/src/builder/matches/test.rs#L209

I don't think they have any issues using them before runtime, we just checked for them because we didn't have code exercising those code paths
…v, r=oli-obk

deduplicate the rest of AST walker functions

After this, we can tidy things up and deduplicate the visitor traits themselves too.

Fixes rust-lang#139825, apparently

r? `@oli-obk`
…inux-kernel-version-or-later, r=workingjubilee

platform-support.md: Mention specific Linux kernel version or later

To be consistent with notes for other targets...

~~(Only made the change for `aarch64-unknown-linux-gnu` for now, as that's fairly certain after looking at the `git blame` just to be sure.)~~
Mark `core::slice::memchr` as `#[doc(hidden)]`

It's purely internal, and not intended to be a public API, even on nightly. This stops it showing up and being misleading in rustdoc search.

It also mirrors the (also internal) `core::slice::sort` module.
…fferent-lints, r=RalfJung

compiler: fn ptrs should hit different lints based on ABI

I was looking closer at the code for linting on ABIs and realized a mistake was probably made during rebase or review. I think that for function pointers in the HIR, the lint that fires should probably depend on the ABI we encountered, e.g. if it's on the newly-deprecated set of ABIs or not. This will be slightly confusing for a little bit, but I think we can do more to reduce that confusion by switching `unsupported_fn_ptr_calling_conventions` to a hard error.

r? `@RalfJung`
…i-obk

const_eval: fix some outdated comments

r? `@oli-obk`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. rollup A PR which is a rollup labels Jun 10, 2025
@fmease
Copy link
Member Author

fmease commented Jun 10, 2025

@bors r+ rollup=neve p=5

@bors
Copy link
Collaborator

bors commented Jun 10, 2025

📌 Commit 2dd6fb2 has been approved by fmease

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 Jun 10, 2025
@fmease
Copy link
Member Author

fmease commented Jun 10, 2025

@bors rollup=never

@fmease
Copy link
Member Author

fmease commented Jun 10, 2025

@bors p=5

@bors
Copy link
Collaborator

bors commented Jun 10, 2025

⌛ Testing commit 2dd6fb2 with merge 421f45f...

bors added a commit that referenced this pull request Jun 10, 2025
Rollup of 14 pull requests

Successful merges:

 - #134442 (Specify the behavior of `file!`)
 - #134841 (Look at proc-macro attributes when encountering unknown attribute)
 - #140372 (Exhaustively handle parsed attributes in CheckAttr)
 - #140766 (Stabilize keylocker)
 - #141642 (Note the version and PR of removed features when using it)
 - #141909 (Add central execution context to bootstrap)
 - #141992 (use `#[naked]` for `__rust_probestack`)
 - #142102 (docs: Small clarification on the usage of read_to_string and read_to_end trait methods)
 - #142124 (Allow transmute casts in pre-runtime-MIR)
 - #142240 (deduplicate the rest of AST walker functions)
 - #142258 (platform-support.md: Mention specific Linux kernel version or later)
 - #142262 (Mark `core::slice::memchr` as `#[doc(hidden)]`)
 - #142271 (compiler: fn ptrs should hit different lints based on ABI)
 - #142288 (const_eval: fix some outdated comments)

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

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/macros/missing-derive-1.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-1/missing-derive-1.stderr`
diff of stderr:

38 LL |     #[sede(untagged)]
39    |       ^^^^
40    |
- help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
+ help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
42    |
---
To only update this specific test, also pass `--test-args macros/missing-derive-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/missing-derive-1.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/stage2" "--target=i686-unknown-linux-musl" "--check-cfg" "cfg(test,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/macros/missing-derive-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i686-unknown-linux-musl/native/rust-test-helpers" "-Clinker=/musl-i686/bin/musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-1/auxiliary"
stdout: none
--- stderr -------------------------------
error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:8:3
   |
LL | #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |   ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-1.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum A { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:16:7
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-1.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `sede` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:22:7
   |
LL |     #[sede(untagged)] //~ ERROR cannot find attribute `sede`
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `sede`
   |         +

error: aborting due to 3 previous errors
------------------------------------------


---- [ui] tests/ui/macros/missing-derive-2.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-2/missing-derive-2.stderr`
diff of stderr:

4 LL |     #[sede(untagged)]
5    |       ^^^^
6    |
- help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
+ help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
8    |
---
To only update this specific test, also pass `--test-args macros/missing-derive-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/missing-derive-2.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/stage2" "--target=i686-unknown-linux-musl" "--check-cfg" "cfg(test,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/macros/missing-derive-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i686-unknown-linux-musl/native/rust-test-helpers" "-Clinker=/musl-i686/bin/musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-2/auxiliary"
stdout: none
--- stderr -------------------------------
error: cannot find attribute `sede` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)] //~ ERROR cannot find attribute `sede`
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `sede`
   |         +

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:8:3
   |
LL | #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |   ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum A { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: aborting due to 3 previous errors
------------------------------------------

@bors
Copy link
Collaborator

bors commented Jun 10, 2025

💔 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 Jun 10, 2025
@fmease fmease closed this Jun 10, 2025
@fmease fmease deleted the rollup-jsy3jkc branch June 10, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. rollup A PR which is a rollup 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.