2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:44:18
2020-09-04 08:45:09 -05:00
|
2020-10-06 16:55:46 -05:00
LL | Pointer::fmt(&zst_ref, f)
2020-10-27 08:00:19 -05:00
| ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-04 08:45:09 -05:00
|
2020-10-06 08:51:10 -05:00
note: the lint level is defined here
2020-10-21 16:19:21 -05:00
--> $DIR/function-item-references.rs:3:9
2020-10-06 08:51:10 -05:00
|
LL | #![warn(function_item_references)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
2020-09-04 08:45:09 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:81:22
2020-10-06 16:55:46 -05:00
|
LL | println!("{:p}", &foo);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-10-06 16:55:46 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:83:20
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | print!("{:p}", &foo);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:85:21
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | format!("{:p}", &foo);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:88:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", &foo as *const _);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:90:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", zst_ref);
2020-10-27 08:00:19 -05:00
| ^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:92:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", cast_zst_ptr);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:94:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", coerced_zst_ptr);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:97:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", &fn_item);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:99:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 08:51:10 -05:00
LL | println!("{:p}", indirect_ref);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:102:22
2020-10-06 08:51:10 -05:00
|
LL | println!("{:p}", &nop);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:104:22
2020-09-04 08:45:09 -05:00
|
LL | println!("{:p}", &bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-09-04 08:45:09 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:106:22
2020-09-04 08:45:09 -05:00
|
LL | println!("{:p}", &baz);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `baz` to obtain a function pointer: `baz as fn(_, _) -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:108:22
2020-09-10 21:53:14 -05:00
|
LL | println!("{:p}", &unsafe_fn);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^ help: cast `unsafe_fn` to obtain a function pointer: `unsafe_fn as unsafe fn()`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:110:22
2020-09-10 21:53:14 -05:00
|
LL | println!("{:p}", &c_fn);
2020-10-27 08:00:19 -05:00
| ^^^^^ help: cast `c_fn` to obtain a function pointer: `c_fn as extern "C" fn()`
2020-09-04 08:45:09 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:112:22
2020-09-10 21:53:14 -05:00
|
LL | println!("{:p}", &unsafe_c_fn);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `unsafe_c_fn` to obtain a function pointer: `unsafe_c_fn as unsafe extern "C" fn()`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:114:22
2020-09-10 21:53:14 -05:00
|
2020-10-06 10:59:14 -05:00
LL | println!("{:p}", &variadic);
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^ help: cast `variadic` to obtain a function pointer: `variadic as unsafe extern "C" fn(_, ...)`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:116:22
|
LL | println!("{:p}", &take_generic_ref::<u32>);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref::<u32> as fn(_)`
warning: taking a reference to a function item does not give a function pointer
--> $DIR/function-item-references.rs:118:22
|
LL | println!("{:p}", &take_generic_array::<u32, 4>);
2022-07-18 18:25:14 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_array` to obtain a function pointer: `take_generic_array::<u32, 4> as fn(_)`
2020-11-01 21:14:21 -06:00
warning: taking a reference to a function item does not give a function pointer
--> $DIR/function-item-references.rs:120:22
|
LL | println!("{:p}", &multiple_generic::<u32, f32>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic` to obtain a function pointer: `multiple_generic::<u32, f32> as fn(_, _)`
warning: taking a reference to a function item does not give a function pointer
--> $DIR/function-item-references.rs:122:22
|
LL | println!("{:p}", &multiple_generic_arrays::<u32, f32, 4, 8>);
2022-07-18 18:25:14 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic_arrays` to obtain a function pointer: `multiple_generic_arrays::<u32, f32, 4, 8> as fn(_, _)`
2020-11-01 21:14:21 -06:00
warning: taking a reference to a function item does not give a function pointer
--> $DIR/function-item-references.rs:124:22
2020-09-10 21:53:14 -05:00
|
LL | println!("{:p}", &std::env::var::<String>);
2020-11-01 21:14:21 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `var` to obtain a function pointer: `var::<String> as fn(_) -> _`
2020-09-10 21:53:14 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:127:32
2020-10-06 08:51:10 -05:00
|
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:127:38
2020-10-06 08:51:10 -05:00
|
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:127:44
2020-10-06 08:51:10 -05:00
|
LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:142:41
2020-09-10 21:53:14 -05:00
|
LL | std::mem::transmute::<_, usize>(&foo);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-09-04 08:45:09 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:144:50
2020-10-06 08:51:10 -05:00
|
LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:144:50
2020-10-06 08:51:10 -05:00
|
LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar));
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:147:41
|
LL | std::mem::transmute::<_, usize>(&take_generic_ref::<u32>);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref::<u32> as fn(_)`
warning: taking a reference to a function item does not give a function pointer
--> $DIR/function-item-references.rs:156:15
2020-10-06 08:51:10 -05:00
|
LL | print_ptr(&bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:158:24
2020-10-06 08:51:10 -05:00
|
LL | bound_by_ptr_trait(&bar);
2020-10-27 08:00:19 -05:00
| ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:160:30
2020-10-06 08:51:10 -05:00
|
LL | bound_by_ptr_trait_tuple((&foo, &bar));
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _`
2020-10-06 08:51:10 -05:00
2020-10-27 08:00:19 -05:00
warning: taking a reference to a function item does not give a function pointer
2020-11-01 21:14:21 -06:00
--> $DIR/function-item-references.rs:160:30
2020-10-06 08:51:10 -05:00
|
LL | bound_by_ptr_trait_tuple((&foo, &bar));
2020-10-27 08:00:19 -05:00
| ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _`
2020-10-06 08:51:10 -05:00
2020-11-01 21:14:21 -06:00
warning: 33 warnings emitted
2020-10-06 08:51:10 -05:00