From 7c5bc204fa8cbfdbfe3a560aa3a3acc3b44ca116 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sat, 8 May 2021 09:02:22 +0800 Subject: [PATCH] Address comments --- compiler/rustc_middle/src/middle/stability.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs index 1bb427d8a675..aa0f18846d15 100644 --- a/compiler/rustc_middle/src/middle/stability.rs +++ b/compiler/rustc_middle/src/middle/stability.rs @@ -306,10 +306,7 @@ impl<'tcx> TyCtxt<'tcx> { let path = &with_no_trimmed_paths(|| self.def_path_str(def_id)); let kind = self.def_kind(def_id).descr(def_id); let (message, lint) = deprecation_message(&depr_entry.attr, kind, path); - let span = match method_span { - None => span, - Some(method_span) => method_span, - }; + let span = method_span.unwrap_or(span); late_report_deprecation( self, &message,