1 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
2 --> $DIR/function-references.rs:57:22
4 LL | println!("{:p}", &foo);
7 note: the lint level is defined here
8 --> $DIR/function-references.rs:3:9
10 LL | #![warn(function_item_references)]
11 | ^^^^^^^^^^^^^^^^^^^^^^^^
13 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
14 --> $DIR/function-references.rs:59:20
16 LL | print!("{:p}", &foo);
19 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
20 --> $DIR/function-references.rs:61:21
22 LL | format!("{:p}", &foo);
25 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
26 --> $DIR/function-references.rs:64:22
28 LL | println!("{:p}", &foo as *const _);
31 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
32 --> $DIR/function-references.rs:66:22
34 LL | println!("{:p}", zst_ref);
37 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
38 --> $DIR/function-references.rs:68:22
40 LL | println!("{:p}", cast_zst_ptr);
43 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
44 --> $DIR/function-references.rs:70:22
46 LL | println!("{:p}", coerced_zst_ptr);
49 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
50 --> $DIR/function-references.rs:73:22
52 LL | println!("{:p}", &fn_item);
55 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
56 --> $DIR/function-references.rs:75:22
58 LL | println!("{:p}", indirect_ref);
61 warning: cast `nop` with `as fn()` to obtain a function pointer
62 --> $DIR/function-references.rs:78:22
64 LL | println!("{:p}", &nop);
67 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
68 --> $DIR/function-references.rs:80:22
70 LL | println!("{:p}", &bar);
73 warning: cast `baz` with `as fn(_, _) -> _` to obtain a function pointer
74 --> $DIR/function-references.rs:82:22
76 LL | println!("{:p}", &baz);
79 warning: cast `unsafe_fn` with `as unsafe fn()` to obtain a function pointer
80 --> $DIR/function-references.rs:84:22
82 LL | println!("{:p}", &unsafe_fn);
85 warning: cast `c_fn` with `as extern "C" fn()` to obtain a function pointer
86 --> $DIR/function-references.rs:86:22
88 LL | println!("{:p}", &c_fn);
91 warning: cast `unsafe_c_fn` with `as unsafe extern "C" fn()` to obtain a function pointer
92 --> $DIR/function-references.rs:88:22
94 LL | println!("{:p}", &unsafe_c_fn);
97 warning: cast `variadic` with `as unsafe extern "C" fn(_, ...)` to obtain a function pointer
98 --> $DIR/function-references.rs:90:22
100 LL | println!("{:p}", &variadic);
103 warning: cast `var` with `as fn(_) -> _` to obtain a function pointer
104 --> $DIR/function-references.rs:92:22
106 LL | println!("{:p}", &std::env::var::<String>);
107 | ^^^^^^^^^^^^^^^^^^^^^^^^
109 warning: cast `nop` with `as fn()` to obtain a function pointer
110 --> $DIR/function-references.rs:95:32
112 LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
115 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
116 --> $DIR/function-references.rs:95:38
118 LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
121 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
122 --> $DIR/function-references.rs:95:44
124 LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
127 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
128 --> $DIR/function-references.rs:110:41
130 LL | std::mem::transmute::<_, usize>(&foo);
133 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
134 --> $DIR/function-references.rs:112:50
136 LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
139 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
140 --> $DIR/function-references.rs:112:50
142 LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
145 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
146 --> $DIR/function-references.rs:122:15
148 LL | print_ptr(&bar);
151 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
152 --> $DIR/function-references.rs:124:24
154 LL | bound_by_ptr_trait(&bar);
157 warning: cast `bar` with `as fn(_) -> _` to obtain a function pointer
158 --> $DIR/function-references.rs:126:30
160 LL | bound_by_ptr_trait_tuple((&foo, &bar));
163 warning: cast `foo` with `as fn() -> _` to obtain a function pointer
164 --> $DIR/function-references.rs:126:30
166 LL | bound_by_ptr_trait_tuple((&foo, &bar));
169 warning: 27 warnings emitted