Fix latest nightly breakage

I'm not sure if there are better ways to use the RwLock API, though. But
it seems to work.
This commit is contained in:
Philipp Hansch 2018-04-18 20:25:43 +02:00
parent 0c665f4a31
commit a854874e6a
No known key found for this signature in database
GPG Key ID: B6FA06A6E0E2665B
2 changed files with 3 additions and 3 deletions

View File

@ -1798,7 +1798,7 @@ fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
fn is_iterable_array(ty: Ty) -> bool {
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
match ty.sty {
ty::TyArray(_, n) => (0..=32).contains(n.val.to_raw_bits().expect("array length")),
ty::TyArray(_, n) => (0..=32).contains(&n.val.to_raw_bits().expect("array length")),
_ => false,
}
}

View File

@ -12,7 +12,7 @@ extern crate clippy_lints;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
if let Ok(lint_store) = reg.sess.lint_store.try_borrow() {
reg.sess.lint_store.with_read_lock(|lint_store| {
for (lint, _, _) in lint_store.get_lint_groups() {
if lint == "clippy" {
reg.sess
@ -21,7 +21,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
return;
}
}
}
});
clippy_lints::register_plugins(reg);
}