-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macros exported by compiler_builtins should not be in the prelude #113533
Labels
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Comments
Amanieu
added a commit
to Amanieu/rustc-builtins
that referenced
this issue
Jul 10, 2023
This was causing build failures on AArch64 due to name resolution ambiguity.
Amanieu
added a commit
to Amanieu/rustc-builtins
that referenced
this issue
Jul 10, 2023
This was causing build failures on AArch64 due to name resolution ambiguity.
The prelude for #![feature(prelude_import)]
#![no_std]
#[prelude_import]
use core::prelude::rust_2021::*;
#[macro_use]
extern crate core;
#[macro_use]
extern crate compiler_builtins; The
|
In #113557 I changed this to: // No #[macro_use]
extern crate compiler_builtins as _; The API of compiler-builtins is not stable and should not be exposed in the prelude. It's only needed there because compiler_builtins is required at link-time. |
Amanieu
added a commit
to Amanieu/rust
that referenced
this issue
Jul 12, 2023
This is an alternative to rust-lang#113557 which removes `compiler_builtins` from the prelude and injects it during crate resolution instead. Fixes rust-lang#113533
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jul 16, 2023
…chenkov Hide `compiler_builtins` in the prelude This crate is a private implementation detail. We only need to insert it into the crate graph for linking and should not expose any of its public API. Fixes rust-lang#113533
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
compiler_builtins exports some macros for use by its tests, but rustc seems to make these available to any code as if they were part of the prelude. While compiler_builtins should be fixed to not export these, it is also strange that the prelude includes these macros.
The text was updated successfully, but these errors were encountered: