Commit Graph

17566 Commits

Author SHA1 Message Date
Mara Bos
6f7a90527e
Merge 5113f5e602 into 65fa0ab924 2025-04-13 13:32:28 +02:00
bors
65fa0ab924 Auto merge of #139734 - ChrisDenton:rollup-28qn740, r=ChrisDenton
Rollup of 6 pull requests

Successful merges:

 - #139107 (std: make `cmath` functions safe)
 - #139607 (Add regression test for #127424)
 - #139691 (Document that `opt-dist` requires metrics to be enabled)
 - #139707 (Fix comment in bootstrap)
 - #139708 (Fix name of field in doc comment)
 - #139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-13 07:10:43 +00:00
Chris Denton
546367ef69
Rollup merge of #139607 - reddevilmidzy:add-regression-test, r=petrochenkov
Add regression test for #127424

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

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!
2025-04-13 03:07:06 +00:00
Chris Denton
0e50fda4b6
Rollup merge of #139705 - jieyouxu:tests-precursor, r=compiler-errors
Removed outdated ui test suite README, give reasons for disabled tests

### Changes

- `tests/ui/README.md` is very outdated, test suite docs should consistently live in rustc-dev-guide.
- Add reasons for `//@ ignore-test` tests that don't have one.[^query]

This is a precursor change to make follow-up changes easier (possibly more specialized directives or converting some auxiliaries into the canonical `auxiliary/` form).

[^query]: searched via `rg --no-ignore -F -e "ignore-test" tests/`.
2025-04-12 21:05:31 +00:00
Chris Denton
e0f92bb53c
Rollup merge of #139688 - rust-lang:notriddle/io-result-unbox, r=GuillaumeGomez
rustdoc-search: add unbox flag to Result aliases

Fixes #139665
2025-04-12 21:05:30 +00:00
bors
9ffde4b089 Auto merge of #139242 - jieyouxu:run-make-artifact-names-cross, r=Kobzol
run-make-support: Calculate artifact names for target platform, not host platform

This was implemented incorrectly during the porting process, where we relied on std consts. However, `run-make-support` is a host-only library, which meant that these artifact names were for the *host* and not the *target*.

Helps with #138066.

r? `@Kobzol`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
2025-04-12 16:54:16 +00:00
reddevilmidzy
11256a0fb0 Add regression test for #127424 2025-04-12 22:16:08 +09:00
Jieyou Xu
db6e3aa913
tests: ensure disabled tests have a reason 2025-04-12 15:24:25 +08:00
Jieyou Xu
762ecf8e00
tests/ui: remove outdated README
We should consolidate our test suite docs in rustc-dev-guide, and this
README is very outdated.
2025-04-12 15:18:01 +08:00
Jieyou Xu
4362789eb0
tests: produce target artifacts and/or require crate type / ignore cross-compile
Some tests fail on cross-compiled targets due to various linker problems
on cross-compiled target, and having test coverage for these against
cross-compiled targets is nice but not necessary.
2025-04-12 15:09:06 +08:00
bors
1bc56185ee Auto merge of #139430 - scottmcm:polymorphic-array-into-iter, r=cuviper
Polymorphize `array::IntoIter`'s iterator impl

Today we emit all the iterator methods for every different array width.  That's wasteful since the actual array length never even comes into it -- the indices used are from the separate `alive: IndexRange` field, not even the `N` const param.

This PR switches things so that an `array::IntoIter<T, N>` stores a `PolymorphicIter<[MaybeUninit<T>; N]>`, which we *unsize* to `PolymorphicIter<[MaybeUninit<T>]>` and call methods on that non-`Sized` type for all the iterator methods.

That also necessarily makes the layout consistent between the different lengths of arrays, because of the unsizing.  Compare that to today <https://rust.godbolt.org/z/Prb4xMPrb>, where different widths can't even be deduped because the offset to the indices is different for different array widths.
2025-04-11 23:21:31 +00:00
Jacob Pratt
2b54f9bfb1
Rollup merge of #139662 - nnethercote:tweak-DefPathData, r=compiler-errors
Tweak `DefPathData`

Some improvements in and around `DefPathData`, following on from #137977.

r? `@spastorino`
2025-04-11 21:21:01 +02:00
Jacob Pratt
2f873f96e2
Rollup merge of #139653 - nnethercote:fix-139495, r=petrochenkov
Handle a negated literal in `eat_token_lit`.

Fixes #139495.

r? `@petrochenkov`
2025-04-11 21:21:01 +02:00
Jacob Pratt
a6608294a9
Rollup merge of #137835 - scottmcm:signum, r=compiler-errors
Use `BinOp::Cmp` for `iNN::signum`

This way it can use the nice new LLVM intrinsic in LLVM20.
2025-04-11 21:20:59 +02:00
Michael Howell
e013cf8afc rustdoc-search: add unbox flag to Result aliases
Fixes #139665
2025-04-11 11:36:40 -07:00
bors
e1b06f7730 Auto merge of #139453 - compiler-errors:incr, r=jieyouxu
Prepend temp files with per-invocation random string to avoid temp filename conflicts

https://github.com/rust-lang/rust/issues/139407 uncovered a very subtle unsoundness with incremental codegen, failing compilation sessions (due to assembler errors), and the "prefer hard linking over copying files" strategy we use in the compiler for file management.

Specifically, imagine we're building a single file 3 times, all with `-Csave-temps -Cincremental=...`. Let's call the object file we're building for the codegen unit for `main` "`XXX.o`" just for clarity since it's probably some gigantic hash name:

```
#[inline(never)]
#[cfg(any(rpass1, rpass3))]
fn a() -> i32 {
    0
}

#[cfg(any(cfail2))]
fn a() -> i32 {
    1
}

fn main() {
    evil::evil();
    assert_eq!(a(), 0);
}

mod evil {
    #[cfg(any(rpass1, rpass3))]
    pub fn evil() {
        unsafe {
            std::arch::asm!("/*  */");
        }
    }

    #[cfg(any(cfail2))]
    pub fn evil() {
        unsafe {
            std::arch::asm!("missing");
        }
    }
}
```

Session 1 (`rpass1`):
* Type-check, borrow-check, etc.
* Serialize the dep graph to the incremental working directory `.../s-...-working/`.
* Codegen object file to a temp file `XXX.rcgu.o` which is spit out in the cwd.
* Hard-link[^1] `XXX.rcgu.o` to the incremental working directory `.../s-...-working/XXX.o`.
* Save-temps option means we don't delete `XXX.rgcu.o`.
* Link the binary and stuff.
* Finalize[^2] the working incremental session by renaming `.../s-...-working` to ` s-...-asjkdhsjakd` (some other finalized incr comp session dir name).

Session 2 (`cfail2`):
* Load artifacts from the previous *finalized* incremental session, namely the dep graph.
* Type-check, borrow-check, etc. since the file has changed, so most dep graph nodes are red.
* Serialize the dep graph to the incremental working directory `.../s-...-working/`.
* Codegen object file to a temp file `XXX.rcgu.o`. **HERE IS THE PROBLEM**: The hard-link is still set up to point to the inode from `XXX.o` from the first session, so this also modifies the `XXX.o` in the previous finalized session directory.
* Codegen emits an error b/c `missing` is not an instruction, so we abort before finalizing the incremental session. Specifically, this means that the *previous* session is the last finalized session.

Session 3 (`rpass3`):
* Load artifacts from the previous *finalized* incremental session, namely the dep graph. NOTE that this is from session 1.
* All the dep graph nodes are green since we are basically replaying session 1.
* codegen object file `XXX.o`, which is detected as *reused* from session 1 since dep nodes were green. That means we **reuse** `XXX.o` which had been dirtied from session 2.
* Link the binary and stuff.

This results in a binary which reuses some of the build artifacts from session 2, but thinks it's from session 1.

At this point, I hope it's clear to see that the incremental results from session 1 were dirtied from session 2, but we reuse them as if session 1 was the previous (finalized) incremental session we ran. This is at best really buggy, and at worst **unsound**.

This isn't limited to `-C save-temps`, since there are other combinations of flags that may keep around temporary files (hard linked) in the working directory (like `-C debuginfo=1 -C split-debuginfo=unpacked` on darwin, for example).

---

This PR implements a fix which is to prepend temp filenames with a random string that is generated per invocation of rustc. This string is not *deterministic*, but temporary files are transient anyways, so I don't believe this is a problem.

That means that temp files are now something like... `{crate-name}.{cgu}.{invocation_temp}.rcgu.o`, where `{invocation_temp}` is the new temporary string we generate per invocation of rustc.

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

[^1]: 175dcc7773/compiler/rustc_fs_util/src/lib.rs (L60)
[^2]: 175dcc7773/compiler/rustc_incremental/src/persist/fs.rs (L1-L40)
2025-04-11 13:59:33 +00:00
Mara Bos
3962069982 Replace proc_macro::SourceFile by Span::{file, local_file}. 2025-04-11 15:07:08 +02:00
Mara Bos
6788ce76c9 Remove proc_macro::SourceFile::is_real(). 2025-04-11 14:02:06 +02:00
bors
71b68da1bd Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015`

Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter.

This PR fixes the two categories of failures happening when `--edition=2015` is passed:

* Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error.
* Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation.

Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests.

I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed.

r? `@jieyouxu`
2025-04-11 10:53:45 +00:00
Nicholas Nethercote
cdf5b8d4e7 Change how anonymous associated types are printed.
Give them their own symbol `anon_assoc`, as is done for all the other
anonymous `DefPathData` variants.
2025-04-11 20:13:16 +10:00
Pietro Albini
3ebf1c2e67
didn't catch this test failure, whoops 2025-04-11 09:57:21 +02:00
Stuart Cook
96d282c87b
Rollup merge of #139654 - nnethercote:AssocKind-descr, r=compiler-errors
Improve `AssocItem::descr`.

The commit adds "associated" to the description of associated types and associated consts, to match the description of associated functions. This increases error message precision and consistency with `AssocKind::fmt`.

The commit also notes an imperfection in `AssocKind::fmt`; fixing this imperfection is possible but beyond the scope of this PR.

r? `@estebank`
2025-04-11 13:31:50 +10:00
Stuart Cook
25d282efd4
Rollup merge of #139641 - BoxyUwU:allow_parend_array_len_infer, r=compiler-errors
Allow parenthesis around inferred array lengths

In #135272 it was noticed that we weren't handling `Vec<(((((_)))))>` correctly under the new desugaring for `generic_arg_infer`, this had to be fixed in order to not regress stable code for types that should continue working. This has the side effect of *also* allowing the following to work:
```rust
#![feature(generic_arg_infer)]
struct Bar<const N: usize>;
fn main() {
    let a: Bar<((_))> = Bar::<10>;
}
```

However I did not make the same change for array lengths resulting in the following not compiling:
```rust
#![feature(generic_arg_infer)]
fn main() {
    let a: [u8; (((_)))] = [2; 2];
    let a: [u8; 2] = [2; (((((_)))))];
}
```

This is rather inconsistent as parenthesis around `_` *are* supported for const args to non-arrays, and type args. This PR fixes this allowing the above example to compile. No stable impact.

r? compiler-errors
2025-04-11 13:31:49 +10:00
Stuart Cook
d213934874
Rollup merge of #139564 - compiler-errors:deeply-norm, r=lcnr
Deeply normalize obligations in `BestObligation` folder

Built on #139513.

This establishes a somewhat rough invariant that the `Obligation`'s predicate is always deeply normalized in the folder; when we construct a new obligation we normalize it.

Putting this up for discussion since it does affect some goals.

r? lcnr
2025-04-11 13:31:48 +10:00
Stuart Cook
ea1a31b150
Rollup merge of #139469 - jieyouxu:compiletest-supports-crate-type, r=onur-ozkan
Introduce a `//@ needs-crate-type` compiletest directive

The `//@ needs-crate-type: $crate_types...` directive takes a comma-separated list of crate types that the target platform must support in order for the test to be run. This allows the test writer to semantically convey that the ignore condition is based on target crate type needs, instead of using a general purpose `//@ ignore-$target` directive (often without comment).

Fixes #132309.

### Example

```rs
//@ needs-crate-type: dylib (ignored on e.g. wasm32-unknown-unknown)
//@ compile-flags: --crate-type=dylib

fn foo() {}
```

### Review advice

- Best reviewed commit-by-commit.
- The impl is not very clean, I briefly attempted to clean up the directive handling but found that more invasive changes are needed, so I'd like to not block on the cleanup for now.

try-job: test-various
try-job: armhf-gnu
2025-04-11 13:31:47 +10:00
Stuart Cook
573ebf011e
Rollup merge of #138998 - rperier:donot_suggest_to_use_impl_trait_in_closure_params, r=Noratrieb
Don't suggest the use of  `impl Trait` in closure parameter

Fixes #138932
2025-04-11 13:31:46 +10:00
Stuart Cook
9a9a0781fa
Rollup merge of #138904 - madsmtm:apple-test-no-std, r=tgross35
Test linking and running `no_std` binaries

I looked around, but it seems that we do not have a test that tests a `#![no_std]` + `#![no_main]` binary. So now I've added one. Motivated by discussion in [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Provide.20.60__isPlatformVersionAtLeast.60.20in.20.60std.60.3F/with/507870028).

r? ```@tgross35```

try-job: arm-android
try-job: armhf-gnu
try-job: dist-ohos
try-job: x86_64-mingw-1
2025-04-11 13:31:45 +10:00
Stuart Cook
0abc6c6e98
Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead
Allow drivers to supply a list of extra symbols to intern

Allows adding new symbols as `const`s in external drivers, desirable in Clippy so we can use them in patterns to replace code like 75530e9f72/src/tools/clippy/clippy_lints/src/casts/cast_ptr_alignment.rs (L66)

The Clippy change adds a couple symbols as a demo, the exact `clippy_utils` API and replacing other usages can be done on the Clippy side to minimise sync conflicts

---

try-job: aarch64-gnu
2025-04-11 13:31:44 +10:00
Stuart Cook
63df6f1200
Rollup merge of #138182 - durin42:llvm-21-fp128-windows, r=tgross35
rustc_target: update x86_win64 to match the documented calling convention for f128

llvm/llvm-project@5ee1c0b714 updates llvm to match the documented calling convention to pass f128 indirectly. This change makes us do that on all versions of LLVM, not just starting with LLVM 21.

`@rustbot` label llvm-main

try-job: dist-x86_64-msvc
try-job: dist-x86_64-mingw
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
2025-04-11 13:31:44 +10:00
Stuart Cook
45ebc4060b
Rollup merge of #137447 - folkertdev:simd-extract-insert-dyn, r=scottmcm
add `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`

fixes https://github.com/rust-lang/rust/issues/137372

adds `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`, which contrary to their non-dyn counterparts allow a non-const index. Many platforms (but notably not x86_64 or aarch64) have dedicated instructions for this operation, which stdarch can emit with this change.

Future work is to also make the `Index` operation on the `Simd` type emit this operation, but the intrinsic can't be used directly. We'll need some MIR shenanigans for that.

r? `@ghost`
2025-04-11 13:31:43 +10:00
Nicholas Nethercote
7e8184fa2a Improve AssocItem::descr.
The commit adds "associated" to the description of associated types and
associated consts, to match the description of associated functions.
This increases error message precision and consistency with
`AssocKind::fmt`.

The commit also notes an imperfection in `AssocKind::fmt`; fixing this
imperfection is possible but beyond the scope of this PR.
2025-04-11 11:03:08 +10:00
Nicholas Nethercote
d25c8a8ade Handle a negated literal in eat_token_lit.
Fixes #139495.
2025-04-11 10:57:36 +10:00
bors
0fe8f3454d Auto merge of #137412 - scottmcm:redo-swap, r=cuviper
Ensure `swap_nonoverlapping` is really always untyped

This replaces #134954, which was arguably overcomplicated.

## Fixes #134713

Actually using the type passed to `ptr::swap_nonoverlapping` for anything other than its size + align turns out to not work, so this goes back to always erasing the types down to just bytes.

(Except in `const`, which keeps doing the same thing as before to preserve `@RalfJung's` fix from #134689)

## Fixes #134946

I'd previously moved the swapping to use auto-vectorization *on bytes*, but someone pointed out on Discord that the tail loop handling from that left a whole bunch of byte-by-byte swapping around.  This goes back to manual tail handling to avoid that, then still triggers auto-vectorization on pointer-width values.  (So you'll see `<4 x i64>` on `x86-64-v3` for example.)
2025-04-10 20:19:11 +00:00
Augie Fackler
d7e7f8b522 tests: adjust expectation for f128 abi on Windows
llvm/llvm-project@5ee1c0b714 updates llvm
to match the documented calling convention to pass f128 indirectly.

@rustbot label llvm-main
2025-04-10 15:28:56 -04:00
Folkert de Vries
59c55339af
add simd_insert_dyn and simd_extract_dyn 2025-04-10 21:22:07 +02:00
Michael Goulet
decd7ecd1e Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
Boxy
8f00b1fdad Allow parenthesis around inferred array lengths 2025-04-10 18:57:42 +01:00
Matthias Krüger
9b9d098e1d
Rollup merge of #139626 - m-ou-se:mut, r=lqd
Remove unnecessary `mut` in test.

The value is moved in `pin!()`, so the binding doesn't need to be `mut` itself.

(Rustc doesn't warn about this due to the current hacky implementation of `pin!()`. That is fixed by https://github.com/rust-lang/rust/pull/139114.)
2025-04-10 17:27:17 +02:00
Matthias Krüger
7fbd7bdfa8
Rollup merge of #139614 - nnethercote:fix-139512, r=oli-obk
Avoid empty identifiers for delegate params and args.

Details in individual commits.

r? `@oli-obk`
2025-04-10 17:27:16 +02:00
Matthias Krüger
79f357e63d
Rollup merge of #139510 - nnethercote:name-to-ident, r=fee1-dead
Rename some `name` variables as `ident`.

It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`.

This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk.

r? `@fee1-dead`
2025-04-10 17:27:14 +02:00
Matthias Krüger
0e9c4fbf23
Rollup merge of #139502 - yaahc:still-mutable-ice, r=bjorn3
fix "still mutable" ice while metrics are enabled

Resolves "still mutable" ICE discovered by `@matthiaskrgr` here: [#t-docs-rs > metrics intitiative @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/356853-t-docs-rs/topic/metrics.20intitiative/near/510490790)

This was caused by invoking `crate_hash` before the `definitions` struct was frozen here: e643f59f6d/compiler/rustc_interface/src/passes.rs (L951)

resolved by moving metrics dumping to occur after `analysis` freezes the definitions

I'm guessing we didn't discover this in CI because the problem only occurs when you try to calculate the crash hash with incremental compilation enabled when it tries to freeze the definitions here: e643f59f6d/compiler/rustc_middle/src/hir/map.rs (L1172)

my understanding is that this causes us to freeze the definitions too early in compilation, then we subsequently try to mutate them, likely during `analysis`, and this causes the ICE.

r? `@bjorn3`
2025-04-10 17:27:13 +02:00
Alex Macleod
f740326216 Allow drivers to supply a list of extra symbols to intern 2025-04-10 13:39:23 +00:00
bors
69b3959afe Auto merge of #139622 - matthiaskrgr:rollup-8ri1vid, r=matthiaskrgr
Rollup of 13 pull requests

Successful merges:

 - #138167 (Small code improvement in rustdoc hidden stripper)
 - #138605 (Clean up librustdoc::html::render to be better encapsulated)
 - #139423 (Suppress missing field error when autoderef bottoms out in infer)
 - #139449 (match ergonomics: replace `peel_off_references` with a recursive call)
 - #139507 (compiletest: Trim whitespace from environment variable names)
 - #139530 (Remove some dead or leftover code related to rustc-intrinsic abi removal)
 - #139560 (fix title of offset_of_enum feature)
 - #139563 (emit a better error message for using the macro incorrectly)
 - #139568 (Don't use empty trait names)
 - #139580 (Temporarily leave the review rotation)
 - #139589 (saethlin is back from vacation)
 - #139592 (rustdoc: Enable Markdown extensions when looking for doctests)
 - #139599 (Tracking issue template: fine-grained information on style update status)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-10 12:18:24 +00:00
Mara Bos
95613e3dbc Remove unnecessary mut.
The value is moved in pin!().
2025-04-10 12:40:27 +02:00
Matthias Krüger
d7171bc8ce
Rollup merge of #139592 - camelid:doctest-md-opts, r=notriddle
rustdoc: Enable Markdown extensions when looking for doctests

Fixes #139064.

We should enable these to avoid misinterpreting uses of the extended
syntax as code blocks. This happens in practice with multi-paragraph
footnotes, as discovered in #139064.
2025-04-10 11:10:19 +02:00
Matthias Krüger
7509b4652c
Rollup merge of #139568 - nnethercote:empty-trait-name, r=compiler-errors
Don't use empty trait names

Helps with #137978. Details in individual commits.

r? ```@davidtwco```
2025-04-10 11:10:17 +02:00
Matthias Krüger
e8994abe52
Rollup merge of #139563 - EnzymeAD:better-autodiff-err, r=jieyouxu
emit a better error message for using the macro incorrectly

fixing: https://github.com/EnzymeAD/rust/issues/185
I feel like it's not a perfect message either, so I'm open to suggestions.
But at the end of the day users will need to read the docs anyway, and emitting
multi-line errors each time this gets triggered can probably become annoying?

r? ``@jieyouxu`` since you've reviewed my frontend work back in the days.

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-04-10 11:10:17 +02:00
Matthias Krüger
c808b20360
Rollup merge of #139530 - oli-obk:rustc-intrinsic-cleanup, r=RalfJung
Remove some dead or leftover code related to rustc-intrinsic abi removal

r? ```@RalfJung```

PR that removed the ABI: https://github.com/rust-lang/rust/pull/139455

tracking issue: https://github.com/rust-lang/rust/issues/132735
2025-04-10 11:10:16 +02:00
Matthias Krüger
2b0e47eb4c
Rollup merge of #139507 - Zalathar:trim-env-name, r=jieyouxu
compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in https://github.com/rust-lang/rust/pull/138603#issuecomment-2783709359.

Fixes #132990.
Supersedes #133148.

---

try-job: test-various
2025-04-10 11:10:15 +02:00
Matthias Krüger
b131828f0d
Rollup merge of #139423 - compiler-errors:field-autoderef, r=oli-obk
Suppress missing field error when autoderef bottoms out in infer

I see this error repeatedly when doing refactorings, and it's pretty misleading b/c it's not the source of the error.
2025-04-10 11:10:14 +02:00