Skip to content

Commit 9ecd1d2

Browse files
committed
Simplify code
1 parent 9ed463a commit 9ecd1d2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/librustc_typeck/check/demand.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
350350

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

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

0 commit comments

Comments
 (0)