diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/vtable_address_comparisons.txt | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/tools/clippy/src/docs/vtable_address_comparisons.txt b/src/tools/clippy/src/docs/vtable_address_comparisons.txt deleted file mode 100644 index 4a34e4ba7..000000000 --- a/src/tools/clippy/src/docs/vtable_address_comparisons.txt +++ /dev/null @@ -1,17 +0,0 @@ -### What it does -Checks for comparisons with an address of a trait vtable. - -### Why is this bad? -Comparing trait objects pointers compares an vtable addresses which -are not guaranteed to be unique and could vary between different code generation units. -Furthermore vtables for different types could have the same address after being merged -together. - -### Example -``` -let a: Rc<dyn Trait> = ... -let b: Rc<dyn Trait> = ... -if Rc::ptr_eq(&a, &b) { - ... -} -```
\ No newline at end of file |