diff options
| author | bors <bors@rust-lang.org> | 2025-03-17 10:43:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-17 10:43:38 +0000 |
| commit | 9c67cecd12d79f1bbc00a74f70e7ef9fff086a5a (patch) | |
| tree | d43ca065385a4b4d3d8f1b70ba5737dbefa2a46d /compiler/rustc_borrowck/src | |
| parent | 9bad8ac498985707f29b0bdc0293cc0457a3ab38 (diff) | |
| parent | 87b87b1966fef82e15a9f9619ee46f5e843cf4c2 (diff) | |
| download | rust-9c67cecd12d79f1bbc00a74f70e7ef9fff086a5a.tar.gz rust-9c67cecd12d79f1bbc00a74f70e7ef9fff086a5a.zip | |
Auto merge of #138595 - jhpratt:rollup-09pvfzu, r=jhpratt
Rollup of 9 pull requests Successful merges: - #136355 (Add `*_value` methods to proc_macro lib) - #137621 (Add std support to cygwin target) - #137793 (Stablize anonymous pipe) - #138341 (std: Mention clone-on-write mutation in Arc<T>) - #138517 (Improve upvar analysis for deref of child capture) - #138584 (Update Rust Foundation links in Readme) - #138586 (Document `#![register_tool]`) - #138590 (Flatten and simplify some control flow 🫓) - #138592 (update change entry for #137147) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 07b3f3477a8..ed95545dea4 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2479,19 +2479,15 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { let body = self.body; for local in body.mut_vars_and_args_iter().filter(|local| !self.used_mut.contains(local)) { let local_decl = &body.local_decls[local]; - let lint_root = match &body.source_scopes[local_decl.source_info.scope].local_data { - ClearCrossCrate::Set(data) => data.lint_root, - _ => continue, + let ClearCrossCrate::Set(SourceScopeLocalData { lint_root, .. }) = + body.source_scopes[local_decl.source_info.scope].local_data + else { + continue; }; // Skip over locals that begin with an underscore or have no name - match self.local_names[local] { - Some(name) => { - if name.as_str().starts_with('_') { - continue; - } - } - None => continue, + if self.local_names[local].is_none_or(|name| name.as_str().starts_with('_')) { + continue; } let span = local_decl.source_info.span; |
