Skip to content

Commit 8f9ef1c

Browse files
Fix missing_transmute_annotations example
1 parent a456519 commit 8f9ef1c

File tree

1 file changed

+2
-1
lines changed
  • clippy_lints/src/transmute

1 file changed

+2
-1
lines changed

clippy_lints/src/transmute/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,9 @@ declare_clippy_lint! {
437437
/// ### Example
438438
/// ```no_run
439439
/// # unsafe {
440+
/// let mut x: i32 = 0;
440441
/// // Avoid "naked" calls to `transmute()`!
441-
/// let x: i32 = std::mem::transmute([1u16, 2u16]);
442+
/// x = std::mem::transmute([1u16, 2u16]);
442443
///
443444
/// // `first_answers` is intended to transmute a slice of bool to a slice of u8.
444445
/// // But the programmer forgot to index the first element of the outer slice,

0 commit comments

Comments
 (0)