Cannot change variable type
examples/variables/cannot-change-type/src/main.rs
fn main() { let mut answer = "What is the answer"; println!("{}", answer); answer = 42; println!("{}", answer); }
error[E0308]: mismatched types --> examples/variables/cannot_change_type.rs:5:14 | 2 | let mut answer = "What is the answer"; | -------------------- expected due to this value ... 5 | answer = 42; | ^^ expected `&str`, found integer error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.