Skip to content

Compiler suggests using the removed placement syntax #51602

Closed
@mickethespike

Description

@mickethespike

So I'm writing a hangman app in Rust and I get this weird error message. It doesn't make sense since <- isn't even in Rust anymore.

error: expected `{`, found `in`
  --> src/main.rs:8:17
   |
8  |           if line in words {
   |  _________________-^
9  | |             println!("Success");
10 | |         } else {
   | |_________- help: try placing this code inside a block: `{ words <- { println!("Success"); }; }`

error: aborting due to previous error

error: Could not compile `hangman`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions