Skip to content

Commit 494deec

Browse files
bors[bot]Veykril
andauthored
Merge #9533
9533: minor: Update list of safe intrinsics r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 parents ff8621b + 13d3928 commit 494deec

File tree

2 files changed

+49
-48
lines changed

2 files changed

+49
-48
lines changed

crates/hir_def/src/item_tree/lower.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -795,42 +795,42 @@ enum GenericsOwner<'a> {
795795

796796
/// Returns `true` if the given intrinsic is unsafe to call, or false otherwise.
797797
fn is_intrinsic_fn_unsafe(name: &Name) -> bool {
798-
// Should be kept in sync with https://github.com/rust-lang/rust/blob/c6e4db620a7d2f569f11dcab627430921ea8aacf/compiler/rustc_typeck/src/check/intrinsic.rs#L68
798+
// Should be kept in sync with https://github.com/rust-lang/rust/blob/0cd0709f19d316c4796fa71c5f52c8612a5f3771/compiler/rustc_typeck/src/check/intrinsic.rs#L72-L105
799799
![
800800
known::abort,
801-
known::min_align_of,
802-
known::needs_drop,
803-
known::caller_location,
804-
known::size_of_val,
805-
known::min_align_of_val,
806801
known::add_with_overflow,
807-
known::sub_with_overflow,
808-
known::mul_with_overflow,
809-
known::wrapping_add,
810-
known::wrapping_sub,
811-
known::wrapping_mul,
812-
known::saturating_add,
813-
known::saturating_sub,
814-
known::rotate_left,
815-
known::rotate_right,
816-
known::ctpop,
802+
known::bitreverse,
803+
known::bswap,
804+
known::caller_location,
817805
known::ctlz,
806+
known::ctpop,
818807
known::cttz,
819-
known::bswap,
820-
known::bitreverse,
821808
known::discriminant_value,
822-
known::type_id,
809+
known::forget,
823810
known::likely,
824-
known::unlikely,
825-
known::ptr_guaranteed_eq,
826-
known::ptr_guaranteed_ne,
811+
known::maxnumf32,
812+
known::maxnumf64,
813+
known::min_align_of,
827814
known::minnumf32,
828815
known::minnumf64,
829-
known::maxnumf32,
816+
known::mul_with_overflow,
817+
known::needs_drop,
818+
known::ptr_guaranteed_eq,
819+
known::ptr_guaranteed_ne,
820+
known::rotate_left,
821+
known::rotate_right,
830822
known::rustc_peek,
831-
known::maxnumf64,
823+
known::saturating_add,
824+
known::saturating_sub,
825+
known::size_of,
826+
known::sub_with_overflow,
827+
known::type_id,
832828
known::type_name,
829+
known::unlikely,
833830
known::variant_count,
831+
known::wrapping_add,
832+
known::wrapping_mul,
833+
known::wrapping_sub,
834834
]
835835
.contains(name)
836836
}

crates/hir_expand/src/name.rs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -249,40 +249,41 @@ pub mod known {
249249
test_case,
250250
// Safe intrinsics
251251
abort,
252-
size_of,
253-
min_align_of,
254-
needs_drop,
255-
caller_location,
256-
size_of_val,
257-
min_align_of_val,
258252
add_with_overflow,
259-
sub_with_overflow,
260-
mul_with_overflow,
261-
wrapping_add,
262-
wrapping_sub,
263-
wrapping_mul,
264-
saturating_add,
265-
saturating_sub,
266-
rotate_left,
267-
rotate_right,
268-
ctpop,
253+
bitreverse,
254+
bswap,
255+
caller_location,
269256
ctlz,
257+
ctpop,
270258
cttz,
271-
bswap,
272-
bitreverse,
273259
discriminant_value,
274-
type_id,
260+
forget,
275261
likely,
276-
unlikely,
277-
ptr_guaranteed_eq,
278-
ptr_guaranteed_ne,
262+
maxnumf32,
263+
maxnumf64,
264+
min_align_of_val,
265+
min_align_of,
279266
minnumf32,
280267
minnumf64,
281-
maxnumf32,
268+
mul_with_overflow,
269+
needs_drop,
270+
ptr_guaranteed_eq,
271+
ptr_guaranteed_ne,
272+
rotate_left,
273+
rotate_right,
282274
rustc_peek,
283-
maxnumf64,
275+
saturating_add,
276+
saturating_sub,
277+
size_of_val,
278+
size_of,
279+
sub_with_overflow,
280+
type_id,
284281
type_name,
282+
unlikely,
285283
variant_count,
284+
wrapping_add,
285+
wrapping_mul,
286+
wrapping_sub,
286287
);
287288

288289
// self/Self cannot be used as an identifier

0 commit comments

Comments
 (0)