Skip to content

Commit e495e24

Browse files
committed
Add some track_caller info to precondition panics
1 parent 414482f commit e495e24

File tree

77 files changed

+178
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+178
-216
lines changed

library/core/src/alloc/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl Layout {
126126
#[rustc_const_stable(feature = "const_alloc_layout_unchecked", since = "1.36.0")]
127127
#[must_use]
128128
#[inline]
129+
#[track_caller]
129130
pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self {
130131
assert_unsafe_precondition!(
131132
check_library_ub,

library/core/src/ascii/ascii_char.rs

+1
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ impl AsciiChar {
503503
/// something useful. It might be tightened before stabilization.)
504504
#[unstable(feature = "ascii_char", issue = "110998")]
505505
#[inline]
506+
#[track_caller]
506507
pub const unsafe fn digit_unchecked(d: u8) -> Self {
507508
assert_unsafe_precondition!(
508509
check_language_ub,

library/core/src/char/convert.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
2222
#[inline]
2323
#[must_use]
2424
#[allow(unnecessary_transmutes)]
25+
#[track_caller]
2526
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
2627
// SAFETY: the caller must guarantee that `i` is a valid char value.
2728
unsafe {

library/core/src/hint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ use crate::{intrinsics, ub_checks};
9898
#[inline]
9999
#[stable(feature = "unreachable", since = "1.27.0")]
100100
#[rustc_const_stable(feature = "const_unreachable_unchecked", since = "1.57.0")]
101-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
101+
#[track_caller]
102102
pub const unsafe fn unreachable_unchecked() -> ! {
103103
ub_checks::assert_unsafe_precondition!(
104104
check_language_ub,

library/core/src/intrinsics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,7 @@ pub const fn three_way_compare<T: Copy>(lhs: T, rhss: T) -> crate::cmp::Ordering
26352635
#[rustc_const_unstable(feature = "disjoint_bitor", issue = "135758")]
26362636
#[rustc_nounwind]
26372637
#[rustc_intrinsic]
2638-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
2638+
#[track_caller]
26392639
#[miri::intrinsic_fallback_is_spec] // the fallbacks all `assume` to tell Miri
26402640
pub const unsafe fn disjoint_bitor<T: ~const fallback::DisjointBitOr>(a: T, b: T) -> T {
26412641
// SAFETY: same preconditions as this function.
@@ -3690,7 +3690,7 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(ptr: *const
36903690
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
36913691
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
36923692
#[inline(always)]
3693-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3693+
#[track_caller]
36943694
#[rustc_diagnostic_item = "ptr_copy_nonoverlapping"]
36953695
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
36963696
#[rustc_intrinsic_const_stable_indirect]
@@ -3793,7 +3793,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
37933793
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
37943794
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
37953795
#[inline(always)]
3796-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3796+
#[track_caller]
37973797
#[rustc_diagnostic_item = "ptr_copy"]
37983798
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
37993799
#[rustc_intrinsic_const_stable_indirect]
@@ -3873,7 +3873,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
38733873
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
38743874
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
38753875
#[inline(always)]
3876-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3876+
#[track_caller]
38773877
#[rustc_diagnostic_item = "ptr_write_bytes"]
38783878
pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
38793879
#[rustc_intrinsic_const_stable_indirect]

library/core/src/num/int_macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ macro_rules! int_impl {
555555
#[must_use = "this returns the result of the operation, \
556556
without modifying the original"]
557557
#[inline(always)]
558-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
558+
#[track_caller]
559559
pub const unsafe fn unchecked_add(self, rhs: Self) -> Self {
560560
assert_unsafe_precondition!(
561561
check_language_ub,
@@ -705,7 +705,7 @@ macro_rules! int_impl {
705705
#[must_use = "this returns the result of the operation, \
706706
without modifying the original"]
707707
#[inline(always)]
708-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
708+
#[track_caller]
709709
pub const unsafe fn unchecked_sub(self, rhs: Self) -> Self {
710710
assert_unsafe_precondition!(
711711
check_language_ub,
@@ -855,7 +855,7 @@ macro_rules! int_impl {
855855
#[must_use = "this returns the result of the operation, \
856856
without modifying the original"]
857857
#[inline(always)]
858-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
858+
#[track_caller]
859859
pub const unsafe fn unchecked_mul(self, rhs: Self) -> Self {
860860
assert_unsafe_precondition!(
861861
check_language_ub,
@@ -1199,7 +1199,7 @@ macro_rules! int_impl {
11991199
#[must_use = "this returns the result of the operation, \
12001200
without modifying the original"]
12011201
#[inline(always)]
1202-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1202+
#[track_caller]
12031203
pub const unsafe fn unchecked_neg(self) -> Self {
12041204
assert_unsafe_precondition!(
12051205
check_language_ub,
@@ -1327,7 +1327,7 @@ macro_rules! int_impl {
13271327
#[must_use = "this returns the result of the operation, \
13281328
without modifying the original"]
13291329
#[inline(always)]
1330-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1330+
#[track_caller]
13311331
pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self {
13321332
assert_unsafe_precondition!(
13331333
check_language_ub,
@@ -1448,7 +1448,7 @@ macro_rules! int_impl {
14481448
#[must_use = "this returns the result of the operation, \
14491449
without modifying the original"]
14501450
#[inline(always)]
1451-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1451+
#[track_caller]
14521452
pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self {
14531453
assert_unsafe_precondition!(
14541454
check_language_ub,

library/core/src/num/nonzero.rs

+2
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ where
388388
#[rustc_const_stable(feature = "nonzero", since = "1.28.0")]
389389
#[must_use]
390390
#[inline]
391+
#[track_caller]
391392
pub const unsafe fn new_unchecked(n: T) -> Self {
392393
match Self::new(n) {
393394
Some(n) => n,
@@ -428,6 +429,7 @@ where
428429
#[unstable(feature = "nonzero_from_mut", issue = "106290")]
429430
#[must_use]
430431
#[inline]
432+
#[track_caller]
431433
pub unsafe fn from_mut_unchecked(n: &mut T) -> &mut Self {
432434
match Self::from_mut(n) {
433435
Some(n) => n,

library/core/src/num/uint_macros.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ macro_rules! uint_impl {
601601
#[must_use = "this returns the result of the operation, \
602602
without modifying the original"]
603603
#[inline(always)]
604-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
604+
#[track_caller]
605605
pub const unsafe fn unchecked_add(self, rhs: Self) -> Self {
606606
assert_unsafe_precondition!(
607607
check_language_ub,
@@ -791,7 +791,7 @@ macro_rules! uint_impl {
791791
#[must_use = "this returns the result of the operation, \
792792
without modifying the original"]
793793
#[inline(always)]
794-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
794+
#[track_caller]
795795
pub const unsafe fn unchecked_sub(self, rhs: Self) -> Self {
796796
assert_unsafe_precondition!(
797797
check_language_ub,
@@ -974,7 +974,7 @@ macro_rules! uint_impl {
974974
#[must_use = "this returns the result of the operation, \
975975
without modifying the original"]
976976
#[inline(always)]
977-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
977+
#[track_caller]
978978
pub const unsafe fn unchecked_mul(self, rhs: Self) -> Self {
979979
assert_unsafe_precondition!(
980980
check_language_ub,
@@ -1588,7 +1588,7 @@ macro_rules! uint_impl {
15881588
#[must_use = "this returns the result of the operation, \
15891589
without modifying the original"]
15901590
#[inline(always)]
1591-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1591+
#[track_caller]
15921592
pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self {
15931593
assert_unsafe_precondition!(
15941594
check_language_ub,
@@ -1709,7 +1709,7 @@ macro_rules! uint_impl {
17091709
#[must_use = "this returns the result of the operation, \
17101710
without modifying the original"]
17111711
#[inline(always)]
1712-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1712+
#[track_caller]
17131713
pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self {
17141714
assert_unsafe_precondition!(
17151715
check_language_ub,

library/core/src/ops/index_range.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl IndexRange {
1919
/// # Safety
2020
/// - `start <= end`
2121
#[inline]
22+
#[track_caller]
2223
pub(crate) const unsafe fn new_unchecked(start: usize, end: usize) -> Self {
2324
ub_checks::assert_unsafe_precondition!(
2425
check_library_ub,

library/core/src/ptr/alignment.rs

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl Alignment {
7373
/// It must *not* be zero.
7474
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
7575
#[inline]
76+
#[track_caller]
7677
pub const unsafe fn new_unchecked(align: usize) -> Self {
7778
assert_unsafe_precondition!(
7879
check_language_ub,

library/core/src/ptr/const_ptr.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl<T: ?Sized> *const T {
416416
#[must_use = "returns a new pointer rather than modifying its argument"]
417417
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
418418
#[inline(always)]
419-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
419+
#[track_caller]
420420
pub const unsafe fn offset(self, count: isize) -> *const T
421421
where
422422
T: Sized,
@@ -469,7 +469,7 @@ impl<T: ?Sized> *const T {
469469
#[inline(always)]
470470
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
471471
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
472-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
472+
#[track_caller]
473473
pub const unsafe fn byte_offset(self, count: isize) -> Self {
474474
// SAFETY: the caller must uphold the safety contract for `offset`.
475475
unsafe { self.cast::<u8>().offset(count).with_metadata_of(self) }
@@ -768,7 +768,7 @@ impl<T: ?Sized> *const T {
768768
#[stable(feature = "ptr_sub_ptr", since = "1.87.0")]
769769
#[rustc_const_stable(feature = "const_ptr_sub_ptr", since = "1.87.0")]
770770
#[inline]
771-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
771+
#[track_caller]
772772
pub const unsafe fn offset_from_unsigned(self, origin: *const T) -> usize
773773
where
774774
T: Sized,
@@ -813,7 +813,7 @@ impl<T: ?Sized> *const T {
813813
#[stable(feature = "ptr_sub_ptr", since = "1.87.0")]
814814
#[rustc_const_stable(feature = "const_ptr_sub_ptr", since = "1.87.0")]
815815
#[inline]
816-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
816+
#[track_caller]
817817
pub const unsafe fn byte_offset_from_unsigned<U: ?Sized>(self, origin: *const U) -> usize {
818818
// SAFETY: the caller must uphold the safety contract for `offset_from_unsigned`.
819819
unsafe { self.cast::<u8>().offset_from_unsigned(origin.cast::<u8>()) }
@@ -927,7 +927,7 @@ impl<T: ?Sized> *const T {
927927
#[must_use = "returns a new pointer rather than modifying its argument"]
928928
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
929929
#[inline(always)]
930-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
930+
#[track_caller]
931931
pub const unsafe fn add(self, count: usize) -> Self
932932
where
933933
T: Sized,
@@ -979,7 +979,7 @@ impl<T: ?Sized> *const T {
979979
#[inline(always)]
980980
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
981981
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
982-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
982+
#[track_caller]
983983
pub const unsafe fn byte_add(self, count: usize) -> Self {
984984
// SAFETY: the caller must uphold the safety contract for `add`.
985985
unsafe { self.cast::<u8>().add(count).with_metadata_of(self) }
@@ -1033,7 +1033,7 @@ impl<T: ?Sized> *const T {
10331033
#[must_use = "returns a new pointer rather than modifying its argument"]
10341034
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
10351035
#[inline(always)]
1036-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1036+
#[track_caller]
10371037
pub const unsafe fn sub(self, count: usize) -> Self
10381038
where
10391039
T: Sized,
@@ -1091,7 +1091,7 @@ impl<T: ?Sized> *const T {
10911091
#[inline(always)]
10921092
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
10931093
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1094-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1094+
#[track_caller]
10951095
pub const unsafe fn byte_sub(self, count: usize) -> Self {
10961096
// SAFETY: the caller must uphold the safety contract for `sub`.
10971097
unsafe { self.cast::<u8>().sub(count).with_metadata_of(self) }
@@ -1264,7 +1264,7 @@ impl<T: ?Sized> *const T {
12641264
#[stable(feature = "pointer_methods", since = "1.26.0")]
12651265
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
12661266
#[inline]
1267-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1267+
#[track_caller]
12681268
pub const unsafe fn read(self) -> T
12691269
where
12701270
T: Sized,
@@ -1285,7 +1285,7 @@ impl<T: ?Sized> *const T {
12851285
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
12861286
#[stable(feature = "pointer_methods", since = "1.26.0")]
12871287
#[inline]
1288-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1288+
#[track_caller]
12891289
pub unsafe fn read_volatile(self) -> T
12901290
where
12911291
T: Sized,
@@ -1305,7 +1305,7 @@ impl<T: ?Sized> *const T {
13051305
#[stable(feature = "pointer_methods", since = "1.26.0")]
13061306
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
13071307
#[inline]
1308-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1308+
#[track_caller]
13091309
pub const unsafe fn read_unaligned(self) -> T
13101310
where
13111311
T: Sized,
@@ -1325,7 +1325,7 @@ impl<T: ?Sized> *const T {
13251325
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
13261326
#[stable(feature = "pointer_methods", since = "1.26.0")]
13271327
#[inline]
1328-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1328+
#[track_caller]
13291329
pub const unsafe fn copy_to(self, dest: *mut T, count: usize)
13301330
where
13311331
T: Sized,
@@ -1345,7 +1345,7 @@ impl<T: ?Sized> *const T {
13451345
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
13461346
#[stable(feature = "pointer_methods", since = "1.26.0")]
13471347
#[inline]
1348-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1348+
#[track_caller]
13491349
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)
13501350
where
13511351
T: Sized,

library/core/src/ptr/mod.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) {
11041104
#[rustc_const_stable(feature = "const_swap_nonoverlapping", since = "1.88.0")]
11051105
#[rustc_diagnostic_item = "ptr_swap_nonoverlapping"]
11061106
#[rustc_allow_const_fn_unstable(const_eval_select)] // both implementations behave the same
1107+
#[track_caller]
11071108
pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
11081109
ub_checks::assert_unsafe_precondition!(
11091110
check_library_ub,
@@ -1284,6 +1285,7 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, bytes: NonZero<usize
12841285
#[stable(feature = "rust1", since = "1.0.0")]
12851286
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
12861287
#[rustc_diagnostic_item = "ptr_replace"]
1288+
#[track_caller]
12871289
pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
12881290
// SAFETY: the caller must guarantee that `dst` is valid to be
12891291
// cast to a mutable reference (valid for writes, aligned, initialized),
@@ -1411,7 +1413,7 @@ pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
14111413
#[inline]
14121414
#[stable(feature = "rust1", since = "1.0.0")]
14131415
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
1414-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1416+
#[track_caller]
14151417
#[rustc_diagnostic_item = "ptr_read"]
14161418
pub const unsafe fn read<T>(src: *const T) -> T {
14171419
// It would be semantically correct to implement this via `copy_nonoverlapping`
@@ -1529,7 +1531,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
15291531
#[inline]
15301532
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
15311533
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
1532-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1534+
#[track_caller]
15331535
#[rustc_diagnostic_item = "ptr_read_unaligned"]
15341536
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
15351537
let mut tmp = MaybeUninit::<T>::uninit();
@@ -1628,7 +1630,7 @@ pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
16281630
#[stable(feature = "rust1", since = "1.0.0")]
16291631
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
16301632
#[rustc_diagnostic_item = "ptr_write"]
1631-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1633+
#[track_caller]
16321634
pub const unsafe fn write<T>(dst: *mut T, src: T) {
16331635
// Semantically, it would be fine for this to be implemented as a
16341636
// `copy_nonoverlapping` and appropriate drop suppression of `src`.
@@ -1732,7 +1734,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
17321734
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
17331735
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
17341736
#[rustc_diagnostic_item = "ptr_write_unaligned"]
1735-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1737+
#[track_caller]
17361738
pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
17371739
// SAFETY: the caller must guarantee that `dst` is valid for writes.
17381740
// `dst` cannot overlap `src` because the caller has mutable access
@@ -1806,7 +1808,7 @@ pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
18061808
/// ```
18071809
#[inline]
18081810
#[stable(feature = "volatile", since = "1.9.0")]
1809-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1811+
#[track_caller]
18101812
#[rustc_diagnostic_item = "ptr_read_volatile"]
18111813
pub unsafe fn read_volatile<T>(src: *const T) -> T {
18121814
// SAFETY: the caller must uphold the safety contract for `volatile_load`.
@@ -1887,7 +1889,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
18871889
#[inline]
18881890
#[stable(feature = "volatile", since = "1.9.0")]
18891891
#[rustc_diagnostic_item = "ptr_write_volatile"]
1890-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
1892+
#[track_caller]
18911893
pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
18921894
// SAFETY: the caller must uphold the safety contract for `volatile_store`.
18931895
unsafe {

0 commit comments

Comments
 (0)