Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- enum f { A(Box<String>), B(Box<String>, Box<String>) } use std::mem::size_of; (size_of::<f>, size_of::<Option<f>>())
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- warning: type `f` should have an upper camel case name
- --> src/main.rs:6:14
- |
- 6 | enum f { A(Box<String>), B(Box<String>, Box<String>) } use std::mem::size_of; (size_of::<f>, size_of::<Option<f>>())
- | ^ help: convert the identifier to upper camel case: `F`
- |
- = note: #[warn(non_camel_case_types)] on by default
- error[E0277]: `fn() -> usize {std::mem::size_of::<main::f>}` doesn't implement `std::fmt::Debug`
- --> src/main.rs:5:22
- |
- 5 | println!("{:?}", {
- | ______________________^
- 6 | | enum f { A(Box<String>), B(Box<String>, Box<String>) } use std::mem::size_of; (size_of::<f>, size_of::<Option<f>>())
- 7 | | });
- | |_____^ `fn() -> usize {std::mem::size_of::<main::f>}` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
- |
- = help: the trait `std::fmt::Debug` is not implemented for `fn() -> usize {std::mem::size_of::<main::f>}`
- = note: required because of the requirements on the impl of `std::fmt::Debug` for `(fn() -> usize {std::mem::size_of::<main::f>}, usize)`
- = note: required by `std::fmt::Debug::fmt`
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0277`.
- 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