File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
crates/rustc_codegen_spirv/src/codegen_cx Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,7 @@ tracing = "0.1"
5959tracing-subscriber = { version = " 0.3.3" , features = [" env-filter" , " json" ] }
6060num-traits = { version = " 0.2.15" , default-features = false }
6161glam = { version = " >=0.22, <=0.30" , default-features = false }
62- # libm 0.2.12 is a breaking change with new intrinsics
63- libm = { version = " >=0.2.5, <=0.2.11" , default-features = false }
62+ libm = { version = " >=0.2.5" , default-features = false }
6463bytemuck = { version = " 1.23" , features = [" derive" ] }
6564
6665# Enable incremental by default in release mode.
Original file line number Diff line number Diff line change @@ -161,20 +161,14 @@ impl<'tcx> CodegenCx<'tcx> {
161161 . insert ( def_id, mode) ;
162162 }
163163
164- if self . tcx . crate_name ( def_id. krate ) == self . sym . libm {
164+ // Check for usage of `libm` intrinsics outside of `libm` itself
165+ if self . tcx . crate_name ( def_id. krate ) == self . sym . libm && !def_id. is_local ( ) {
165166 let item_name = self . tcx . item_name ( def_id) ;
166- let intrinsic = self . sym . libm_intrinsics . get ( & item_name) ;
167- if self . tcx . visibility ( def_id) == ty:: Visibility :: Public {
168- match intrinsic {
169- Some ( & intrinsic) => {
170- self . libm_intrinsics . borrow_mut ( ) . insert ( def_id, intrinsic) ;
171- }
172- None => {
173- self . tcx . dcx ( ) . err ( format ! (
174- "missing libm intrinsic {symbol_name}, which is {instance}"
175- ) ) ;
176- }
177- }
167+ if let Some ( & intrinsic) = self . sym . libm_intrinsics . get ( & item_name) {
168+ self . libm_intrinsics . borrow_mut ( ) . insert ( def_id, intrinsic) ;
169+ } else {
170+ let message = format ! ( "missing libm intrinsic {symbol_name}, which is {instance}" ) ;
171+ self . tcx . dcx ( ) . err ( message) ;
178172 }
179173 }
180174
You can’t perform that action at this time.
0 commit comments