303456 Commits

Author SHA1 Message Date
Cameron Steffen
fa733909ed Move trait impl modifier errors to parsing
This is a technically a breaking change for what can be parsed in
`#[cfg(false)]`.
2025-08-11 16:58:21 -05:00
Cameron Steffen
39c5d6d1ca Factor out InherentImplCannotUnsafe 2025-08-11 16:58:20 -05:00
Esteban Küber
86853b3758 Account for new assert! desugaring in !condition suggestion
`rustc` is going to change the desugaring of `assert!` to be

```rust
match condition {
    true => {}
    _ => panic!(),
}
```
which will make the edge-case of `condition` being `impl Not<Output = bool>`
while not being `bool` itself no longer a straightforward suggestion,
but `!!condition` will coerce the expression to be `bool`, so it can be
machine applicable.
2025-08-11 21:38:44 +00:00
Mads Marquart
1d1316240f Always attempt to invoke xcrun to get the Apple SDK
The exact reasoning why we do not always pass the SDK root when linking
on macOS eludes me, but I suspect it's because we want to support
compiler drivers which do not support the `-isysroot` option.

Since we now pass the SDK root via the environment variable SDKROOT,
compiler drivers that don't support it can just ignore it.

Similarly, since we only warn when xcrun fails, users that expect their
compiler driver to provide the SDK location can do so now.
2025-08-11 23:31:07 +02:00
Mads Marquart
f4a911031d Only warn when invoking xcrun
To allow using zig-cc or similar as the compiler driver.
2025-08-11 22:29:01 +02:00
Mads Marquart
1cc44bfd22 Pass Apple SDK root to compiler driver via SDKROOT env var
This is more in-line with what Apple's tooling expects, and allows us to
better support custom compiler drivers (such as certain Homebrew and
Nixpkgs compilers) that prefer their own `-isysroot` flag.

Effectively, we now invoke the compiler driver as-if it was invoked as
`xcrun -sdk $sdk_name $tool`.
2025-08-11 22:29:00 +02:00
Ed Page
c1a31d8103 Deprecate RUST_TEST_* env variables
This is a documentation-only deprecation for now.
Over time, we can
- warn and then remove on use of unstable environment variables
- warn on use of stable environment variables (no plan to remove due to
  compatibility)

Longer term, we expect test runners, like `cargo test`, to provide the
necessary mechanisms for environmental or persistent configuration (e.g.
using cargo config which supports `.cargo/config.toml` as well as
environment variables).

This would include:
- `RUST_TEST_THREADS`
- `RUST_TEST_NOCAPTURE`
- `RUST_TEST_SHUFFLE` (unstable)
- `RUST_TEST_SHUFFLE_SEED` (unstable)

The primary outcomes for this change are
- Reducing the scope of what is expected for custom test harnesses to
  implement
- Reduce the mechanisms that test runners, like `cargo test`, are
  expected to track when they are being bypassed to protect against
  negative interactions, e.g.  `RUST_TEST_NOCAPTURE=1` when json output
  is being read.
2025-08-11 15:06:32 -05:00
Esteban Küber
928dd11437 fix clippy test 2025-08-11 20:04:27 +00:00
Mads Marquart
1dc37df514 Simplify add_apple_sdk
Reduce indentation and avoid needless checks (checking the target OS and
vendor is unnecessary).
2025-08-11 21:33:34 +02:00
bors
1ebbd87a62 Auto merge of #145254 - GuillaumeGomez:rollup-7bp43pv, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#144966 ( Improve suggestion for "missing function argument" on multiline call)
 - rust-lang/rust#145111 (remove some unused private trait impls)
 - rust-lang/rust#145221 (Fix Cargo cross-compilation (take two))
 - rust-lang/rust#145247 (Update `sysinfo` version to `0.37.0`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-11 19:28:22 +00:00
SabrinaJewson
45e2449b2a
Respond to review comments 2025-08-11 19:02:00 +01:00
Esteban Küber
adccb8d214 Rework NameValueStr 2025-08-11 17:02:43 +00:00
Esteban Küber
32ee26c625 Add more docs to templates for attrs with incorrect arguments 2025-08-11 17:02:32 +00:00
rustbot
50d8b80aab Update books 2025-08-11 19:00:21 +02:00
Jakub Beránek
6f584bc21e
Print created location of executed commands 2025-08-11 18:32:05 +02:00
Jakub Beránek
a0306bfa31
Update debugging/profiling bootstrap page 2025-08-11 18:22:23 +02:00
Jakub Beránek
3e77562b7d
Use pretty_step_name in step_graph 2025-08-11 18:21:32 +02:00
Jakub Beránek
12828f7cb1
Create tracing directory symlink even during dry run 2025-08-11 18:21:32 +02:00
Jakub Beránek
f9a458874c
Do not create a span for cached commands 2025-08-11 18:21:32 +02:00
Jakub Beránek
b4a357fbaa
Always profile commands and generate Chrome profile when tracing is enabled 2025-08-11 18:21:32 +02:00
Jakub Beránek
c3682b24d7
Correctly show executed command name in Chrome trace 2025-08-11 18:21:30 +02:00
Jakub Beránek
604c180bf5
Move tracing setup to the tracing module 2025-08-11 18:21:06 +02:00
Jakub Beránek
d4039349d1
Remove manual #[instrument] annotations on steps
They could easily get out of sync and miss some fields. Now all steps are instrumented automatically.
2025-08-11 18:21:06 +02:00
Jakub Beránek
690c781475
Remove ad-hoc print of executed/cached steps in verbose mode
When verbose mode is enabled, it is very hard to see the actually executed steps.
2025-08-11 18:21:06 +02:00
Jakub Beránek
1e14229e40
Create a span for each executed step 2025-08-11 18:21:06 +02:00
Jakub Beránek
c846f7c8bf
Replace tracing_forest with custom span formatting 2025-08-11 18:21:06 +02:00
Jakub Beránek
3a115ba69b
Print step timings also when the stap starts to execute
So that it is easier to see which was the last started step when a failure happens on CI.
2025-08-11 18:21:06 +02:00
Jakub Beránek
aad579537f
Use shorter command span label 2025-08-11 18:21:06 +02:00
Jakub Beránek
f819729539
Store Chrome step trace into the tracing directory 2025-08-11 18:21:06 +02:00
Jakub Beránek
c97b606523
Store latest symlink to the latest tracing output directory 2025-08-11 18:21:06 +02:00
Jakub Beránek
e6dddcb8ec
Store bootstrap tracing outputs to a unified directory 2025-08-11 18:21:06 +02:00
SabrinaJewson
19df24b3b8
Make explicit guarantees about Vec’s allocator
This commit amends the documentation of `Vec::as_mut_ptr` and
`Vec::into_raw_parts` to make it explicit that such calls may be paired
with calls to `dealloc` with a suitable layout. This guarantee was
effectively already provided by the docs of `Vec::from_raw_parts`
mentioning `alloc`.

Additionally, we copy-paste and adjust the “Memory layout” section from
the documentation of `std::boxed` to `std::vec`. This explains the allocator
guarantees in more detail.
2025-08-11 17:15:53 +01:00
bors
6355cd39c8 Auto merge of #145207 - Kobzol:codegen-backend-clif-dist, r=jieyouxu
Ship correct Cranelift library in its dist component

The first commit adds a post-dist UI test to check that Cranelift can be used with the extracted dist x64 Linux archive.

The original codegen copy logic in the Cranelift dist step was a bit redundant, and I didn't notice in https://github.com/rust-lang/rust/pull/144787 that it's copying the codegen backend from the build compiler's sysroot, rather than the target compiler's sysroot. The second commit modifies the logic to directly access the built codegen file (there is no need to search for it in the compiler's sysroot, in fact when you run just `x dist rustc_codegen_cranelift`, it shouldn't "taint" the sysroot with the codegen backend! Which it did before https://github.com/rust-lang/rust/pull/144787) and copy it to the tarball under a normalized name. Thus we get around any similar potential issues in the future, and make previously implicit logic more explicit.

This also fixes running just `x dist rustc_codegen_cranelift` without enabling `cranelift` in `rust.codegen-backends`, which should have been enabled by https://github.com/rust-lang/rust/pull/144787, but it didn't work fully, because the dist step tried to copy the codegen backend from the compiler's sysroot, but it didn't contain the codegen backend if it was not enabled by `rust.codegen-backends`.

Fixes: https://github.com/rust-lang/rust/issues/145201

try-job: dist-x86_64-linux
2025-08-11 16:13:06 +00:00
Esteban Küber
413ca5d9f0 fix tests 2025-08-11 16:05:02 +00:00
Esteban Küber
6bb29af766 Add link to invalid repr error 2025-08-11 16:00:49 +00:00
Esteban Küber
625143bac3 Add link to docs on malformed attributes 2025-08-11 16:00:49 +00:00
Esteban Küber
189f264926 Allow attr entries to declare list of alternatives for List and NamedValueStr
Modify `AttributeTemplate` to support list of alternatives for list and name value attribute styles.

Suggestions now provide more correct suggested code:

```
error[E0805]: malformed `used` attribute input
  --> $DIR/used_with_multi_args.rs:3:1
   |
LL | #[used(compiler, linker)]
   | ^^^^^^------------------^
   |       |
   |       expected a single argument here
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL - #[used(compiler, linker)]
LL + #[used(compiler)]
   |
LL - #[used(compiler, linker)]
LL + #[used(linker)]
   |
LL - #[used(compiler, linker)]
LL + #[used]
   |
```

instead of the prior "masking" of the lack of this feature by suggesting pipe-separated lists:

```
error[E0805]: malformed `used` attribute input
  --> $DIR/used_with_multi_args.rs:3:1
   |
LL | #[used(compiler, linker)]
   | ^^^^^^------------------^
   |       |
   |       expected a single argument here
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL - #[used(compiler, linker)]
LL + #[used(compiler|linker)]
   |
LL - #[used(compiler, linker)]
LL + #[used]
   |
```
2025-08-11 16:00:49 +00:00
binarycat
c022ed9927 don't emit rustdoc::broken_intra_doc_links for stuff like [!NOTE] 2025-08-11 10:50:44 -05:00
Jakub Beránek
79a134ac89
Document compiler and stdlib in stage1 in pr-check-2 CI job 2025-08-11 17:39:52 +02:00
Jakub Stasiak
2f796d9021 Make a James Bond reference 2025-08-11 16:42:09 +02:00
Jakub Stasiak
fb04c5e471 dec2flt: Provide more valid inputs examples
I was just looking at the specifics of how the parsing is handled here
and I wasn't sure if the examples were incomplete or the grammar below was
misleading.

The grammar was correct so I figured I'd add these examples to clarify.
2025-08-11 16:33:41 +02:00
Guillaume Gomez
c2915051bd
Rollup merge of #145247 - GuillaumeGomez:update-sysinfo, r=Kobzol
Update `sysinfo` version to `0.37.0`

Some small performance improvements and internal cleanups.
2025-08-11 16:19:06 +02:00
Guillaume Gomez
eee9e60afb
Rollup merge of #145221 - Kobzol:cargo-dist-fix-2, r=jieyouxu
Fix Cargo cross-compilation (take two)

In https://github.com/rust-lang/rust/pull/145083, I fixed the case of manually invoking `x dist cargo`, but I realized that `x install` creates the `tool::Cargo` step through the `from_build_frompiler` constructor, which doesn't go through `get_tool_target_compiler`. So we just prepare both the host and target stdlibs directly before building Cargo. Ideally we would get rid of `from_build_compiler`, but that will require refactoring the dist and test steps, which is upcoming.

Hopefully fixes https://github.com/rust-lang/rust/issues/145059 for good.
2025-08-11 16:19:05 +02:00
Guillaume Gomez
77d7a2c1eb
Rollup merge of #145111 - fee1-dead-contrib:push-rlvnyrztlkpq, r=jieyouxu
remove some unused private trait impls

they're neither required for completeness nor used
2025-08-11 16:19:05 +02:00
Guillaume Gomez
180e7ce700
Rollup merge of #144966 - scrabsha:push-rozroqqmurvu, r=jdonszelmann
Improve suggestion for "missing function argument" on multiline call

`rustc` has a very neat suggestion when the argument count does not match, with a nice placeholder that shows where an argument may be missing. Unfortunately the suggestion is always single-line, even when the function call spans across multiple lines. With this PR, `rustc` tries to guess if the function call is multiline or not, and emits a multiline suggestion when required.

r? `@jdonszelmann`
2025-08-11 16:19:04 +02:00
lcnr
733aea5e0a significantly improve provisional cache rebasing 2025-08-11 15:51:03 +02:00
Ayush Singh
35906eaabc
std: sys: pal: uefi: tests: Add systemtime tests
Add tests to ensure that extream system times are still representable.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-08-11 19:10:10 +05:30
Ayush Singh
0ccbe8fc71
std: sys: pal: uefi: Overhaul Time
Use a time representation with 1900-01-01-00:00:00 at timezone -1440 min as
anchor. This is the earliest time supported in UEFI.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-08-11 18:58:34 +05:30
tiif
bcf87e4172 Update error message 2025-08-11 13:28:23 +00:00
tiif
9a8facbe53 Update rustc dev guide 2025-08-11 13:28:23 +00:00