You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]: rust-lang#113634
Copy file name to clipboardExpand all lines: tests/ui/extern-flag/empty-extern-arg.stderr
+1-7
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,5 @@ error: unwinding panics are not supported without std
7
7
= help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding
8
8
= note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem
error: `#[panic_handler]` function required, but not found
2
+
3
+
error: unwinding panics are not supported without std
6
4
|
7
-
= note: this error originates in the attribute macro `issue_59191::no_main` (in Nightly builds, run with -Z macro-backtrace for more info)
5
+
= help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding
6
+
= note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem
0 commit comments