11error: calling `.type_id()` on `Box<dyn Any>`
2- --> tests/ui/type_id_on_box.rs:39 :13
2+ --> tests/ui/type_id_on_box.rs:31 :13
33 |
44LL | let _ = any_box.type_id();
55 | -------^^^^^^^^^^
@@ -12,37 +12,37 @@ LL | let _ = any_box.type_id();
1212 = help: to override `-D warnings` add `#[allow(clippy::type_id_on_box)]`
1313
1414error: calling `.type_id()` on `Box<dyn Any>`
15- --> tests/ui/type_id_on_box.rs:43 :13
15+ --> tests/ui/type_id_on_box.rs:40 :13
1616 |
17- LL | let _ = any_box.type_id(); // 2 derefs are needed here to get to the `dyn Any`
17+ LL | let _ = any_box.type_id();
1818 | -------^^^^^^^^^^
1919 | |
2020 | help: consider dereferencing first: `(**any_box)`
2121 |
2222 = note: this returns the type id of the literal type `Box<_>` instead of the type id of the boxed value, which is most likely not what you want
2323 = note: if this is intentional, use `TypeId::of::<Box<dyn Any>>()` instead, which makes it more clear
2424
25- error: calling `.type_id()` on `Box<dyn Any >`
26- --> tests/ui/type_id_on_box.rs:49 :13
25+ error: calling `.type_id()` on `Box<dyn AnySubTrait >`
26+ --> tests/ui/type_id_on_box.rs:47 :13
2727 |
2828LL | let _ = b.type_id();
2929 | -^^^^^^^^^^
3030 | |
3131 | help: consider dereferencing first: `(*b)`
3232 |
3333 = note: this returns the type id of the literal type `Box<_>` instead of the type id of the boxed value, which is most likely not what you want
34- = note: if this is intentional, use `TypeId::of::<Box<dyn Any >>()` instead, which makes it more clear
34+ = note: if this is intentional, use `TypeId::of::<Box<dyn AnySubTrait >>()` instead, which makes it more clear
3535
36- error: calling `.type_id()` on `Box<dyn AnySubTrait >`
37- --> tests/ui/type_id_on_box.rs:55 :13
36+ error: calling `.type_id()` on `Box<dyn Any >`
37+ --> tests/ui/type_id_on_box.rs:51 :13
3838 |
39- LL | let _ = b.type_id(); // Lint if calling `type_id` on a `dyn Trait` where `Trait: Any`
39+ LL | let _ = b.type_id();
4040 | -^^^^^^^^^^
4141 | |
4242 | help: consider dereferencing first: `(*b)`
4343 |
4444 = note: this returns the type id of the literal type `Box<_>` instead of the type id of the boxed value, which is most likely not what you want
45- = note: if this is intentional, use `TypeId::of::<Box<dyn AnySubTrait >>()` instead, which makes it more clear
45+ = note: if this is intentional, use `TypeId::of::<Box<dyn Any >>()` instead, which makes it more clear
4646
4747error: aborting due to 4 previous errors
4848
0 commit comments