提交 394b8cdf 编写于 作者: O Oliver Scherer

Match on `Symbol` instead of `&str` for type-checking intrinsics.

上级 66fb778a
......@@ -152,10 +152,14 @@
arm_target_feature,
asm,
assert,
assert_inhabited,
assert_uninit_valid,
assert_zero_valid,
associated_consts,
associated_type_bounds,
associated_type_defaults,
associated_types,
assume,
assume_init,
async_await,
async_closure,
......@@ -181,11 +185,14 @@
box_patterns,
box_syntax,
braced_empty_structs,
breakpoint,
bswap,
bitreverse,
C,
caller_location,
cdylib,
ceilf32,
ceilf64,
cfg,
cfg_accessible,
cfg_attr,
......@@ -239,8 +246,14 @@
convert,
Copy,
copy_closures,
copy,
copy_nonoverlapping,
copysignf32,
copysignf64,
core,
core_intrinsics,
cosf32,
cosf64,
count_code_region,
coverage_counter_add,
coverage_counter_subtract,
......@@ -299,6 +312,7 @@
dropck_eyepatch,
dropck_parametricity,
drop_types_in_const,
drop_in_place,
dylib,
dyn_trait,
eh_personality,
......@@ -311,11 +325,16 @@
Eq,
Equal,
enclosing_scope,
exact_div,
except,
exclusive_range_pattern,
exhaustive_integer_patterns,
exhaustive_patterns,
existential_type,
expf32,
expf64,
exp2f32,
exp2f64,
expected,
export_name,
expr,
......@@ -329,6 +348,10 @@
f16c_target_feature,
f32,
f64,
fadd_fast,
fabsf32,
fabsf64,
fdiv_fast,
feature,
ffi_const,
ffi_pure,
......@@ -336,13 +359,21 @@
field,
field_init_shorthand,
file,
float_to_int_unchecked,
floorf64,
floorf32,
fmaf32,
fmaf64,
fmt,
fmt_internals,
fmul_fast,
fn_must_use,
forbid,
forget,
format_args,
format_args_nl,
format_args_capture,
frem_fast,
from,
From,
from_desugaring,
......@@ -352,6 +383,7 @@
from_ok,
from_usize,
from_trait,
fsub_fast,
fundamental,
future,
Future,
......@@ -448,6 +480,12 @@
llvm_asm,
local_inner_macros,
log_syntax,
logf32,
logf64,
log10f32,
log10f64,
log2f32,
log2f64,
loop_break_value,
macro_at_most_once_rep,
macro_escape,
......@@ -475,10 +513,16 @@
message,
meta,
min_align_of,
min_align_of_val,
min_const_fn,
min_const_unsafe_fn,
min_specialization,
minnumf32,
minnumf64,
maxnumf32,
maxnumf64,
mips_target_feature,
miri_start_panic,
mmx_target_feature,
module,
module_path,
......@@ -491,6 +535,8 @@
naked,
naked_functions,
name,
nearbyintf32,
nearbyintf64,
needs_allocator,
needs_drop,
needs_panic_runtime,
......@@ -518,6 +564,7 @@
None,
non_exhaustive,
non_modrs_mods,
nontemporal_store,
nontrapping_fptoint: "nontrapping-fptoint",
noreturn,
no_niche,
......@@ -577,8 +624,16 @@
poll,
Poll,
powerpc_target_feature,
powf32,
powf64,
powif32,
powif64,
precise_pointer_size_matching,
pref_align_of,
prefetch_read_data,
prefetch_read_instruction,
prefetch_write_data,
prefetch_write_instruction,
prelude,
prelude_import,
preserves_flags,
......@@ -640,10 +695,14 @@
Result,
Return,
rhs,
rintf32,
rintf64,
riscv_target_feature,
rlib,
rotate_left,
rotate_right,
roundf32,
roundf64,
rt,
rtm_target_feature,
rust,
......@@ -726,14 +785,19 @@
simd_ffi,
simd_insert,
since,
sinf32,
sinf64,
size,
size_of,
size_of_val,
slice_patterns,
slicing_syntax,
soft,
Some,
specialization,
speed,
sqrtf32,
sqrtf64,
sse4a_target_feature,
stable,
staged_api,
......@@ -787,6 +851,8 @@
transparent_enums,
transparent_unions,
trivial_bounds,
truncf32,
truncf64,
Try,
try_blocks,
try_trait,
......@@ -809,6 +875,8 @@
u32,
u64,
u8,
unaligned_volatile_load,
unaligned_volatile_store,
unboxed_closures,
unchecked_add,
unchecked_div,
......@@ -824,6 +892,7 @@
universal_impl_trait,
unlikely,
unmarked_api,
unreachable,
unreachable_code,
unrestricted_attribute_tokens,
unsafe_block_in_unsafe_fn,
......@@ -843,12 +912,21 @@
val,
var,
variant_count,
va_arg,
va_copy,
va_end,
va_start,
vec,
Vec,
version,
vis,
visible_private_types,
volatile,
volatile_copy_memory,
volatile_copy_nonoverlapping_memory,
volatile_load,
volatile_set_memory,
volatile_store,
warn,
wasm_import_module,
wasm_target_feature,
......@@ -858,6 +936,7 @@
wrapping_add,
wrapping_sub,
wrapping_mul,
write_bytes,
Yield,
}
}
......
......@@ -2063,7 +2063,7 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
ident: Ident,
) -> ty::PolyFnSig<'tcx> {
let unsafety = if abi == abi::Abi::RustIntrinsic {
intrinsic_operation_unsafety(&tcx.item_name(def_id).as_str())
intrinsic_operation_unsafety(tcx.item_name(def_id))
} else {
hir::Unsafety::Unsafe
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册