diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-15 13:29:26 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-15 13:55:44 -0700 |
| commit | 9ecd1d276732b301fff85a1e660771691db23dbd (patch) | |
| tree | 7a6ad679155adc39b01f8b77962a1e4cc4ae3803 | |
| parent | 9ed463a7404f7f3ecf65ca270f360b2da90b467a (diff) | |
| download | rust-9ecd1d276732b301fff85a1e660771691db23dbd.tar.gz rust-9ecd1d276732b301fff85a1e660771691db23dbd.zip | |
Simplify code
| -rw-r--r-- | src/librustc_typeck/check/demand.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index d92ea7fd49a..677e2ea3566 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -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(); |
