Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- fn get_drop_glue<T>() -> unsafe fn (*const u8) { std::mem::transmute(std::ptr::drop_in_place::<T>) }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0591]: can't transmute zero-sized type
- --> src/main.rs:6:58
- |
- 6 | fn get_drop_glue<T>() -> unsafe fn (*const u8) { std::mem::transmute(std::ptr::drop_in_place::<T>) }
- | ^^^^^^^^^^^^^^^^^^^
- |
- = note: source type: unsafe fn(*mut T) {std::ptr::drop_in_place::<T>}
- = note: target type: unsafe fn(*const u8)
- = help: cast with `as` to a pointer instead
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0591`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement