about summary refs log tree commit diff
path: root/src/librustc/traits
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-11 03:00:05 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-15 20:39:27 +0300
commit73dee258c19a6e9e8249a0d7ff1db54014d0c7a1 (patch)
treec8d742151c2b460235059195250a8fb27ef170d0 /src/librustc/traits
parent6cb28b6617e25b74389f1cee2ec0335c2ccfb865 (diff)
downloadrust-73dee258c19a6e9e8249a0d7ff1db54014d0c7a1.tar.gz
rust-73dee258c19a6e9e8249a0d7ff1db54014d0c7a1.zip
hygiene: Remove `Option`s from functions returning `ExpnInfo`
The expansion info is not optional and should always exist
Diffstat (limited to 'src/librustc/traits')
-rw-r--r--src/librustc/traits/error_reporting.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index 83bd5c56040..20568d4709b 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -36,7 +36,7 @@ use errors::{Applicability, DiagnosticBuilder};
 use std::fmt;
 use syntax::ast;
 use syntax::symbol::sym;
-use syntax_pos::{DUMMY_SP, Span, ExpnInfo, ExpnKind};
+use syntax_pos::{DUMMY_SP, Span, ExpnKind};
 
 impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
     pub fn report_fulfillment_errors(&self,
@@ -61,9 +61,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
             // We want to ignore desugarings here: spans are equivalent even
             // if one is the result of a desugaring and the other is not.
             let mut span = error.obligation.cause.span;
-            if let Some(ExpnInfo { kind: ExpnKind::Desugaring(_), def_site, .. })
-                    = span.ctxt().outer_expn_info() {
-                span = def_site;
+            let expn_info = span.ctxt().outer_expn_info();
+            if let ExpnKind::Desugaring(_) = expn_info.kind {
+                span = expn_info.call_site;
             }
 
             error_map.entry(span).or_default().push(