Skip to content

Commit 1b5696f

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 127b3ba + 824b2bb commit 1b5696f

15 files changed

+305
-191
lines changed

src/librustc_span/symbol.rs

Lines changed: 79 additions & 0 deletions
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,
@@ -444,6 +476,12 @@ symbols! {
444476
llvm_asm,
445477
local_inner_macros,
446478
log_syntax,
479+
logf32,
480+
logf64,
481+
log10f32,
482+
log10f64,
483+
log2f32,
484+
log2f64,
447485
loop_break_value,
448486
macro_at_most_once_rep,
449487
macro_escape,
@@ -471,10 +509,16 @@ symbols! {
471509
message,
472510
meta,
473511
min_align_of,
512+
min_align_of_val,
474513
min_const_fn,
475514
min_const_unsafe_fn,
476515
min_specialization,
516+
minnumf32,
517+
minnumf64,
518+
maxnumf32,
519+
maxnumf64,
477520
mips_target_feature,
521+
miri_start_panic,
478522
mmx_target_feature,
479523
module,
480524
module_path,
@@ -487,6 +531,8 @@ symbols! {
487531
naked,
488532
naked_functions,
489533
name,
534+
nearbyintf32,
535+
nearbyintf64,
490536
needs_allocator,
491537
needs_drop,
492538
needs_panic_runtime,
@@ -514,6 +560,7 @@ symbols! {
514560
None,
515561
non_exhaustive,
516562
non_modrs_mods,
563+
nontemporal_store,
517564
noreturn,
518565
no_niche,
519566
no_sanitize,
@@ -572,8 +619,16 @@ symbols! {
572619
poll,
573620
Poll,
574621
powerpc_target_feature,
622+
powf32,
623+
powf64,
624+
powif32,
625+
powif64,
575626
precise_pointer_size_matching,
576627
pref_align_of,
628+
prefetch_read_data,
629+
prefetch_read_instruction,
630+
prefetch_write_data,
631+
prefetch_write_instruction,
577632
prelude,
578633
prelude_import,
579634
preserves_flags,
@@ -635,10 +690,14 @@ symbols! {
635690
Result,
636691
Return,
637692
rhs,
693+
rintf32,
694+
rintf64,
638695
riscv_target_feature,
639696
rlib,
640697
rotate_left,
641698
rotate_right,
699+
roundf32,
700+
roundf64,
642701
rt,
643702
rtm_target_feature,
644703
rust,
@@ -721,14 +780,19 @@ symbols! {
721780
simd_ffi,
722781
simd_insert,
723782
since,
783+
sinf32,
784+
sinf64,
724785
size,
725786
size_of,
787+
size_of_val,
726788
slice_patterns,
727789
slicing_syntax,
728790
soft,
729791
Some,
730792
specialization,
731793
speed,
794+
sqrtf32,
795+
sqrtf64,
732796
sse4a_target_feature,
733797
stable,
734798
staged_api,
@@ -782,6 +846,8 @@ symbols! {
782846
transparent_enums,
783847
transparent_unions,
784848
trivial_bounds,
849+
truncf32,
850+
truncf64,
785851
Try,
786852
try_blocks,
787853
try_trait,
@@ -804,6 +870,8 @@ symbols! {
804870
u32,
805871
u64,
806872
u8,
873+
unaligned_volatile_load,
874+
unaligned_volatile_store,
807875
unboxed_closures,
808876
unchecked_add,
809877
unchecked_div,
@@ -819,6 +887,7 @@ symbols! {
819887
universal_impl_trait,
820888
unlikely,
821889
unmarked_api,
890+
unreachable,
822891
unreachable_code,
823892
unrestricted_attribute_tokens,
824893
unsafe_block_in_unsafe_fn,
@@ -838,12 +907,21 @@ symbols! {
838907
val,
839908
var,
840909
variant_count,
910+
va_arg,
911+
va_copy,
912+
va_end,
913+
va_start,
841914
vec,
842915
Vec,
843916
version,
844917
vis,
845918
visible_private_types,
846919
volatile,
920+
volatile_copy_memory,
921+
volatile_copy_nonoverlapping_memory,
922+
volatile_load,
923+
volatile_set_memory,
924+
volatile_store,
847925
warn,
848926
wasm_import_module,
849927
wasm_target_feature,
@@ -853,6 +931,7 @@ symbols! {
853931
wrapping_add,
854932
wrapping_sub,
855933
wrapping_mul,
934+
write_bytes,
856935
Yield,
857936
}
858937
}

0 commit comments

Comments
 (0)