Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- let x: i32 = 4; let y: i32 = &x; println!("{:p} {:p} {}", &x, y, y);
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0308]: mismatched types
- --> src/main.rs:5:38
- |
- 5 | let x: i32 = 4; let y: i32 = &x; println!("{:p} {:p} {}", &x, y, y);
- | ^^
- | |
- | expected i32, found &i32
- | help: consider removing the borrow: `x`
- |
- = note: expected type `i32`
- found type `&i32`
- error[E0277]: the trait bound `i32: std::fmt::Pointer` is not satisfied
- --> src/main.rs:5:71
- |
- 5 | let x: i32 = 4; let y: i32 = &x; println!("{:p} {:p} {}", &x, y, y);
- | ^ the trait `std::fmt::Pointer` is not implemented for `i32`
- |
- = note: required by `std::fmt::Pointer::fmt`
- error: aborting due to 2 previous errors
- Some errors occurred: E0277, E0308.
- For more information about an error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment