Skip to content

Commit 44a9d84

Browse files
committed
Don't export upstream monomorphizations from compiler-builtins
1 parent 9044e98 commit 44a9d84

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,12 @@ impl<'tcx> TyCtxt<'tcx> {
22722272

22732273
#[inline]
22742274
pub fn local_crate_exports_generics(self) -> bool {
2275+
// compiler-builtins has some special treatment in codegen, which can result in confusing
2276+
// behavior if another crate ends up calling into its monomorphizations.
2277+
// https://github.com/rust-lang/rust/issues/150173
2278+
if self.is_compiler_builtins(LOCAL_CRATE) {
2279+
return false;
2280+
}
22752281
self.crate_types().iter().any(|crate_type| {
22762282
match crate_type {
22772283
CrateType::Executable

0 commit comments

Comments
 (0)