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