Skip to content

Commit a854874

Browse files
committed
Fix latest nightly breakage
I'm not sure if there are better ways to use the RwLock API, though. But it seems to work.
1 parent 0c665f4 commit a854874

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/loops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
17981798
fn is_iterable_array(ty: Ty) -> bool {
17991799
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
18001800
match ty.sty {
1801-
ty::TyArray(_, n) => (0..=32).contains(n.val.to_raw_bits().expect("array length")),
1801+
ty::TyArray(_, n) => (0..=32).contains(&n.val.to_raw_bits().expect("array length")),
18021802
_ => false,
18031803
}
18041804
}

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern crate clippy_lints;
1212

1313
#[plugin_registrar]
1414
pub fn plugin_registrar(reg: &mut Registry) {
15-
if let Ok(lint_store) = reg.sess.lint_store.try_borrow() {
15+
reg.sess.lint_store.with_read_lock(|lint_store| {
1616
for (lint, _, _) in lint_store.get_lint_groups() {
1717
if lint == "clippy" {
1818
reg.sess
@@ -21,7 +21,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
2121
return;
2222
}
2323
}
24-
}
24+
});
2525

2626
clippy_lints::register_plugins(reg);
2727
}

0 commit comments

Comments
 (0)