Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- fn foo(a: u32) -> u32 { a } let mut m = std::collections::HashMap::new(); m.insert(0, foo); m[0](42)
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0308]: mismatched types
- --> src/main.rs:5:103
- |
- 5 | fn foo(a: u32) -> u32 { a } let mut m = std::collections::HashMap::new(); m.insert(0, foo); m[0](42)
- | ^
- | |
- | expected &{integer}, found integral variable
- | help: consider borrowing here: `&0`
- |
- = note: expected type `&{integer}`
- found type `{integer}`
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0308`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment