]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #102257 - cjgillot:let-else-lint, r=dingxiangfei2009
authorbors <bors@rust-lang.org>
Mon, 26 Sep 2022 17:17:07 +0000 (17:17 +0000)
committerbors <bors@rust-lang.org>
Mon, 26 Sep 2022 17:17:07 +0000 (17:17 +0000)
Fix lint scoping for let-else.

The scoping for let-else is inconsistent with HIR nesting.  This creates cases, in `ui/let-else/let-else-allow-unused.rs` for instance, where an `allow` lint attribute does not apply to the bindings created by `let-else`.

This PR is an attempt to correct this.

As there is no lint that currently relies on this, the test for this behaviour is https://github.com/rust-lang/rust/pull/101500.

cc `@dingxiangfei2009` as you filed https://github.com/rust-lang/rust/pull/101894


Trivial merge