Repository navigation
Fix incorrect use of MaybeUninit::assume_init_mut in flt2dec #76092
Description
Activity
- changed the title
[-]Validity of get_mut on MaybeUninit[/-][+]Validity of get_mut/assume_init_mut on MaybeUninit[/+]on Aug 30, 2020 Besides the float code, there's also the
Readcode doing something similar for allowing reads into uninitialized buffers. However, rust-lang/rfcs#2930 should resolve that I think.danielhenrymantilla commented
on Aug 30, 2020 ContributorMore actionsCould we rename it to validity of
.assume_init_mut()on uninitializedfloat(s)? or&muton uninitialized floats?
Regarding the issue at hand, obviously only
libstdand other internal crates can rely on the internals of therustcit is released with, so technically, we could go ahead with #76047 and "ignore" the FIXME, as long as we have this issue to remind us of fixing that.Doing so is not that bad as when I attempted to tackle #66174, since by now we have initiatives such as the one I suggested there having been implemented in a library crate, using a library version of out references, and we also have the aforementioned RFC getting some progress. So this time, letting the FIXME without fixing it yet is not just a "useless procrastination of the problem", it is a meaningful "wait for the required language feature", I'd say 🙂
The issue is not really specific to floats, it is tight to whether references are allowed to refer to uninitialized data.
So this is basically the rustc side of (a part of) rust-lang/unsafe-code-guidelines#77.
- changed the title
[-]Validity of get_mut/assume_init_mut on MaybeUninit[/-][+]Validity of MaybeUninit::get_mut/assume_init_mut on invalid data[/+]on Aug 30, 2020 So this time, letting the FIXME without fixing it yet is not just a "useless procrastination of the problem", it is a meaningful "wait for the required language feature", I'd say slightly_smiling_face
Agreed for the
Readside. For the float usage, really that code should be converted to raw pointers.Reacted by Daniel Henry-Mantilla- changed the title
[-]Validity of MaybeUninit::get_mut/assume_init_mut on invalid data[/-][+]Fix incorrect use of MaybeUninit::assume_init_mut in standard library[/+]on Sep 2, 2020 - changed the title
[-]Fix incorrect use of MaybeUninit::assume_init_mut in standard library[/-][+]Fix incorrect use of MaybeUninit::assume_init_mut in flt2dec[/+]on Sep 2, 2020 - addedC-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
on Sep 2, 2020 - added a commit that references this issue
on Sep 2, 2020
Creating this issue to track this FIXME note in float formatting:
The issue being mentioned when the fixme was closed without addressing this concern, and the new tracking issue doesn't raise it, so created this so that we can discuss it here and link it to the tracking issue
cc @RalfJung