diff options
Diffstat (limited to 'compiler/rustc_monomorphize/src/collector.rs')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 72c1b3fa6e9..bd42505e3a3 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -847,14 +847,13 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { debug!(?source_info); let lint_root = source_info.scope.lint_root(&self.body.source_scopes); debug!(?lint_root); - let lint_root = match lint_root { - Some(lint_root) => lint_root, + let Some(lint_root) = lint_root else { // This happens when the issue is in a function from a foreign crate that // we monomorphized in the current crate. We can't get a `HirId` for things // in other crates. // FIXME: Find out where to report the lint on. Maybe simply crate-level lint root // but correct span? This would make the lint at least accept crate-level lint attributes. - None => return, + return; }; self.tcx.struct_span_lint_hir( LARGE_ASSIGNMENTS, @@ -1256,9 +1255,8 @@ impl<'v> RootCollector<'_, 'v> { /// the return type of `main`. This is not needed when /// the user writes their own `start` manually. fn push_extra_entry_roots(&mut self) { - let main_def_id = match self.entry_fn { - Some((def_id, EntryFnType::Main)) => def_id, - _ => return, + let Some((main_def_id, EntryFnType::Main)) = self.entry_fn else { + return; }; let start_def_id = match self.tcx.lang_items().require(LangItem::Start) { |
