consider assignments of union field of ManuallyDrop type safe
This commit is contained in:
parent
3d3c8c5e0d
commit
3ac1df8b99
4 changed files with 35 additions and 56 deletions
|
@ -46,7 +46,7 @@ pub enum UnsafetyViolationDetails {
|
|||
UseOfMutableStatic,
|
||||
UseOfExternStatic,
|
||||
DerefOfRawPointer,
|
||||
AssignToNonCopyUnionField,
|
||||
AssignToDroppingUnionField,
|
||||
AccessToUnionField,
|
||||
MutationOfLayoutConstrainedField,
|
||||
BorrowOfLayoutConstrainedField,
|
||||
|
@ -94,8 +94,8 @@ impl UnsafetyViolationDetails {
|
|||
"raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules \
|
||||
and cause data races: all of these are undefined behavior",
|
||||
),
|
||||
AssignToNonCopyUnionField => (
|
||||
"assignment to non-`Copy` union field",
|
||||
AssignToDroppingUnionField => (
|
||||
"assignment to union field that needs dropping",
|
||||
"the previous content of the field will be dropped, which causes undefined \
|
||||
behavior if the field was not properly initialized",
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue