diff options
Diffstat (limited to 'src/tools/clippy/src/docs/transmute_undefined_repr.txt')
-rw-r--r-- | src/tools/clippy/src/docs/transmute_undefined_repr.txt | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/tools/clippy/src/docs/transmute_undefined_repr.txt b/src/tools/clippy/src/docs/transmute_undefined_repr.txt deleted file mode 100644 index 5ee6aaf4c..000000000 --- a/src/tools/clippy/src/docs/transmute_undefined_repr.txt +++ /dev/null @@ -1,22 +0,0 @@ -### What it does -Checks for transmutes between types which do not have a representation defined relative to -each other. - -### Why is this bad? -The results of such a transmute are not defined. - -### Known problems -This lint has had multiple problems in the past and was moved to `nursery`. See issue -[#8496](https://github.com/rust-lang/rust-clippy/issues/8496) for more details. - -### Example -``` -struct Foo<T>(u32, T); -let _ = unsafe { core::mem::transmute::<Foo<u32>, Foo<i32>>(Foo(0u32, 0u32)) }; -``` -Use instead: -``` -#[repr(C)] -struct Foo<T>(u32, T); -let _ = unsafe { core::mem::transmute::<Foo<u32>, Foo<i32>>(Foo(0u32, 0u32)) }; -```
\ No newline at end of file |