about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-01-29 23:54:15 +0000
committerTrevor Gross <tmgross@umich.edu>2025-02-21 17:37:03 +0000
commit1412cfc987b2b6691367c2e7428c083bb207d722 (patch)
treeb0aeede5a9d9e35ce96464876a36acf2e589ddb4 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent83d70c029860e619f8cb91f15bfc34f7f2d7965f (diff)
downloadrust-1412cfc987b2b6691367c2e7428c083bb207d722.tar.gz
rust-1412cfc987b2b6691367c2e7428c083bb207d722.zip
Inject `compiler_builtins` during postprocessing rather than via AST
`compiler_builtins` is currently injected as `extern crate
compiler_builtins as _`. This has made gating via diagnostics difficult
because it appears in the crate graph as a non-private dependency, and
there isn't an easy way to differentiate between the injected AST and
user-specified `extern crate compiler_builtins`.

Resolve this by injecting `compiler_builtins` during postprocessing
rather than early in the AST. Most of the time this isn't even needed
because it shows up in `std` or `core`'s crate graph, but injection is
still needed to ensure `#![no_core]` works correctly.

A similar change was attempted at [1] but this encountered errors
building `proc_macro` and `rustc-std-workspace-std`. Similar failures
showed up while working on this patch, which were traced back to
`compiler_builtins` showing up in the graph twice (once via dependency
and once via injection). This is resolved by not injecting if a
`#![compiler_builtins]` crate already exists.

[1]: https://github.com/rust-lang/rust/pull/113634
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions