1
1
error: 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
3
3
|
4
4
LL | let _ = any_box.type_id();
5
5
| -------^^^^^^^^^^
@@ -12,37 +12,37 @@ LL | let _ = any_box.type_id();
12
12
= help: to override `-D warnings` add `#[allow(clippy::type_id_on_box)]`
13
13
14
14
error: 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
16
16
|
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();
18
18
| -------^^^^^^^^^^
19
19
| |
20
20
| help: consider dereferencing first: `(**any_box)`
21
21
|
22
22
= 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
23
23
= note: if this is intentional, use `TypeId::of::<Box<dyn Any>>()` instead, which makes it more clear
24
24
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
27
27
|
28
28
LL | let _ = b.type_id();
29
29
| -^^^^^^^^^^
30
30
| |
31
31
| help: consider dereferencing first: `(*b)`
32
32
|
33
33
= 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
35
35
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
38
38
|
39
- LL | let _ = b.type_id(); // Lint if calling `type_id` on a `dyn Trait` where `Trait: Any`
39
+ LL | let _ = b.type_id();
40
40
| -^^^^^^^^^^
41
41
| |
42
42
| help: consider dereferencing first: `(*b)`
43
43
|
44
44
= 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
46
46
47
47
error: aborting due to 4 previous errors
48
48
0 commit comments