]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/function-item-references.stderr
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / lint / function-item-references.stderr
1 warning: taking a reference to a function item does not give a function pointer
2   --> $DIR/function-item-references.rs:44:18
3    |
4 LL |     Pointer::fmt(&zst_ref, f)
5    |                  ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
6    |
7 note: the lint level is defined here
8   --> $DIR/function-item-references.rs:3:9
9    |
10 LL | #![warn(function_item_references)]
11    |         ^^^^^^^^^^^^^^^^^^^^^^^^
12
13 warning: taking a reference to a function item does not give a function pointer
14   --> $DIR/function-item-references.rs:81:22
15    |
16 LL |     println!("{:p}", &foo);
17    |                      ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
18
19 warning: taking a reference to a function item does not give a function pointer
20   --> $DIR/function-item-references.rs:83:20
21    |
22 LL |     print!("{:p}", &foo);
23    |                    ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
24
25 warning: taking a reference to a function item does not give a function pointer
26   --> $DIR/function-item-references.rs:85:21
27    |
28 LL |     format!("{:p}", &foo);
29    |                     ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
30
31 warning: taking a reference to a function item does not give a function pointer
32   --> $DIR/function-item-references.rs:88:22
33    |
34 LL |     println!("{:p}", &foo as *const _);
35    |                      ^^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
36
37 warning: taking a reference to a function item does not give a function pointer
38   --> $DIR/function-item-references.rs:90:22
39    |
40 LL |     println!("{:p}", zst_ref);
41    |                      ^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
42
43 warning: taking a reference to a function item does not give a function pointer
44   --> $DIR/function-item-references.rs:92:22
45    |
46 LL |     println!("{:p}", cast_zst_ptr);
47    |                      ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
48
49 warning: taking a reference to a function item does not give a function pointer
50   --> $DIR/function-item-references.rs:94:22
51    |
52 LL |     println!("{:p}", coerced_zst_ptr);
53    |                      ^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
54
55 warning: taking a reference to a function item does not give a function pointer
56   --> $DIR/function-item-references.rs:97:22
57    |
58 LL |     println!("{:p}", &fn_item);
59    |                      ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
60
61 warning: taking a reference to a function item does not give a function pointer
62   --> $DIR/function-item-references.rs:99:22
63    |
64 LL |     println!("{:p}", indirect_ref);
65    |                      ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
66
67 warning: taking a reference to a function item does not give a function pointer
68   --> $DIR/function-item-references.rs:102:22
69    |
70 LL |     println!("{:p}", &nop);
71    |                      ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()`
72
73 warning: taking a reference to a function item does not give a function pointer
74   --> $DIR/function-item-references.rs:104:22
75    |
76 LL |     println!("{:p}", &bar);
77    |                      ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
78
79 warning: taking a reference to a function item does not give a function pointer
80   --> $DIR/function-item-references.rs:106:22
81    |
82 LL |     println!("{:p}", &baz);
83    |                      ^^^^ help: cast `baz` to obtain a function pointer: `baz as fn(_, _) -> _`
84
85 warning: taking a reference to a function item does not give a function pointer
86   --> $DIR/function-item-references.rs:108:22
87    |
88 LL |     println!("{:p}", &unsafe_fn);
89    |                      ^^^^^^^^^^ help: cast `unsafe_fn` to obtain a function pointer: `unsafe_fn as unsafe fn()`
90
91 warning: taking a reference to a function item does not give a function pointer
92   --> $DIR/function-item-references.rs:110:22
93    |
94 LL |     println!("{:p}", &c_fn);
95    |                      ^^^^^ help: cast `c_fn` to obtain a function pointer: `c_fn as extern "C" fn()`
96
97 warning: taking a reference to a function item does not give a function pointer
98   --> $DIR/function-item-references.rs:112:22
99    |
100 LL |     println!("{:p}", &unsafe_c_fn);
101    |                      ^^^^^^^^^^^^ help: cast `unsafe_c_fn` to obtain a function pointer: `unsafe_c_fn as unsafe extern "C" fn()`
102
103 warning: taking a reference to a function item does not give a function pointer
104   --> $DIR/function-item-references.rs:114:22
105    |
106 LL |     println!("{:p}", &variadic);
107    |                      ^^^^^^^^^ help: cast `variadic` to obtain a function pointer: `variadic as unsafe extern "C" fn(_, ...)`
108
109 warning: taking a reference to a function item does not give a function pointer
110   --> $DIR/function-item-references.rs:116:22
111    |
112 LL |     println!("{:p}", &take_generic_ref::<u32>);
113    |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref::<u32> as fn(_)`
114
115 warning: taking a reference to a function item does not give a function pointer
116   --> $DIR/function-item-references.rs:118:22
117    |
118 LL |     println!("{:p}", &take_generic_array::<u32, 4>);
119    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_array` to obtain a function pointer: `take_generic_array::<u32, 4_usize> as fn(_)`
120
121 warning: taking a reference to a function item does not give a function pointer
122   --> $DIR/function-item-references.rs:120:22
123    |
124 LL |     println!("{:p}", &multiple_generic::<u32, f32>);
125    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic` to obtain a function pointer: `multiple_generic::<u32, f32> as fn(_, _)`
126
127 warning: taking a reference to a function item does not give a function pointer
128   --> $DIR/function-item-references.rs:122:22
129    |
130 LL |     println!("{:p}", &multiple_generic_arrays::<u32, f32, 4, 8>);
131    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic_arrays` to obtain a function pointer: `multiple_generic_arrays::<u32, f32, 4_usize, 8_usize> as fn(_, _)`
132
133 warning: taking a reference to a function item does not give a function pointer
134   --> $DIR/function-item-references.rs:124:22
135    |
136 LL |     println!("{:p}", &std::env::var::<String>);
137    |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `var` to obtain a function pointer: `var::<String> as fn(_) -> _`
138
139 warning: taking a reference to a function item does not give a function pointer
140   --> $DIR/function-item-references.rs:127:32
141    |
142 LL |     println!("{:p} {:p} {:p}", &nop, &foo, &bar);
143    |                                ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()`
144
145 warning: taking a reference to a function item does not give a function pointer
146   --> $DIR/function-item-references.rs:127:38
147    |
148 LL |     println!("{:p} {:p} {:p}", &nop, &foo, &bar);
149    |                                      ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
150
151 warning: taking a reference to a function item does not give a function pointer
152   --> $DIR/function-item-references.rs:127:44
153    |
154 LL |     println!("{:p} {:p} {:p}", &nop, &foo, &bar);
155    |                                            ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
156
157 warning: taking a reference to a function item does not give a function pointer
158   --> $DIR/function-item-references.rs:142:41
159    |
160 LL |         std::mem::transmute::<_, usize>(&foo);
161    |                                         ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
162
163 warning: taking a reference to a function item does not give a function pointer
164   --> $DIR/function-item-references.rs:144:50
165    |
166 LL |         std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
167    |                                                  ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
168
169 warning: taking a reference to a function item does not give a function pointer
170   --> $DIR/function-item-references.rs:144:50
171    |
172 LL |         std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
173    |                                                  ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
174
175 warning: taking a reference to a function item does not give a function pointer
176   --> $DIR/function-item-references.rs:147:41
177    |
178 LL |         std::mem::transmute::<_, usize>(&take_generic_ref::<u32>);
179    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref::<u32> as fn(_)`
180
181 warning: taking a reference to a function item does not give a function pointer
182   --> $DIR/function-item-references.rs:156:15
183    |
184 LL |     print_ptr(&bar);
185    |               ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
186
187 warning: taking a reference to a function item does not give a function pointer
188   --> $DIR/function-item-references.rs:158:24
189    |
190 LL |     bound_by_ptr_trait(&bar);
191    |                        ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
192
193 warning: taking a reference to a function item does not give a function pointer
194   --> $DIR/function-item-references.rs:160:30
195    |
196 LL |     bound_by_ptr_trait_tuple((&foo, &bar));
197    |                              ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
198
199 warning: taking a reference to a function item does not give a function pointer
200   --> $DIR/function-item-references.rs:160:30
201    |
202 LL |     bound_by_ptr_trait_tuple((&foo, &bar));
203    |                              ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
204
205 warning: 33 warnings emitted
206