@@ -233,13 +233,17 @@ the default `enum` size and alignment for the target platform's C ABI.
233
233
> really a "best guess". In particular, this may be incorrect when the C code
234
234
> of interest is compiled with certain flags.
235
235
236
- > Warning: There are crucial differences between an ` enum ` in the C language and
237
- > Rust's C-like enumerations with this representation. An ` enum ` in C is
238
- > mostly a ` typedef ` plus some named constants; in other words, an object of an
239
- > ` enum ` type can hold any integer value. For example, this is often used for
240
- > bitflags in ` C ` . In contrast, Rust’s C-like enumerations can only legally hold
241
- > the discriminant values, everything else is undefined behaviour. Therefore,
242
- > using a C-like enumeration in FFI to model a C ` enum ` is often wrong.
236
+ <div class =" warning " >
237
+
238
+ Warning: There are crucial differences between an ` enum ` in the C language and
239
+ Rust's C-like enumerations with this representation. An ` enum ` in C is
240
+ mostly a ` typedef ` plus some named constants; in other words, an object of an
241
+ ` enum ` type can hold any integer value. For example, this is often used for
242
+ bitflags in ` C ` . In contrast, Rust’s C-like enumerations can only legally hold
243
+ the discriminant values, everything else is undefined behaviour. Therefore,
244
+ using a C-like enumeration in FFI to model a C ` enum ` is often wrong.
245
+
246
+ </div >
243
247
244
248
It is an error for [ zero-variant enumerations] to have the ` C ` representation.
245
249
@@ -290,9 +294,13 @@ padding bytes and forcing the alignment of the type to `1`.
290
294
The ` align ` and ` packed ` representations cannot be applied on the same type and
291
295
a ` packed ` type cannot transitively contain another ` align ` ed type.
292
296
293
- > Warning: Dereferencing an unaligned pointer is [ undefined behaviour] and it is
294
- > possible to [ safely create unaligned pointers to ` packed ` fields] [ 27060 ] .
295
- > Like all ways to create undefined behavior in safe Rust, this is a bug.
297
+ <div class =" warning " >
298
+
299
+ *** Warning:*** Dereferencing an unaligned pointer is [ undefined behaviour] and
300
+ it is possible to [ safely create unaligned pointers to ` packed ` fields] [ 27060 ] .
301
+ Like all ways to create undefined behavior in safe Rust, this is a bug.
302
+
303
+ </div >
296
304
297
305
[ `align_of_val` ] : ../std/mem/fn.align_of_val.html
298
306
[ `size_of_val` ] : ../std/mem/fn.size_of_val.html
0 commit comments