]> git.lizzy.rs Git - rust.git/blob - src/test/ui/transmute/transmute-from-fn-item-types-error.stderr
Revert "Change error count messages"
[rust.git] / src / test / ui / transmute / transmute-from-fn-item-types-error.stderr
1 error[E0512]: transmute called with types of different sizes
2   --> $DIR/transmute-from-fn-item-types-error.rs:19:13
3    |
4 19 |     let i = mem::transmute(bar);
5    |             ^^^^^^^^^^^^^^
6    |
7    = note: source type: unsafe fn() {bar} (0 bits)
8    = note: target type: i32 (32 bits)
9
10 error[E0591]: can't transmute zero-sized type
11   --> $DIR/transmute-from-fn-item-types-error.rs:23:13
12    |
13 23 |     let p = mem::transmute(foo);
14    |             ^^^^^^^^^^^^^^
15    |
16    = note: source type: unsafe fn() -> (i32, *const (), std::option::Option<fn()>) {foo}
17    = note: target type: *const ()
18    = help: cast with `as` to a pointer instead
19
20 error[E0591]: can't transmute zero-sized type
21   --> $DIR/transmute-from-fn-item-types-error.rs:27:14
22    |
23 27 |     let of = mem::transmute(main);
24    |              ^^^^^^^^^^^^^^
25    |
26    = note: source type: fn() {main}
27    = note: target type: std::option::Option<fn()>
28    = help: cast with `as` to a pointer instead
29
30 error[E0512]: transmute called with types of different sizes
31   --> $DIR/transmute-from-fn-item-types-error.rs:36:5
32    |
33 36 |     mem::transmute::<_, u8>(main);
34    |     ^^^^^^^^^^^^^^^^^^^^^^^
35    |
36    = note: source type: fn() {main} (0 bits)
37    = note: target type: u8 (8 bits)
38
39 error[E0591]: can't transmute zero-sized type
40   --> $DIR/transmute-from-fn-item-types-error.rs:40:5
41    |
42 40 |     mem::transmute::<_, *mut ()>(foo);
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44    |
45    = note: source type: unsafe fn() -> (i32, *const (), std::option::Option<fn()>) {foo}
46    = note: target type: *mut ()
47    = help: cast with `as` to a pointer instead
48
49 error[E0591]: can't transmute zero-sized type
50   --> $DIR/transmute-from-fn-item-types-error.rs:44:5
51    |
52 44 |     mem::transmute::<_, fn()>(bar);
53    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
54    |
55    = note: source type: unsafe fn() {bar}
56    = note: target type: fn()
57    = help: cast with `as` to a pointer instead
58
59 error[E0512]: transmute called with types of different sizes
60   --> $DIR/transmute-from-fn-item-types-error.rs:49:5
61    |
62 49 |     mem::transmute::<fn(), u32>(main);
63    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
64    |
65    = note: source type: fn() (64 bits)
66    = note: target type: u32 (32 bits)
67
68 error[E0591]: can't transmute zero-sized type
69   --> $DIR/transmute-from-fn-item-types-error.rs:53:5
70    |
71 53 |     mem::transmute::<_, *mut ()>(Some(foo));
72    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73    |
74    = note: source type: unsafe fn() -> (i32, *const (), std::option::Option<fn()>) {foo}
75    = note: target type: *mut ()
76    = help: cast with `as` to a pointer instead
77
78 error[E0591]: can't transmute zero-sized type
79   --> $DIR/transmute-from-fn-item-types-error.rs:57:5
80    |
81 57 |     mem::transmute::<_, fn()>(Some(bar));
82    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
83    |
84    = note: source type: unsafe fn() {bar}
85    = note: target type: fn()
86    = help: cast with `as` to a pointer instead
87
88 error[E0591]: can't transmute zero-sized type
89   --> $DIR/transmute-from-fn-item-types-error.rs:61:5
90    |
91 61 |     mem::transmute::<_, Option<fn()>>(Some(baz));
92    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93    |
94    = note: source type: unsafe fn() {baz}
95    = note: target type: std::option::Option<fn()>
96    = help: cast with `as` to a pointer instead
97
98 error[E0512]: transmute called with types of different sizes
99   --> $DIR/transmute-from-fn-item-types-error.rs:66:5
100    |
101 66 |     mem::transmute::<Option<fn()>, u32>(Some(main));
102    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103    |
104    = note: source type: std::option::Option<fn()> (64 bits)
105    = note: target type: u32 (32 bits)
106
107 error: aborting due to previous error(s)
108