1
Fork 0

Suppress erroneous suggestion

The suggestion to use `let else` with an uninitialized refutable `let`
statement was erroneous: `let else` cannot be used with deferred
initialization.
This commit is contained in:
Alan Egerton 2024-04-12 12:33:03 +01:00
parent ab71ee7a92
commit ddcfb94b84
No known key found for this signature in database
GPG key ID: 7D4C2F6C22122532
6 changed files with 22 additions and 48 deletions

View file

@ -674,6 +674,7 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
if let Some(span) = sp
&& self.tcx.sess.source_map().is_span_accessible(span)
&& interpreted_as_const.is_none()
&& scrut.is_some()
{
let mut bindings = vec![];
pat.each_binding(|name, _, _, _| bindings.push(name));