Skip to content

Commit 9645ed6

Browse files
authored
Rollup merge of #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 4abd5fc + 824b2bb commit 9645ed6

15 files changed

+305
-191
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
crate_id,
246259
crate_in_paths,
@@ -296,6 +309,7 @@ symbols! {
296309
dropck_eyepatch,
297310
dropck_parametricity,
298311
drop_types_in_const,
312+
drop_in_place,
299313
dylib,
300314
dyn_trait,
301315
eh_personality,
@@ -308,11 +322,16 @@ symbols! {
308322
Eq,
309323
Equal,
310324
enclosing_scope,
325+
exact_div,
311326
except,
312327
exclusive_range_pattern,
313328
exhaustive_integer_patterns,
314329
exhaustive_patterns,
315330
existential_type,
331+
expf32,
332+
expf64,
333+
exp2f32,
334+
exp2f64,
316335
expected,
317336
export_name,
318337
expr,
@@ -326,19 +345,31 @@ symbols! {
326345
f16c_target_feature,
327346
f32,
328347
f64,
348+
fadd_fast,
349+
fabsf32,
350+
fabsf64,
351+
fdiv_fast,
329352
feature,
330353
ffi_const,
331354
ffi_pure,
332355
ffi_returns_twice,
333356
field,
334357
field_init_shorthand,
335358
file,
359+
float_to_int_unchecked,
360+
floorf64,
361+
floorf32,
362+
fmaf32,
363+
fmaf64,
336364
fmt,
337365
fmt_internals,
366+
fmul_fast,
338367
fn_must_use,
339368
forbid,
369+
forget,
340370
format_args,
341371
format_args_nl,
372+
frem_fast,
342373
from,
343374
From,
344375
from_desugaring,
@@ -348,6 +379,7 @@ symbols! {
348379
from_ok,
349380
from_usize,
350381
from_trait,
382+
fsub_fast,
351383
fundamental,
352384
future,
353385
Future,
@@ -443,6 +475,12 @@ symbols! {
443475
llvm_asm,
444476
local_inner_macros,
445477
log_syntax,
478+
logf32,
479+
logf64,
480+
log10f32,
481+
log10f64,
482+
log2f32,
483+
log2f64,
446484
loop_break_value,
447485
macro_at_most_once_rep,
448486
macro_escape,
@@ -470,10 +508,16 @@ symbols! {
470508
message,
471509
meta,
472510
min_align_of,
511+
min_align_of_val,
473512
min_const_fn,
474513
min_const_unsafe_fn,
475514
min_specialization,
515+
minnumf32,
516+
minnumf64,
517+
maxnumf32,
518+
maxnumf64,
476519
mips_target_feature,
520+
miri_start_panic,
477521
mmx_target_feature,
478522
module,
479523
module_path,
@@ -486,6 +530,8 @@ symbols! {
486530
naked,
487531
naked_functions,
488532
name,
533+
nearbyintf32,
534+
nearbyintf64,
489535
needs_allocator,
490536
needs_drop,
491537
needs_panic_runtime,
@@ -513,6 +559,7 @@ symbols! {
513559
None,
514560
non_exhaustive,
515561
non_modrs_mods,
562+
nontemporal_store,
516563
noreturn,
517564
no_niche,
518565
no_sanitize,
@@ -571,8 +618,16 @@ symbols! {
571618
poll,
572619
Poll,
573620
powerpc_target_feature,
621+
powf32,
622+
powf64,
623+
powif32,
624+
powif64,
574625
precise_pointer_size_matching,
575626
pref_align_of,
627+
prefetch_read_data,
628+
prefetch_read_instruction,
629+
prefetch_write_data,
630+
prefetch_write_instruction,
576631
prelude,
577632
prelude_import,
578633
preserves_flags,
@@ -632,10 +687,14 @@ symbols! {
632687
Result,
633688
Return,
634689
rhs,
690+
rintf32,
691+
rintf64,
635692
riscv_target_feature,
636693
rlib,
637694
rotate_left,
638695
rotate_right,
696+
roundf32,
697+
roundf64,
639698
rt,
640699
rtm_target_feature,
641700
rust,
@@ -718,14 +777,19 @@ symbols! {
718777
simd_ffi,
719778
simd_insert,
720779
since,
780+
sinf32,
781+
sinf64,
721782
size,
722783
size_of,
784+
size_of_val,
723785
slice_patterns,
724786
slicing_syntax,
725787
soft,
726788
Some,
727789
specialization,
728790
speed,
791+
sqrtf32,
792+
sqrtf64,
729793
sse4a_target_feature,
730794
stable,
731795
staged_api,
@@ -779,6 +843,8 @@ symbols! {
779843
transparent_enums,
780844
transparent_unions,
781845
trivial_bounds,
846+
truncf32,
847+
truncf64,
782848
Try,
783849
try_blocks,
784850
try_trait,
@@ -801,6 +867,8 @@ symbols! {
801867
u32,
802868
u64,
803869
u8,
870+
unaligned_volatile_load,
871+
unaligned_volatile_store,
804872
unboxed_closures,
805873
unchecked_add,
806874
unchecked_div,
@@ -816,6 +884,7 @@ symbols! {
816884
universal_impl_trait,
817885
unlikely,
818886
unmarked_api,
887+
unreachable,
819888
unreachable_code,
820889
unrestricted_attribute_tokens,
821890
unsafe_block_in_unsafe_fn,
@@ -835,12 +904,21 @@ symbols! {
835904
val,
836905
var,
837906
variant_count,
907+
va_arg,
908+
va_copy,
909+
va_end,
910+
va_start,
838911
vec,
839912
Vec,
840913
version,
841914
vis,
842915
visible_private_types,
843916
volatile,
917+
volatile_copy_memory,
918+
volatile_copy_nonoverlapping_memory,
919+
volatile_load,
920+
volatile_set_memory,
921+
volatile_store,
844922
warn,
845923
wasm_import_module,
846924
wasm_target_feature,
@@ -850,6 +928,7 @@ symbols! {
850928
wrapping_add,
851929
wrapping_sub,
852930
wrapping_mul,
931+
write_bytes,
853932
Yield,
854933
}
855934
}

0 commit comments

Comments
 (0)