Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 15, 2019
1 parent 9ed463a commit 9ecd1d2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc_typeck/check/demand.rs
Expand Up @@ -350,11 +350,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

// If the span is from a macro, then it's hard to extract the text
// and make a good suggestion, so don't bother.
let is_desugaring = match sp.desugaring_kind() {
Some(k) => sp.is_desugaring(k),
None => false
};
let is_macro = sp.from_expansion() && !is_desugaring;
let is_macro = sp.from_expansion() && sp.desugaring_kind().is_none();

// `ExprKind::DropTemps` is semantically irrelevant for these suggestions.
let expr = expr.peel_drop_temps();
Expand Down

0 comments on commit 9ecd1d2

Please sign in to comment.