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

Rustup #4236

Merged
merged 11 commits into from
Mar 21, 2025
Merged

Rustup #4236

merged 11 commits into from
Mar 21, 2025

Conversation

RalfJung
Copy link
Member

No description provided.

RalfJung and others added 11 commits March 20, 2025 17:00
expand: Leave traces when expanding `cfg_attr` attributes

Currently `cfg_trace` just disappears during expansion, but after this PR `#[cfg_attr(some tokens)]` will leave a `#[cfg_attr_trace(some tokens)]` attribute instead of itself in AST after expansion (the new attribute is built-in and inert, its inner tokens are the same as in the original attribute).
This trace attribute can then be used by lints or other diagnostics, #133823 has some examples.

Tokens in these trace attributes are set to an empty token stream, so the traces are non-existent for proc macros and cannot affect any user-observable behavior.
This is also a weakness, because if a proc macro processes some code with the trace attributes, they will be lost, so the traces are best effort rather than precise.

The next step is to do the same thing with `cfg` attributes (`#[cfg(TRUE)]` currently remains in both AST and tokens after expanding, it should be replaced with a trace instead).

The idea belongs to `@estebank.`
Document results of non-positive logarithms

The integer versions of logarithm functions panic on non-positive numbers. The floating point versions have different, undocumented behaviour (-inf on 0, NaN on <0). This PR documents that.

try-job: aarch64-gnu
interpret memory access hooks: also pass through the Pointer used for the access

In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an `ecx`. So pass through the `Pointer` used for the access, which contains the address, and which is available everywhere we are calling these hooks.

r? `@oli-obk`
Check attrs: Don't try to retrieve the name of list stems

Fixes #138723.

r? nnethercote or compiler
bootstrap: add `--ci` flag

To make bootstrap act like it's running on CI, we had to override the `GITHUB_ACTIONS` environment variable which is a hidden detail of `CiEnv::is_ci`. Now, we can use the `--ci` flag directly on bootstrap which will be documented automatically from `x --help`. This also helps us to avoid race conditions on bootstrap (overriding `GITHUB_ACTIONS` env in each test can cause that if we run the tests in parallel) tests.
…a, r=jieyouxu

Fix the "used_with_archive" test on Fuchsia

This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
Handle spans of `~const`, `const`  and `async` trait bounds in macro expansion

r? `@compiler-errors`

`visit_span` is actually only used in one place (the `transcribe::Marker`), and all of this syntax is unstable, so while it would still be nice to write a test for it, I wager there's lots more interesting things in `transcribe::Marker` to write tests for. And the worst is some diagnostics being weird or incremental being not as incremental as it could be
Rollup of 8 pull requests

Successful merges:

 - #137357 (Document results of non-positive logarithms)
 - #138650 (Optimize `io::Write::write_fmt` for constant strings)
 - #138694 (Fix: add ohos target notes)
 - #138713 (interpret memory access hooks: also pass through the Pointer used for the access)
 - #138724 (Check attrs: Don't try to retrieve the name of list stems)
 - #138743 (bootstrap: add `--ci` flag)
 - #138751 (Fix the "used_with_archive" test on Fuchsia)
 - #138754 (Handle spans of `~const`, `const`  and `async` trait bounds in macro expansion)

r? `@ghost`
`@rustbot` modify labels: rollup
@RalfJung RalfJung enabled auto-merge March 21, 2025 13:56
@RalfJung RalfJung added this pull request to the merge queue Mar 21, 2025
Merged via the queue into rust-lang:master with commit 84c8258 Mar 21, 2025
7 checks passed
@RalfJung RalfJung deleted the rustup branch March 21, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants