Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- unsafe {std::mem::transmute::<(usize, *mut u8)>(&mut [1u8; 2] as *mut [u8])}
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0107]: wrong number of type arguments: expected 2, found 1
- --> src/main.rs:6:17
- |
- 6 | unsafe {std::mem::transmute::<(usize, *mut u8)>(&mut [1u8; 2] as *mut [u8])}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 type arguments
- error[E0308]: mismatched types
- --> src/main.rs:6:57
- |
- 6 | unsafe {std::mem::transmute::<(usize, *mut u8)>(&mut [1u8; 2] as *mut [u8])}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found *-ptr
- |
- = note: expected type `(usize, *mut u8)`
- found type `*mut [u8]`
- error: aborting due to 2 previous errors
- Some errors occurred: E0107, E0308.
- For more information about an error, try `rustc --explain E0107`.
- 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