1
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
2
- --> $DIR/function-references.rs:58 :22
1
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
2
+ --> $DIR/function-references.rs:57 :22
3
3
|
4
4
LL | println!("{:p}", &foo);
5
5
| ^^^^
@@ -10,158 +10,158 @@ note: the lint level is defined here
10
10
LL | #![warn(function_item_references)]
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^^
12
12
13
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
14
- --> $DIR/function-references.rs:60 :20
13
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
14
+ --> $DIR/function-references.rs:59 :20
15
15
|
16
16
LL | print!("{:p}", &foo);
17
17
| ^^^^
18
18
19
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
20
- --> $DIR/function-references.rs:62 :21
19
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
20
+ --> $DIR/function-references.rs:61 :21
21
21
|
22
22
LL | format!("{:p}", &foo);
23
23
| ^^^^
24
24
25
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
26
- --> $DIR/function-references.rs:65 :22
25
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
26
+ --> $DIR/function-references.rs:64 :22
27
27
|
28
28
LL | println!("{:p}", &foo as *const _);
29
29
| ^^^^^^^^^^^^^^^^
30
30
31
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
32
- --> $DIR/function-references.rs:67 :22
31
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
32
+ --> $DIR/function-references.rs:66 :22
33
33
|
34
34
LL | println!("{:p}", zst_ref);
35
35
| ^^^^^^^
36
36
37
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
38
- --> $DIR/function-references.rs:69 :22
37
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
38
+ --> $DIR/function-references.rs:68 :22
39
39
|
40
40
LL | println!("{:p}", cast_zst_ptr);
41
41
| ^^^^^^^^^^^^
42
42
43
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
44
- --> $DIR/function-references.rs:71 :22
43
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
44
+ --> $DIR/function-references.rs:70 :22
45
45
|
46
46
LL | println!("{:p}", coerced_zst_ptr);
47
47
| ^^^^^^^^^^^^^^^
48
48
49
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
50
- --> $DIR/function-references.rs:74 :22
49
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
50
+ --> $DIR/function-references.rs:73 :22
51
51
|
52
52
LL | println!("{:p}", &fn_item);
53
53
| ^^^^^^^^
54
54
55
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
56
- --> $DIR/function-references.rs:76 :22
55
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
56
+ --> $DIR/function-references.rs:75 :22
57
57
|
58
58
LL | println!("{:p}", indirect_ref);
59
59
| ^^^^^^^^^^^^
60
60
61
- warning: cast `nop` with `as fn()` to use it as a pointer
62
- --> $DIR/function-references.rs:79 :22
61
+ warning: cast `nop` with `as fn()` to obtain a function pointer
62
+ --> $DIR/function-references.rs:78 :22
63
63
|
64
64
LL | println!("{:p}", &nop);
65
65
| ^^^^
66
66
67
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
68
- --> $DIR/function-references.rs:81 :22
67
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
68
+ --> $DIR/function-references.rs:80 :22
69
69
|
70
70
LL | println!("{:p}", &bar);
71
71
| ^^^^
72
72
73
- warning: cast `baz` with `as fn(_, _) -> _` to use it as a pointer
74
- --> $DIR/function-references.rs:83 :22
73
+ warning: cast `baz` with `as fn(_, _) -> _` to obtain a function pointer
74
+ --> $DIR/function-references.rs:82 :22
75
75
|
76
76
LL | println!("{:p}", &baz);
77
77
| ^^^^
78
78
79
- warning: cast `unsafe_fn` with `as unsafe fn()` to use it as a pointer
80
- --> $DIR/function-references.rs:85 :22
79
+ warning: cast `unsafe_fn` with `as unsafe fn()` to obtain a function pointer
80
+ --> $DIR/function-references.rs:84 :22
81
81
|
82
82
LL | println!("{:p}", &unsafe_fn);
83
83
| ^^^^^^^^^^
84
84
85
- warning: cast `c_fn` with `as extern "C" fn()` to use it as a pointer
86
- --> $DIR/function-references.rs:87 :22
85
+ warning: cast `c_fn` with `as extern "C" fn()` to obtain a function pointer
86
+ --> $DIR/function-references.rs:86 :22
87
87
|
88
88
LL | println!("{:p}", &c_fn);
89
89
| ^^^^^
90
90
91
- warning: cast `unsafe_c_fn` with `as unsafe extern "C" fn()` to use it as a pointer
92
- --> $DIR/function-references.rs:89 :22
91
+ warning: cast `unsafe_c_fn` with `as unsafe extern "C" fn()` to obtain a function pointer
92
+ --> $DIR/function-references.rs:88 :22
93
93
|
94
94
LL | println!("{:p}", &unsafe_c_fn);
95
95
| ^^^^^^^^^^^^
96
96
97
- warning: cast `variadic_fn ` with `as unsafe extern "C" fn(_, ...)` to use it as a pointer
98
- --> $DIR/function-references.rs:91 :22
97
+ warning: cast `variadic ` with `as unsafe extern "C" fn(_, ...)` to obtain a function pointer
98
+ --> $DIR/function-references.rs:90 :22
99
99
|
100
- LL | println!("{:p}", &variadic_fn );
101
- | ^^^^^^^^^^^^
100
+ LL | println!("{:p}", &variadic );
101
+ | ^^^^^^^^^
102
102
103
- warning: cast `var` with `as fn(_) -> _` to use it as a pointer
104
- --> $DIR/function-references.rs:93 :22
103
+ warning: cast `var` with `as fn(_) -> _` to obtain a function pointer
104
+ --> $DIR/function-references.rs:92 :22
105
105
|
106
106
LL | println!("{:p}", &std::env::var::<String>);
107
107
| ^^^^^^^^^^^^^^^^^^^^^^^^
108
108
109
- warning: cast `nop` with `as fn()` to use it as a pointer
110
- --> $DIR/function-references.rs:96 :32
109
+ warning: cast `nop` with `as fn()` to obtain a function pointer
110
+ --> $DIR/function-references.rs:95 :32
111
111
|
112
112
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
113
113
| ^^^^
114
114
115
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
116
- --> $DIR/function-references.rs:96 :38
115
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
116
+ --> $DIR/function-references.rs:95 :38
117
117
|
118
118
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
119
119
| ^^^^
120
120
121
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
122
- --> $DIR/function-references.rs:96 :44
121
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
122
+ --> $DIR/function-references.rs:95 :44
123
123
|
124
124
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
125
125
| ^^^^
126
126
127
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
128
- --> $DIR/function-references.rs:111 :41
127
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
128
+ --> $DIR/function-references.rs:110 :41
129
129
|
130
130
LL | std::mem::transmute::<_, usize>(&foo);
131
131
| ^^^^
132
132
133
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
134
- --> $DIR/function-references.rs:113 :50
133
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
134
+ --> $DIR/function-references.rs:112 :50
135
135
|
136
136
LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
137
137
| ^^^^^^^^^^^^
138
138
139
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
140
- --> $DIR/function-references.rs:113 :50
139
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
140
+ --> $DIR/function-references.rs:112 :50
141
141
|
142
142
LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
143
143
| ^^^^^^^^^^^^
144
144
145
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
146
- --> $DIR/function-references.rs:123 :15
145
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
146
+ --> $DIR/function-references.rs:122 :15
147
147
|
148
148
LL | print_ptr(&bar);
149
149
| ^^^^
150
150
151
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
152
- --> $DIR/function-references.rs:125 :24
151
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
152
+ --> $DIR/function-references.rs:124 :24
153
153
|
154
154
LL | bound_by_ptr_trait(&bar);
155
155
| ^^^^
156
156
157
- warning: cast `bar` with `as fn(_) -> _` to use it as a pointer
158
- --> $DIR/function-references.rs:127 :30
157
+ warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
158
+ --> $DIR/function-references.rs:126 :30
159
159
|
160
160
LL | bound_by_ptr_trait_tuple((&foo, &bar));
161
161
| ^^^^^^^^^^^^
162
162
163
- warning: cast `foo` with `as fn() -> _` to use it as a pointer
164
- --> $DIR/function-references.rs:127 :30
163
+ warning: cast `foo` with `as fn() -> _` to obtain a function pointer
164
+ --> $DIR/function-references.rs:126 :30
165
165
|
166
166
LL | bound_by_ptr_trait_tuple((&foo, &bar));
167
167
| ^^^^^^^^^^^^
0 commit comments