Remove fixme for if let in lints and replace with unreachable!()

This commit is contained in:
Manish Goregaokar 2015-08-04 07:47:21 +05:30
parent 1809748dc1
commit 2d01e969f1

View file

@ -202,10 +202,12 @@ impl LintPass for UnrootedPass {
// We need not check arms individually since enum/struct fields are already // We need not check arms individually since enum/struct fields are already
// linted in `check_struct_def` and `check_variant` // linted in `check_struct_def` and `check_variant`
// (so there is no way of destructuring out a `#[must_root]` field) // (so there is no way of destructuring out a `#[must_root]` field)
ast::ExprMatch(ref e, _, _) | ast::ExprMatch(ref e, _, _) => &**e,
// For loops allow you to bind a return value locally // These are able to bind local variables, but are desugared into
ast::ExprForLoop(_, ref e, _, _) => &**e, // loops and matches pre-lint so should not be encountered
// XXXManishearth look into `if let` once it lands in our rustc ast::ExprForLoop(..) => unreachable!(),
ast::ExprIfLet(..) => unreachable!(),
ast::ExprWhileLet(..) => unreachable!(),
_ => return _ => return
}, },
_ => return _ => return