Skip to content

Commit 27f0c97

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 7e34995 + 824b2bb commit 27f0c97

15 files changed

+307
-191
lines changed

src/librustc_span/symbol.rs

+81
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,
@@ -427,6 +459,7 @@ symbols! {
427459
lhs,
428460
lib,
429461
lifetime,
462+
likely,
430463
line,
431464
link,
432465
linkage,
@@ -442,6 +475,12 @@ symbols! {
442475
llvm_asm,
443476
local_inner_macros,
444477
log_syntax,
478+
logf32,
479+
logf64,
480+
log10f32,
481+
log10f64,
482+
log2f32,
483+
log2f64,
445484
loop_break_value,
446485
macro_at_most_once_rep,
447486
macro_escape,
@@ -469,10 +508,16 @@ symbols! {
469508
message,
470509
meta,
471510
min_align_of,
511+
min_align_of_val,
472512
min_const_fn,
473513
min_const_unsafe_fn,
474514
min_specialization,
515+
minnumf32,
516+
minnumf64,
517+
maxnumf32,
518+
maxnumf64,
475519
mips_target_feature,
520+
miri_start_panic,
476521
mmx_target_feature,
477522
module,
478523
module_path,
@@ -485,6 +530,8 @@ symbols! {
485530
naked,
486531
naked_functions,
487532
name,
533+
nearbyintf32,
534+
nearbyintf64,
488535
needs_allocator,
489536
needs_drop,
490537
needs_panic_runtime,
@@ -512,6 +559,7 @@ symbols! {
512559
None,
513560
non_exhaustive,
514561
non_modrs_mods,
562+
nontemporal_store,
515563
noreturn,
516564
no_niche,
517565
no_sanitize,
@@ -570,8 +618,16 @@ symbols! {
570618
poll,
571619
Poll,
572620
powerpc_target_feature,
621+
powf32,
622+
powf64,
623+
powif32,
624+
powif64,
573625
precise_pointer_size_matching,
574626
pref_align_of,
627+
prefetch_read_data,
628+
prefetch_read_instruction,
629+
prefetch_write_data,
630+
prefetch_write_instruction,
575631
prelude,
576632
prelude_import,
577633
preserves_flags,
@@ -631,10 +687,14 @@ symbols! {
631687
Result,
632688
Return,
633689
rhs,
690+
rintf32,
691+
rintf64,
634692
riscv_target_feature,
635693
rlib,
636694
rotate_left,
637695
rotate_right,
696+
roundf32,
697+
roundf64,
638698
rt,
639699
rtm_target_feature,
640700
rust,
@@ -717,14 +777,19 @@ symbols! {
717777
simd_ffi,
718778
simd_insert,
719779
since,
780+
sinf32,
781+
sinf64,
720782
size,
721783
size_of,
784+
size_of_val,
722785
slice_patterns,
723786
slicing_syntax,
724787
soft,
725788
Some,
726789
specialization,
727790
speed,
791+
sqrtf32,
792+
sqrtf64,
728793
sse4a_target_feature,
729794
stable,
730795
staged_api,
@@ -778,6 +843,8 @@ symbols! {
778843
transparent_enums,
779844
transparent_unions,
780845
trivial_bounds,
846+
truncf32,
847+
truncf64,
781848
Try,
782849
try_blocks,
783850
try_trait,
@@ -800,6 +867,8 @@ symbols! {
800867
u32,
801868
u64,
802869
u8,
870+
unaligned_volatile_load,
871+
unaligned_volatile_store,
803872
unboxed_closures,
804873
unchecked_add,
805874
unchecked_div,
@@ -813,7 +882,9 @@ symbols! {
813882
underscore_lifetimes,
814883
uniform_paths,
815884
universal_impl_trait,
885+
unlikely,
816886
unmarked_api,
887+
unreachable,
817888
unreachable_code,
818889
unrestricted_attribute_tokens,
819890
unsafe_block_in_unsafe_fn,
@@ -833,12 +904,21 @@ symbols! {
833904
val,
834905
var,
835906
variant_count,
907+
va_arg,
908+
va_copy,
909+
va_end,
910+
va_start,
836911
vec,
837912
Vec,
838913
version,
839914
vis,
840915
visible_private_types,
841916
volatile,
917+
volatile_copy_memory,
918+
volatile_copy_nonoverlapping_memory,
919+
volatile_load,
920+
volatile_set_memory,
921+
volatile_store,
842922
warn,
843923
wasm_import_module,
844924
wasm_target_feature,
@@ -848,6 +928,7 @@ symbols! {
848928
wrapping_add,
849929
wrapping_sub,
850930
wrapping_mul,
931+
write_bytes,
851932
Yield,
852933
}
853934
}

0 commit comments

Comments
 (0)