| error: direct cast of function item into an integer | |
| --> $DIR/function_casts_as_integer.rs:15:17 | |
| | | |
| LL | let x = foo as usize; | |
| | ^^^^^^^^ | |
| | | |
| note: the lint level is defined here | |
| --> $DIR/function_casts_as_integer.rs:3:9 | |
| | | |
| LL | #![deny(function_casts_as_integer)] | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| help: first cast to a pointer `as *const ()` | |
| | | |
| LL | let x = foo as *const () as usize; | |
| | ++++++++++++ | |
| error: direct cast of function item into an integer | |
| --> $DIR/function_casts_as_integer.rs:16:25 | |
| | | |
| LL | let x = String::len as usize; | |
| | ^^^^^^^^ | |
| | | |
| help: first cast to a pointer `as *const ()` | |
| | | |
| LL | let x = String::len as *const () as usize; | |
| | ++++++++++++ | |
| error: direct cast of function item into an integer | |
| --> $DIR/function_casts_as_integer.rs:17:29 | |
| | | |
| LL | let x = MyEnum::Variant as usize; | |
| | ^^^^^^^^ | |
| | | |
| help: first cast to a pointer `as *const ()` | |
| | | |
| LL | let x = MyEnum::Variant as *const () as usize; | |
| | ++++++++++++ | |
| error: direct cast of function item into an integer | |
| --> $DIR/function_casts_as_integer.rs:18:22 | |
| | | |
| LL | let x = MyStruct as usize; | |
| | ^^^^^^^^ | |
| | | |
| help: first cast to a pointer `as *const ()` | |
| | | |
| LL | let x = MyStruct as *const () as usize; | |
| | ++++++++++++ | |
| error: aborting due to 4 previous errors | |