Skip to content

Commit 987f960

Browse files
committed
Sort safe intrinsic list
1 parent 637b50b commit 987f960

File tree

1 file changed

+62
-58
lines changed

1 file changed

+62
-58
lines changed

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -64,83 +64,87 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
6464
// it's usually worth updating that intrinsic's documentation
6565
// to note that it's safe to call, since
6666
// safe extern fns are otherwise unprecedented.
67-
sym::abort
67+
68+
// tidy-alphabetical-start
69+
| sym::abort
70+
| sym::add_with_overflow
71+
| sym::aggregate_raw_ptr
72+
| sym::align_of
6873
| sym::assert_inhabited
69-
| sym::assert_zero_valid
7074
| sym::assert_mem_uninitialized_valid
75+
| sym::assert_zero_valid
76+
| sym::autodiff
77+
| sym::bitreverse
78+
| sym::black_box
7179
| sym::box_new
7280
| sym::breakpoint
73-
| sym::size_of
74-
| sym::align_of
75-
| sym::needs_drop
81+
| sym::bswap
7682
| sym::caller_location
77-
| sym::add_with_overflow
78-
| sym::sub_with_overflow
79-
| sym::mul_with_overflow
8083
| sym::carrying_mul_add
81-
| sym::wrapping_add
82-
| sym::wrapping_sub
83-
| sym::wrapping_mul
84-
| sym::saturating_add
85-
| sym::saturating_sub
86-
| sym::rotate_left
87-
| sym::rotate_right
88-
| sym::ctpop
84+
| sym::cold_path
85+
| sym::const_eval_select
86+
| sym::contract_check_ensures
87+
| sym::contract_check_requires
88+
| sym::contract_checks
8989
| sym::ctlz
90+
| sym::ctpop
9091
| sym::cttz
91-
| sym::bswap
92-
| sym::bitreverse
93-
| sym::three_way_compare
9492
| sym::discriminant_value
95-
| sym::type_id
96-
| sym::type_id_eq
97-
| sym::select_unpredictable
98-
| sym::cold_path
99-
| sym::ptr_guaranteed_cmp
100-
| sym::minnumf16
101-
| sym::minnumf32
102-
| sym::minnumf64
103-
| sym::minnumf128
104-
| sym::minimumf16
105-
| sym::minimumf32
106-
| sym::minimumf64
107-
| sym::minimumf128
108-
| sym::maxnumf16
109-
| sym::maxnumf32
110-
| sym::maxnumf64
111-
| sym::maxnumf128
93+
| sym::fadd_algebraic
94+
| sym::fdiv_algebraic
95+
| sym::fmul_algebraic
96+
| sym::forget
97+
| sym::frem_algebraic
98+
| sym::fsub_algebraic
99+
| sym::is_val_statically_known
112100
| sym::maximumf16
113101
| sym::maximumf32
114102
| sym::maximumf64
115103
| sym::maximumf128
116-
| sym::rustc_peek
117-
| sym::type_name
118-
| sym::forget
119-
| sym::black_box
120-
| sym::variant_count
121-
| sym::is_val_statically_known
104+
| sym::maxnumf16
105+
| sym::maxnumf32
106+
| sym::maxnumf64
107+
| sym::maxnumf128
108+
| sym::minimumf16
109+
| sym::minimumf32
110+
| sym::minimumf64
111+
| sym::minimumf128
112+
| sym::minnumf16
113+
| sym::minnumf32
114+
| sym::minnumf64
115+
| sym::minnumf128
116+
| sym::mul_with_overflow
117+
| sym::needs_drop
118+
| sym::prefetch_read_data
119+
| sym::prefetch_read_instruction
120+
| sym::prefetch_write_data
121+
| sym::prefetch_write_instruction
122+
| sym::ptr_guaranteed_cmp
122123
| sym::ptr_mask
123-
| sym::aggregate_raw_ptr
124124
| sym::ptr_metadata
125-
| sym::ub_checks
126-
| sym::contract_checks
127-
| sym::contract_check_requires
128-
| sym::contract_check_ensures
129-
| sym::fadd_algebraic
130-
| sym::fsub_algebraic
131-
| sym::fmul_algebraic
132-
| sym::fdiv_algebraic
133-
| sym::frem_algebraic
125+
| sym::rotate_left
126+
| sym::rotate_right
134127
| sym::round_ties_even_f16
135128
| sym::round_ties_even_f32
136129
| sym::round_ties_even_f64
137130
| sym::round_ties_even_f128
138-
| sym::autodiff
139-
| sym::prefetch_read_data
140-
| sym::prefetch_write_data
141-
| sym::prefetch_read_instruction
142-
| sym::prefetch_write_instruction
143-
| sym::const_eval_select => hir::Safety::Safe,
131+
| sym::rustc_peek
132+
| sym::saturating_add
133+
| sym::saturating_sub
134+
| sym::select_unpredictable
135+
| sym::size_of
136+
| sym::sub_with_overflow
137+
| sym::three_way_compare
138+
| sym::type_id
139+
| sym::type_id_eq
140+
| sym::type_name
141+
| sym::ub_checks
142+
| sym::variant_count
143+
| sym::wrapping_add
144+
| sym::wrapping_mul
145+
| sym::wrapping_sub
146+
// tidy-alphabetical-end
147+
=> hir::Safety::Safe,
144148
_ => hir::Safety::Unsafe,
145149
};
146150

0 commit comments

Comments
 (0)