Skip to content

Commit b3d7b7b

Browse files
committed
update fixmes
1 parent ea800d5 commit b3d7b7b

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

library/core/src/fmt/float.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ fn float_to_decimal_common_exact<T>(
1414
where
1515
T: flt2dec::DecodableFloat,
1616
{
17-
// SAFETY: Possible undefined behavior, see FIXME(#53491)
17+
// SAFETY: Possible undefined behavior, see FIXME(#76092)
1818
unsafe {
1919
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
2020
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
21-
// FIXME(#53491): This is calling `get_mut` on an uninitialized
21+
// FIXME(#76092): This is calling `assume_init_mut` on an uninitialized
2222
// `MaybeUninit` (here and elsewhere in this file). Revisit this once
2323
// we decided whether that is valid or not.
2424
// We can do this only because we are libstd and coupled to the compiler.
@@ -47,12 +47,12 @@ fn float_to_decimal_common_shortest<T>(
4747
where
4848
T: flt2dec::DecodableFloat,
4949
{
50-
// SAFETY: Possible undefined behavior, see FIXME(#53491)
50+
// SAFETY: Possible undefined behavior, see FIXME(#76092)
5151
unsafe {
5252
// enough for f32 and f64
5353
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
5454
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
55-
// FIXME(#53491)
55+
// FIXME(#76092)
5656
let formatted = flt2dec::to_shortest_str(
5757
flt2dec::strategy::grisu::format_shortest,
5858
*num,
@@ -103,11 +103,11 @@ fn float_to_exponential_common_exact<T>(
103103
where
104104
T: flt2dec::DecodableFloat,
105105
{
106-
// SAFETY: Possible undefined behavior, see FIXME(#53491)
106+
// SAFETY: Possible undefined behavior, see FIXME(#76092)
107107
unsafe {
108108
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
109109
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 6]>::uninit();
110-
// FIXME(#53491)
110+
// FIXME(#76092)
111111
let formatted = flt2dec::to_exact_exp_str(
112112
flt2dec::strategy::grisu::format_exact,
113113
*num,
@@ -133,12 +133,12 @@ fn float_to_exponential_common_shortest<T>(
133133
where
134134
T: flt2dec::DecodableFloat,
135135
{
136-
// SAFETY: Possible undefined behavior, see FIXME(#53491)
136+
// SAFETY: Possible undefined behavior, see FIXME(#76092)
137137
unsafe {
138138
// enough for f32 and f64
139139
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
140140
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 6]>::uninit();
141-
// FIXME(#53491)
141+
// FIXME(#76092)
142142
let formatted = flt2dec::to_shortest_exp_str(
143143
flt2dec::strategy::grisu::format_shortest,
144144
*num,

library/core/src/mem/maybe_uninit.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ use crate::mem::ManuallyDrop;
167167
///
168168
/// // For each item in the array, drop if we allocated it.
169169
/// for elem in &mut data[0..data_len] {
170-
/// unsafe { ptr::drop_in_place(elem.
171-
/// ptr()); }
170+
/// unsafe { ptr::drop_in_place(elem.ptr()); }
172171
/// }
173172
/// ```
174173
///
@@ -718,7 +717,7 @@ impl<T> MaybeUninit<T> {
718717
/// {
719718
/// let mut buffer = MaybeUninit::<[u8; 64]>::uninit();
720719
/// reader.read_exact(unsafe { buffer.assume_init_mut() })?;
721-
/// // ^^^^^^^^^^^^^^^^
720+
/// // ^^^^^^^^^^^^^^^^^^^^^^^^
722721
/// // (mutable) reference to uninitialized memory!
723722
/// // This is undefined behavior.
724723
/// Ok(unsafe { buffer.assume_init() })
@@ -739,11 +738,11 @@ impl<T> MaybeUninit<T> {
739738
/// let foo: Foo = unsafe {
740739
/// let mut foo = MaybeUninit::<Foo>::uninit();
741740
/// ptr::write(&mut foo.assume_init_mut().a as *mut u32, 1337);
742-
/// // ^^^^^^^^^^^^^
741+
/// // ^^^^^^^^^^^^^^^^^^^^^
743742
/// // (mutable) reference to uninitialized memory!
744743
/// // This is undefined behavior.
745744
/// ptr::write(&mut foo.assume_init_mut().b as *mut u8, 42);
746-
/// // ^^^^^^^^^^^^^
745+
/// // ^^^^^^^^^^^^^^^^^^^^^
747746
/// // (mutable) reference to uninitialized memory!
748747
/// // This is undefined behavior.
749748
/// foo.assume_init()

library/std/src/io/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949
W: Write,
5050
{
5151
let mut buf = MaybeUninit::<[u8; super::DEFAULT_BUF_SIZE]>::uninit();
52-
// FIXME(#53491): This is calling `get_mut` and `get_ref` on an uninitialized
52+
// FIXME(#76092): This is calling `get_mut` and `get_ref` on an uninitialized
5353
// `MaybeUninit`. Revisit this once we decided whether that is valid or not.
5454
// This is still technically undefined behavior due to creating a reference
5555
// to uninitialized data, but within libstd we can rely on more guarantees

0 commit comments

Comments
 (0)