Make is_from_for_desugar sound (rust/28973 got fixed)

This commit is contained in:
Manish Goregaokar 2015-10-17 04:33:05 +05:30
parent e24d469849
commit 853368c1d3

View File

@ -164,11 +164,7 @@ pub fn is_from_for_desugar(decl: &Decl) -> bool {
[
let DeclLocal(ref loc) = decl.node,
let Some(ref expr) = loc.init,
// FIXME: This should check for MatchSource::ForLoop
// but right now there's a bug where the match source isn't
// set during lowering
// https://github.com/rust-lang/rust/pull/28973
let ExprMatch(_, _, _) = expr.node
let ExprMatch(_, _, MatchSource::ForLoopDesugar) = expr.node
],
{ return true; }
};