Skip to content

Rollup of 25 pull requests#159941

Closed
jhpratt wants to merge 86 commits into
rust-lang:mainfrom
jhpratt:rollup-gnqcI7b
Closed

Rollup of 25 pull requests#159941
jhpratt wants to merge 86 commits into
rust-lang:mainfrom
jhpratt:rollup-gnqcI7b

Conversation

@jhpratt

@jhpratt jhpratt commented Jul 26, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

npmccallum and others added 30 commits October 15, 2025 15:50
- library/core/src/macros/panic.md: remove duplicate word ("another other" → "another")
- library/core/src/error.md: fix spacing ("Often times" → "Oftentimes")
- library/core/src/ptr/docs/as_ref.md: fix wrong types in Null-unchecked section (&mut T → &T)
- library/core/src/ffi/c_ulong.md: fix article ("an u64" → "a u64")
- library/core/src/ffi/c_void.md: fix plural ("old Rust compiler" → "old Rust compilers")
- library/core/src/ptr/docs/as_uninit_slice.md: fix subject-verb agreement ("is true" → "are true")
- library/std_detect/README.md: fix article ("an user-space" → "a user-space")
Expose the internal `requires_caller_location` query through
rustc_public so tools can detect when an instance has an implicit
extra `&'static Location<'static>` argument in its ABI that is
not present in the MIR body signature.

Fixes rust-lang/rustc_public#123
Add an API to construct the `&'static Location<'static>` constant
that must be passed as the implicit extra argument when calling a
`#[track_caller]` function. Users provide the span of the call
site (or the callee's definition span for reify shim fallback).

Fixes rust-lang/rustc_public#62
Since cfg_select is stable since 1.95, this can be enabled.
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
This is probably not what the user wants:

    error: nested Markdown emphasis in HTML `style` tag
      --> $DIR/invalid-html-tags-correct-script-style.rs:11:16
       |
    LL | /// One <style>*emph*</style>
       |                ^^^^^^ Markdown translates this into HTML, but the browser parses it as CSS
       |
    help: to turn off Markdown parsing, put the tag at the start of the line
       |
    LL ~ /// One
    LL ~ /// <style>*emph*</style>
       |
The `test_dir_remove_file` test currently fails under Windows 7 on:

```
thread 'fs::tests::test_dir_remove_file' (2028) panicked at library/std/src/fs/tests.rs:2590:5:
dir.remove_file("foo.txt") failed with: The parameter is incorrect. (os error 87)
```

Looking into it, this is because the `FILE_DISPOSITION_INFO_EX` variant
of the `SetFileInformationByHandle` API is used while it is only
available starting from Windows 10 1607. However,
`FILE_DISPOSITION_INFO` is still available since Vista.

This is therefore fixed by introducing a fallback to the latter API if
the former fails. This is achieved by re-using some logic that is
already available through `File::delete` and that does exactly this.

Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
Add a method Body::caller_location that resolves the correct caller
location constant for a call to a #[track_caller] function, walking
inlined source scopes to handle MIR inlining correctly.

Body now stores source scope data as a public field. Body::new
populates it with empty entries (no inlining info); bodies obtained
from the compiler have full scope data populated.

Span::as_caller_location is now pub(crate) since users should use
Body::caller_location instead, which handles inlining correctly.
In favor of passing raw pointers to inline asm.
…e lint

The new handling for non-local macros in
`semicolon_in_expressions_from_macros` produces new deny-by-default
lints on various existing crates, which have not previously received
warnings because prior Rust versions suppressed them. Split those out
into a new `semicolon_in_expressions_from_non_local_macros` lint, and
make that one warn-by-default (and FCW warn-in-deps), rather than
deny-by-default, to give the ecosystem time to adapt.

This reintroduces the `is_local` tracking from commit
9192337.
…ros`

The automatic mechanism to produce lint examples won't work, since this
lint needs a separate crate, so add a `rust,ignore` example and manually
provide the compiler output.
This is currently a no-op, but will be useful when const in `global_asm!`
can be pointers.
Currently global_asm already have symbol names when using v0 scheme, this
makes them obtain symbols with legacy scheme too.
This gives the asm-const code the basic ability to deal wiht pointer and
provenances, which lays the ground work for asm_const_ptr.

Note that `SymStatic` is not fully removed, a specialized is kept and
renamed as `SymThreadLocalStatic`, for `#[thread_local]` statics where CTFE
does not support naming. The `#[thread_local]` is unstable feature and it's
not clear if we want to support this in `sym`, but removal of it should be
a separate PR.
With the previous commit, now we can see there are some code duplication
for the handling of `GlobalAlloc` inside backends. Do some clean up to
unify them.
CTFE pointers created via type ID, `without_provenance` or pointers to const
ZSTs can now be codegenned with all 3 backends. These pointers are generated
in the same way as integers.
jhpratt added 5 commits July 26, 2026 00:13
…ove-file, r=ChrisDenton

Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`

The `test_dir_remove_file` test currently fails under Windows 7 on:

```
thread 'fs::tests::test_dir_remove_file' (2028) panicked at library/std/src/fs/tests.rs:2590:5:
dir.remove_file("foo.txt") failed with: The parameter is incorrect. (os error 87)
```

Looking into it, this is because the `FILE_DISPOSITION_INFO_EX` variant of the `SetFileInformationByHandle` API is used while it is only available starting from Windows 10 1607. However, `FILE_DISPOSITION_INFO` is still available since Vista.

This is therefore fixed by introducing a fallback to the latter API if the former fails. This is achieved by re-using some logic that is already available through `File::delete` and that does exactly this.

cc rust-lang#120426 @roblabla @the8472 @ChrisDenton @RalfJung

@rustbot label A-io T-libs O-Windows-7
…-ld, r=Mark-Simulacrum

Update wasm-component-ld to 0.5.27

Keeping up-to-date
…le_mod_inner_attr, r=nnethercote,petrochenkov

proc_macro: Fix cfg_attr inner attrs in file modules

Fixes rust-lang#159648

Inner proc-macro attrs produced by `cfg_attr` only carry the nested attr span. Splitting source around that span tries to lex two unmatched halves, so file modules fail with an unclosed delimiter.

Lex the complete module body first, then remove the expanded attr from its nested token stream. Sibling attrs stay in place, and empty `cfg_attr` wrappers use their trace span and disappear. imo this is cleaner than teaching source slicing about every nested shape.

Tests exercise sibling attrs on either side of the proc macro, then cover the single-attr case. fyi, denied lints make sibling preservation observable; ltm if another nested case should live here.
allow accessing the contents of UnsafeCell without going through get

This has been FCP'd by @rust-lang/opsem in rust-lang/unsafe-code-guidelines#281.
@rust-lang/lang since this is a change very deep in the details of the aliasing model, I assume it's fine to just FYI you here, but please stop me if that is not right.

The first commit attempts to clarify some potentially-confusing parts of the docs. @jethrogb I hope this helps somewhat resolve the confusion that these docs previously caused.

Closes rust-lang/unsafe-code-guidelines#281
…ssages, r=oli-obk

Avoid `#[target_features]`

The string `#[target_features]` is used in various error messages as well as the compiler's code. But there is no such attribute, which I found very confusing.

I think it means "one or more target features", e.g. covering both `#[target_feature(foo)]` and `#[target_feature(foo, bar, baz)]`.

We already use `#[target_feature(..)]` for that meaning in several places. So this commit changes all `#[target_features]` occurrences to `#[target_feature(..)]`. It also changes a few `#[target_feature]` (no plural) occurrences to `#[target_feature(..)]` for consistency with other mentions nearby in error messages.

r? @oli-obk
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 26, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 26, 2026
@jhpratt

jhpratt commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=100

@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-*

@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 40d68ec has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 26, 2026
@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 40d68ec with merge 54d0050

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/30187455132

rust-bors Bot pushed a commit that referenced this pull request Jul 26, 2026
Rollup of 25 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-*
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt check
error: expected a trait, found type
##[error] --> /checkout/library/alloc/src/vec/cow.rs:6:20
  |
6 | impl<'a, T: Clone> const From<&'a [T]> for Cow<'a, [T]> {
  |                    ^^^^^^^^^^^^^^^^^^^

error: expected a trait, found type
##[error]    --> /checkout/library/alloc/src/string.rs:3245:10
     |
3245 | impl<'a> const From<&'a str> for Cow<'a, str> {
     |          ^^^^^^^^^^^^^^^^^^^

error: expected a trait, found type
##[error]   --> /checkout/library/alloc/src/bstr.rs:598:10
    |
598 | impl<'a> const From<&'a ByteStr> for Cow<'a, ByteStr> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^

error: expected a trait, found type
##[error]   --> /checkout/library/alloc/src/ffi/c_str.rs:885:10
    |
885 | impl<'a> const From<&'a CStr> for Cow<'a, CStr> {
    |          ^^^^^^^^^^^^^^^^^^^^

fmt: checked 7052 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Currently active steps:

@jhpratt

jhpratt commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@bors try cancel

@jhpratt jhpratt closed this Jul 26, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 26, 2026
@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.