about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_dangling_ptr.stderr
blob: e3bc9b16b0d939c988021af2f6d234a7d69c5558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:7:24
   |
LL |     let _: *const u8 = 1 as *const _;
   |                        ^^^^^^^^^^^^^ help: use: `std::ptr::dangling()`
   |
   = note: `-D clippy::manual-dangling-ptr` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_dangling_ptr)]`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:9:13
   |
LL |     let _ = 2 as *const u32;
   |             ^^^^^^^^^^^^^^^ help: use: `std::ptr::dangling::<u32>()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:11:13
   |
LL |     let _ = 4 as *mut f32;
   |             ^^^^^^^^^^^^^ help: use: `std::ptr::dangling_mut::<f32>()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:14:13
   |
LL |     let _ = mem::align_of::<u8>() as *const u8;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `std::ptr::dangling::<u8>()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:16:13
   |
LL |     let _ = mem::align_of::<u32>() as *const u32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `std::ptr::dangling::<u32>()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:18:13
   |
LL |     let _ = mem::align_of::<usize>() as *const usize;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `std::ptr::dangling::<usize>()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:21:9
   |
LL |     foo(4 as *const _, 4 as *mut _);
   |         ^^^^^^^^^^^^^ help: use: `std::ptr::dangling()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:21:24
   |
LL |     foo(4 as *const _, 4 as *mut _);
   |                        ^^^^^^^^^^^ help: use: `std::ptr::dangling_mut()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:41:9
   |
LL |     foo(4 as *const _, 4 as *mut _);
   |         ^^^^^^^^^^^^^ help: use: `std::ptr::dangling()`

error: manual creation of a dangling pointer
  --> tests/ui/manual_dangling_ptr.rs:41:24
   |
LL |     foo(4 as *const _, 4 as *mut _);
   |                        ^^^^^^^^^^^ help: use: `std::ptr::dangling_mut()`

error: aborting due to 10 previous errors