Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- let x = 0; if (x=1)==() { true } else { false }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- warning: variable `x` is assigned to, but never used
- --> src/main.rs:5:13
- |
- 5 | let x = 0; if (x=1)==() { true } else { false }
- | ^
- |
- = note: #[warn(unused_variables)] on by default
- = note: consider using `_x` instead
- warning: value assigned to `x` is never read
- --> src/main.rs:5:24
- |
- 5 | let x = 0; if (x=1)==() { true } else { false }
- | ^
- |
- = note: #[warn(unused_assignments)] on by default
- error[E0384]: cannot assign twice to immutable variable `x`
- --> src/main.rs:5:23
- |
- 5 | let x = 0; if (x=1)==() { true } else { false }
- | - ^^^^^ cannot assign twice to immutable variable
- | |
- | first assignment to `x`
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0384`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment