Guest User

Untitled

a guest
Jun 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. std::mem::size_of_val::<std::cell::RefCell<dyn std::fmt::Debug>>(std::cell::RefCell::new(10))
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0308]: mismatched types
  11. --> src/main.rs:5:74
  12. |
  13. 5 | std::mem::size_of_val::<std::cell::RefCell<dyn std::fmt::Debug>>(std::cell::RefCell::new(10))
  14. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  15. | |
  16. | expected reference, found struct `std::cell::RefCell`
  17. | help: consider borrowing here: `&std::cell::RefCell::new(10)`
  18. |
  19. = note: expected type `&std::cell::RefCell<std::fmt::Debug>`
  20. found type `std::cell::RefCell<{integer}>`
  21.  
  22. error: aborting due to previous error
  23.  
  24. For more information about this error, try `rustc --explain E0308`.
  25. error: Could not compile `playground`.
  26.  
  27. To learn more, run the command again with --verbose.
  28.  
  29. */
  30.  
  31. /* ~~~~=== stdout ===~~~~
  32.  
  33. */
Add Comment
Please, Sign In to add comment