Skip to content

Commit 149a988

Browse files
committed
Auto merge of #4218 - lzutao:rustup, r=phansch
Rustup changelog: none
2 parents 97f8caa + 5e887b2 commit 149a988

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

Diff for: clippy_lints/src/loops.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
736736
}
737737
},
738738
ExprKind::Struct(_, _, None)
739-
| ExprKind::Yield(_)
739+
| ExprKind::Yield(_, _)
740740
| ExprKind::Closure(_, _, _, _, _)
741741
| ExprKind::InlineAsm(_, _, _)
742742
| ExprKind::Path(_)
@@ -1245,7 +1245,12 @@ fn is_len_call(expr: &Expr, var: Name) -> bool {
12451245
false
12461246
}
12471247

1248-
fn is_end_eq_array_len(cx: &LateContext<'_, '_>, end: &Expr, limits: ast::RangeLimits, indexed_ty: Ty<'_>) -> bool {
1248+
fn is_end_eq_array_len<'tcx>(
1249+
cx: &LateContext<'_, 'tcx>,
1250+
end: &Expr,
1251+
limits: ast::RangeLimits,
1252+
indexed_ty: Ty<'tcx>,
1253+
) -> bool {
12491254
if_chain! {
12501255
if let ExprKind::Lit(ref lit) = end.node;
12511256
if let ast::LitKind::Int(end_int, _) = lit.node;
@@ -1982,7 +1987,7 @@ fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr) -> bool {
19821987
match_type(cx, ty, &paths::BTREESET)
19831988
}
19841989

1985-
fn is_iterable_array(ty: Ty<'_>, cx: &LateContext<'_, '_>) -> bool {
1990+
fn is_iterable_array<'tcx>(ty: Ty<'tcx>, cx: &LateContext<'_, 'tcx>) -> bool {
19861991
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
19871992
match ty.sty {
19881993
ty::Array(_, n) => (0..=32).contains(&n.assert_usize(cx.tcx).expect("array length")),

Diff for: clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ fn derefs_to_slice<'a, 'tcx>(
17731773
expr: &'tcx hir::Expr,
17741774
ty: Ty<'tcx>,
17751775
) -> Option<&'tcx hir::Expr> {
1776-
fn may_slice(cx: &LateContext<'_, '_>, ty: Ty<'_>) -> bool {
1776+
fn may_slice<'a>(cx: &LateContext<'_, 'a>, ty: Ty<'a>) -> bool {
17771777
match ty.sty {
17781778
ty::Slice(_) => true,
17791779
ty::Adt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),

Diff for: clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
377377
println!("Closure(ref capture_clause, ref func, _, _, _) = {};", current);
378378
println!(" // unimplemented: `ExprKind::Closure` is not further destructured at the moment");
379379
},
380-
ExprKind::Yield(ref sub) => {
380+
ExprKind::Yield(ref sub, _) => {
381381
let sub_pat = self.next("sub");
382382
println!("Yield(ref sub) = {};", current);
383383
self.current = sub_pat;

Diff for: clippy_lints/src/utils/hir_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
436436
self.hash_expr(&*j);
437437
}
438438
},
439-
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
439+
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e, _) => {
440440
self.hash_expr(e);
441441
},
442442
ExprKind::Call(ref fun, ref args) => {

Diff for: clippy_lints/src/utils/inspector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
227227
println!("{}Closure", ind);
228228
println!("{}clause: {:?}", ind, clause);
229229
},
230-
hir::ExprKind::Yield(ref sub) => {
230+
hir::ExprKind::Yield(ref sub, _) => {
231231
println!("{}Yield", ind);
232232
print_expr(cx, sub, indent + 1);
233233
},

0 commit comments

Comments
 (0)