You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote an if statement with not in it, as if I were in Python, and left in the match statement syntax, and the compiler panicked.
The code was truly a mangled mess:
if not is_command_valid(&arg0) {
false => return Err(String::from("Invalid command ") + &arg0);
}
I would expect this to complain about either syntax or about not not being a known identifier.
Instead, the compiler error was:
src/commands.rs:60:17: 60:33 error: expected `{`, found `is_command_valid`
src/commands.rs:60 if not is_command_valid(&arg0) {
^~~~~~~~~~~~~~~~
src/commands.rs:60:17: 60:33 help: place this code inside a block
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
I wrote an if statement with
not
in it, as if I were in Python, and left in the match statement syntax, and the compiler panicked.The code was truly a mangled mess:
I would expect this to complain about either syntax or about
not
not being a known identifier.Instead, the compiler error was:
The backtrace was:
The text was updated successfully, but these errors were encountered: