mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
14 lines
497 B
Rust
14 lines
497 B
Rust
// Regression test for <https://github.com/rust-lang/rust/issues/141844>.
|
|
|
|
fn main() {
|
|
// The following expression gets desugared into something like:
|
|
// ```
|
|
// let (lhs,) = x; (let x = 1) = lhs;
|
|
// ```
|
|
// This used to ICE since we haven't yet declared the type for `x` when
|
|
// checking the first desugared statement, whose RHS resolved to `x` since
|
|
// in the AST, the `let` expression was visited first.
|
|
(let x = 1,) = x;
|
|
//~^ ERROR expected expression, found `let` statement
|
|
}
|