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"
59
59
tracing-subscriber = { version = " 0.3.3" , features = [" env-filter" , " json" ] }
60
60
num-traits = { version = " 0.2.15" , default-features = false }
61
61
glam = { 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 }
64
63
bytemuck = { version = " 1.23" , features = [" derive" ] }
65
64
66
65
# 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> {
161
161
. insert ( def_id, mode) ;
162
162
}
163
163
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 ( ) {
165
166
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) ;
178
172
}
179
173
}
180
174
You can’t perform that action at this time.
0 commit comments