aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-08-04 14:38:31 -0600
committerbors-servo <metajack+bors@gmail.com>2015-08-04 14:38:31 -0600
commitb7e592443f56f3ca61e12c9e777c55ac2a3ebcd0 (patch)
tree157d48e77c09fc6b6d58db02e3b76b9c0691a0a6
parent56d3426431d98a6f43698f33bb7ce4d3ad67adeb (diff)
parent2d01e969f14a52d5565f7254d10f315464f56fcb (diff)
downloadservo-b7e592443f56f3ca61e12c9e777c55ac2a3ebcd0.tar.gz
servo-b7e592443f56f3ca61e12c9e777c55ac2a3ebcd0.zip
Auto merge of #6945 - Manishearth:fixedme, r=jdm
If let is not an issue for lints r? @Ms2ger <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6945) <!-- Reviewable:end -->
-rw-r--r--components/plugins/lints/unrooted_must_root.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs
index f07ed506fbd..dc116f311eb 100644
--- a/components/plugins/lints/unrooted_must_root.rs
+++ b/components/plugins/lints/unrooted_must_root.rs
@@ -202,10 +202,12 @@ impl LintPass for UnrootedPass {
// We need not check arms individually since enum/struct fields are already
// linted in `check_struct_def` and `check_variant`
// (so there is no way of destructuring out a `#[must_root]` field)
- ast::ExprMatch(ref e, _, _) |
- // For loops allow you to bind a return value locally
- ast::ExprForLoop(_, ref e, _, _) => &**e,
- // XXXManishearth look into `if let` once it lands in our rustc
+ ast::ExprMatch(ref e, _, _) => &**e,
+ // These are able to bind local variables, but are desugared into
+ // loops and matches pre-lint so should not be encountered
+ ast::ExprForLoop(..) => unreachable!(),
+ ast::ExprIfLet(..) => unreachable!(),
+ ast::ExprWhileLet(..) => unreachable!(),
_ => return
},
_ => return