Skip to content

Derive the allocator used by tools from rustc's allocator - #160372

Open
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:alloc-bin
Open

Derive the allocator used by tools from rustc's allocator#160372
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:alloc-bin

Conversation

@Zoxc

@Zoxc Zoxc commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

View all comments

This derives the allocator used by tools from rustc's allocator. This simplifies the feature handling a bit and would be a requirement for globally overriding the C allocator on Windows.

The overriding for rustdoc is moved from the library to the binary, which is more of a proper location given that the override must be linked into the binary.

The code in this PR is LLM written.

@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rustbot rustbot added 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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. labels Aug 2, 2026
@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

Comment thread src/tools/miri/src/bin/miri.rs

@folkertdev folkertdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this was LLM-authored and I'm not an expert here, I feel a bit uncomfortable approving it. Who would know this code better?

View changes since this review

Comment thread src/tools/rustdoc/main.rs

use std::process::ExitCode;

rustc_driver::override_c_allocator_in_binary!();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rustc_driver::override_c_allocator_in_binary!();
// Use the same allocator that rustc would use.
rustc_driver::override_c_allocator_in_binary!();

also here

Comment on lines -8 to -16
// A note about jemalloc: rustc uses jemalloc when built for CI and
// distribution. The obvious way to do this is with the `#[global_allocator]`
// mechanism. However, for complicated reasons (see
// https://github.com/rust-lang/rust/pull/81782#issuecomment-784438001 for some
// details) that mechanism doesn't work here. Also, we'd like to use a
// consistent allocator across the rustc <-> llvm boundary, and
// `#[global_allocator]` wouldn't provide that.
//
// Instead, we use a lower-level mechanism, namely the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems a bit unfortunate to throw away these comments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're outdated / wrong. We can use #[global_allocator] and I intend to in follow up work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point about providing a consistent allocator for rustc and LLVM seems to still be true?

Cc @bjorn3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're outdated / wrong. We can use #[global_allocator] and I intend to in follow up work.

Ok. I remember at ~3 attempts to do this in the past and they always ended up with "no, actually global_allocator doesn't work", so I'm curious to see what changed :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have been working since #122362 (unless I'm forgetting something).

The point about providing a consistent allocator for rustc and LLVM seems to still be true?

We want a consistent C allocator generally (for soundness), not just between rustc <-> LLVM. We also want a single allocator to keep memory usage down.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely tried using #[global_allocator] after #122362, but didn't have much success. Let's try again :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you already override the C allocator, overriding #[global_allocator] shouldn't have any perf effect.

#[global_allocator] in rustc_driver should work now that we statically link libstd. But you did still need to link jemalloc from the main executable I think for the C allocator to be overridden.

@@ -0,0 +1,22 @@
/// This macro overrides the C allocator in final binaries by linking jemalloc with the override feature enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This macro overrides the C allocator in final binaries by linking jemalloc with the override feature enabled.
/// This macro overrides the C allocator in final binaries by linking jemalloc with the `override_allocator_on_supported_platforms` feature enabled.

The comments on #[global_allocator] can go here maybe, to motivate why this exists even though we have #[global_allocator].

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2026
@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that in general this change makes sense, because historically we used a different allocator by the tools mostly by accident, rather than explicitly, and we were losing some performance because of that.

Why is it required to override the allocator on Windows, btw?

View changes since this review

Comment thread src/tools/rustdoc/Cargo.toml
Comment thread compiler/rustc_driver_impl/src/allocator.rs
Comment thread src/tools/miri/src/bin/miri.rs
@Zoxc
Zoxc force-pushed the alloc-bin branch 2 times, most recently from 7c6fc1b to 79796b8 Compare August 3, 2026 00:09
@Zoxc

Zoxc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Why is it required to override the allocator on Windows, btw?

Windows doesn't have an official mechanism to override a symbol for the entire program, so instead we need to override it in each dylib / DLL and the binary (at link time) for programs which make use of LLVM / rustc_driver.

@@ -0,0 +1,22 @@
/// This macro overrides the C allocator in final binaries by linking jemalloc with the override feature enabled.

@RalfJung RalfJung Aug 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This macro overrides the C allocator in final binaries by linking jemalloc with the override feature enabled.
/// This macro overrides the C allocator (i.e., `malloc`) in final binaries by linking jemalloc with the override feature enabled.
/// `malloc` is used by `alloc::System` on Unix targets but not Windows targets.

View changes since the review

@folkertdev

Copy link
Copy Markdown
Contributor

r? Kobzol

@rustbot rustbot assigned Kobzol and unassigned folkertdev Aug 3, 2026
@rustbot

rustbot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

@Kobzol

Kobzol commented Aug 3, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue profiles=Check,Debug,Opt,Doc,DocJson,Clippy

@rust-timer

Copy link
Copy Markdown
Collaborator

Error occurred while parsing comment: Cannot parse profiles: Invalid profile: DocJson. Valid values are: check, debug, opt, doc, doc-json, clippy

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 3, 2026
Derive the allocator used by tools from rustc's allocator
@Kobzol

Kobzol commented Aug 3, 2026

Copy link
Copy Markdown
Member

@rust-timer queue profiles=check,debug,opt,doc,doc-json,clippy

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2026
@rust-bors

rust-bors Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 52500f2 (52500f2bbab097fc5e8211286b7bc5202363853f)
Base parent: 7c329d6 (7c329d6c76e11ca40c5673818ab0439c1be8962c)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (52500f2): comparison URL.

Overall result: no relevant changes - BENCHMARK(S) FAILED

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • Job failure

❗ ❗ ❗ ❗ ❗

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.6%, secondary -0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.0% [0.4%, 4.8%] 11
Regressions ❌
(secondary)
0.6% [0.4%, 0.8%] 10
Improvements ✅
(primary)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
-3.0% [-5.4%, -1.2%] 3
All ❌✅ (primary) 0.6% [-3.7%, 4.8%] 12

Cycles

Results (primary 0.1%, secondary -0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 2.1%] 8
Regressions ❌
(secondary)
0.7% [0.4%, 1.3%] 6
Improvements ✅
(primary)
-1.0% [-2.5%, -0.6%] 6
Improvements ✅
(secondary)
-1.3% [-2.6%, -0.5%] 5
All ❌✅ (primary) 0.1% [-2.5%, 2.1%] 14

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 491.018s -> 491.012s (-0.00%)
Artifact size: 390.29 MiB -> 390.29 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2026
@Kobzol

Kobzol commented Aug 3, 2026

Copy link
Copy Markdown
Member

Oops, my bad, second try.

@bors try jobs=dist-x86_64-linux @rust-timer queue profiles=check,debug,opt,doc,doc-json,clippy

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 3, 2026
Derive the allocator used by tools from rustc's allocator


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4403287 (4403287103645d716dd55787ecc442db1dd9a6e3)
Base parent: 7c329d6 (7c329d6c76e11ca40c5673818ab0439c1be8962c)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4403287): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.6%, secondary -0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.6%] 3
Regressions ❌
(secondary)
1.6% [0.4%, 4.6%] 4
Improvements ✅
(primary)
-1.5% [-4.2%, -0.5%] 4
Improvements ✅
(secondary)
-1.0% [-5.3%, -0.4%] 20
All ❌✅ (primary) -0.6% [-4.2%, 0.6%] 7

Cycles

Results (primary -0.4%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 2.2%] 18
Regressions ❌
(secondary)
1.5% [0.4%, 4.8%] 40
Improvements ✅
(primary)
-0.9% [-2.5%, -0.4%] 36
Improvements ✅
(secondary)
-1.1% [-3.8%, -0.4%] 25
All ❌✅ (primary) -0.4% [-2.5%, 2.2%] 54

Binary size

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 491.018s -> 490.844s (-0.04%)
Artifact size: 390.29 MiB -> 391.17 MiB (0.23%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2026
@Kobzol

Kobzol commented Aug 3, 2026

Copy link
Copy Markdown
Member

Okay, perf. looks good, and I went through miri and Clippy and it doesn't seem like this should break them, as they weren't using the feature directly (it was only used by bootstrap). There are still some unresolved comments about modifying the code comments a bit.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args linkage-attr/unreferenced-used-static-issue-127052.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/linkage-attr/unreferenced-used-static-issue-127052.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/linkage-attr/unreferenced-used-static-issue-127052" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args proc-macro/crt-static.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/proc-macro/crt-static.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/crt-static" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--crate-type" "proc-macro" "-Ctarget-feature="
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args proc-macro/no-missing-docs.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/proc-macro/no-missing-docs.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args proc-macro/no-mangle-in-proc-macro-issue-111888.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-mangle-in-proc-macro-issue-111888" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-mangle-in-proc-macro-issue-111888/auxiliary"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args runtime/stdout-before-main.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/runtime/stdout-before-main.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/runtime/stdout-before-main/a" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args rust-2018/proc-macro-crate-in-paths.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rust-2018/proc-macro-crate-in-paths.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

---
To only update this specific test, also pass `--test-args traits/dyn-drop-principal.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/dyn-drop-principal.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/dyn-drop-principal/a" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
libgccjit.so: warning: : ‘retain’ attribute ignored [-Wattributes]
------------------------------------------

Important

For more information how to resolve CI failures of this job, visit this link.

@Zoxc

Zoxc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

I did rewrite the comments a bit.

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

Labels

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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants