about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-28 01:16:39 +0200
committerGitHub <noreply@github.com>2025-07-28 01:16:39 +0200
commitd776c5a8354208bdce3ef9cc742e248d14c5aefe (patch)
treebfd2632028a504a196a53e0234ac32fdfe8cdc29 /compiler/rustc_codegen_llvm/src/errors.rs
parentdf6f530ff70decbc8e2ee80f4183e27faf248abe (diff)
parent558796b4600828d5fa731e8a2c9364a282a995d5 (diff)
downloadrust-d776c5a8354208bdce3ef9cc742e248d14c5aefe.tar.gz
rust-d776c5a8354208bdce3ef9cc742e248d14c5aefe.zip
Rollup merge of #144523 - ojeda:rustdoc-target-modifiers, r=GuillaumeGomez
rustdoc: save target modifiers

`rustdoc` was filling a `target_modifiers` variable, but it was not using the result.

In turn, that means that trying to use a dependency that set a target modifier fails.

For instance, running:

```sh
RUSTC_BOOTSTRAP=1 rustc --edition=2024 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null --emit=metadata -Zfixed-x18 --crate-type rlib --crate-name core $(rustc --print sysroot)/lib/rustlib/src/rust/library/core/src/lib.rs

echo '#![allow(internal_features)]
' | RUSTC_BOOTSTRAP=1 rustdoc --edition=2021 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null -Zfixed-x18 --extern core=libcore.rmeta -
```

will fail with:

```text
error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `rust_out`
  |
  = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core`
  = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error
```

Thus save the targets modifiers in `Options` to then pass it to the session options, so that eventually the diff can be performed as expected in `report_incompatible_target_modifiers()`.

Cc: ``@azhogin``
Fixes: https://github.com/rust-lang/rust/issues/144521
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions