Skip to content

Commit 039a966

Browse files
authored
Rollup merge of rust-lang#73834 - oli-obk:safe_intrinsics, r=ecstatic-morse
Some refactoring around intrinsic type checking So... This PR went a bit overboard. I wanted to make the `rustc_peek` intrinsic safe (cc @ecstatic-morse ), and remembered a long-standing itch of mine. So I made that huge `&str` match for the intrinsic name a match on `Symbol`s (so basically `u32`s). This is unlikely to have a positive perf effect, even if it likely has better codegen (intrinsics are used rarely, mostly once in their wrapper), so it's mostly a consistency thing since other places actually match on the symbol name of the intrinsics.
2 parents 0cd7ff7 + 394b8cd commit 039a966

15 files changed

+307
-193
lines changed

src/librustc_span/symbol.rs

+79
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,14 @@ symbols! {
152152
arm_target_feature,
153153
asm,
154154
assert,
155+
assert_inhabited,
156+
assert_uninit_valid,
157+
assert_zero_valid,
155158
associated_consts,
156159
associated_type_bounds,
157160
associated_type_defaults,
158161
associated_types,
162+
assume,
159163
assume_init,
160164
async_await,
161165
async_closure,
@@ -181,11 +185,14 @@ symbols! {
181185
box_patterns,
182186
box_syntax,
183187
braced_empty_structs,
188+
breakpoint,
184189
bswap,
185190
bitreverse,
186191
C,
187192
caller_location,
188193
cdylib,
194+
ceilf32,
195+
ceilf64,
189196
cfg,
190197
cfg_accessible,
191198
cfg_attr,
@@ -239,8 +246,14 @@ symbols! {
239246
convert,
240247
Copy,
241248
copy_closures,
249+
copy,
250+
copy_nonoverlapping,
251+
copysignf32,
252+
copysignf64,
242253
core,
243254
core_intrinsics,
255+
cosf32,
256+
cosf64,
244257
count_code_region,
245258
coverage_counter_add,
246259
coverage_counter_subtract,
@@ -299,6 +312,7 @@ symbols! {
299312
dropck_eyepatch,
300313
dropck_parametricity,
301314
drop_types_in_const,
315+
drop_in_place,
302316
dylib,
303317
dyn_trait,
304318
eh_personality,
@@ -311,11 +325,16 @@ symbols! {
311325
Eq,
312326
Equal,
313327
enclosing_scope,
328+
exact_div,
314329
except,
315330
exclusive_range_pattern,
316331
exhaustive_integer_patterns,
317332
exhaustive_patterns,
318333
existential_type,
334+
expf32,
335+
expf64,
336+
exp2f32,
337+
exp2f64,
319338
expected,
320339
export_name,
321340
expr,
@@ -329,20 +348,32 @@ symbols! {
329348
f16c_target_feature,
330349
f32,
331350
f64,
351+
fadd_fast,
352+
fabsf32,
353+
fabsf64,
354+
fdiv_fast,
332355
feature,
333356
ffi_const,
334357
ffi_pure,
335358
ffi_returns_twice,
336359
field,
337360
field_init_shorthand,
338361
file,
362+
float_to_int_unchecked,
363+
floorf64,
364+
floorf32,
365+
fmaf32,
366+
fmaf64,
339367
fmt,
340368
fmt_internals,
369+
fmul_fast,
341370
fn_must_use,
342371
forbid,
372+
forget,
343373
format_args,
344374
format_args_nl,
345375
format_args_capture,
376+
frem_fast,
346377
from,
347378
From,
348379
from_desugaring,
@@ -352,6 +383,7 @@ symbols! {
352383
from_ok,
353384
from_usize,
354385
from_trait,
386+
fsub_fast,
355387
fundamental,
356388
future,
357389
Future,
@@ -448,6 +480,12 @@ symbols! {
448480
llvm_asm,
449481
local_inner_macros,
450482
log_syntax,
483+
logf32,
484+
logf64,
485+
log10f32,
486+
log10f64,
487+
log2f32,
488+
log2f64,
451489
loop_break_value,
452490
macro_at_most_once_rep,
453491
macro_escape,
@@ -475,10 +513,16 @@ symbols! {
475513
message,
476514
meta,
477515
min_align_of,
516+
min_align_of_val,
478517
min_const_fn,
479518
min_const_unsafe_fn,
480519
min_specialization,
520+
minnumf32,
521+
minnumf64,
522+
maxnumf32,
523+
maxnumf64,
481524
mips_target_feature,
525+
miri_start_panic,
482526
mmx_target_feature,
483527
module,
484528
module_path,
@@ -491,6 +535,8 @@ symbols! {
491535
naked,
492536
naked_functions,
493537
name,
538+
nearbyintf32,
539+
nearbyintf64,
494540
needs_allocator,
495541
needs_drop,
496542
needs_panic_runtime,
@@ -518,6 +564,7 @@ symbols! {
518564
None,
519565
non_exhaustive,
520566
non_modrs_mods,
567+
nontemporal_store,
521568
nontrapping_fptoint: "nontrapping-fptoint",
522569
noreturn,
523570
no_niche,
@@ -577,8 +624,16 @@ symbols! {
577624
poll,
578625
Poll,
579626
powerpc_target_feature,
627+
powf32,
628+
powf64,
629+
powif32,
630+
powif64,
580631
precise_pointer_size_matching,
581632
pref_align_of,
633+
prefetch_read_data,
634+
prefetch_read_instruction,
635+
prefetch_write_data,
636+
prefetch_write_instruction,
582637
prelude,
583638
prelude_import,
584639
preserves_flags,
@@ -640,10 +695,14 @@ symbols! {
640695
Result,
641696
Return,
642697
rhs,
698+
rintf32,
699+
rintf64,
643700
riscv_target_feature,
644701
rlib,
645702
rotate_left,
646703
rotate_right,
704+
roundf32,
705+
roundf64,
647706
rt,
648707
rtm_target_feature,
649708
rust,
@@ -726,14 +785,19 @@ symbols! {
726785
simd_ffi,
727786
simd_insert,
728787
since,
788+
sinf32,
789+
sinf64,
729790
size,
730791
size_of,
792+
size_of_val,
731793
slice_patterns,
732794
slicing_syntax,
733795
soft,
734796
Some,
735797
specialization,
736798
speed,
799+
sqrtf32,
800+
sqrtf64,
737801
sse4a_target_feature,
738802
stable,
739803
staged_api,
@@ -787,6 +851,8 @@ symbols! {
787851
transparent_enums,
788852
transparent_unions,
789853
trivial_bounds,
854+
truncf32,
855+
truncf64,
790856
Try,
791857
try_blocks,
792858
try_trait,
@@ -809,6 +875,8 @@ symbols! {
809875
u32,
810876
u64,
811877
u8,
878+
unaligned_volatile_load,
879+
unaligned_volatile_store,
812880
unboxed_closures,
813881
unchecked_add,
814882
unchecked_div,
@@ -824,6 +892,7 @@ symbols! {
824892
universal_impl_trait,
825893
unlikely,
826894
unmarked_api,
895+
unreachable,
827896
unreachable_code,
828897
unrestricted_attribute_tokens,
829898
unsafe_block_in_unsafe_fn,
@@ -843,12 +912,21 @@ symbols! {
843912
val,
844913
var,
845914
variant_count,
915+
va_arg,
916+
va_copy,
917+
va_end,
918+
va_start,
846919
vec,
847920
Vec,
848921
version,
849922
vis,
850923
visible_private_types,
851924
volatile,
925+
volatile_copy_memory,
926+
volatile_copy_nonoverlapping_memory,
927+
volatile_load,
928+
volatile_set_memory,
929+
volatile_store,
852930
warn,
853931
wasm_import_module,
854932
wasm_target_feature,
@@ -858,6 +936,7 @@ symbols! {
858936
wrapping_add,
859937
wrapping_sub,
860938
wrapping_mul,
939+
write_bytes,
861940
Yield,
862941
}
863942
}

0 commit comments

Comments
 (0)