@@ -120,8 +120,8 @@ impl LateLintPass for CopyAndPaste {
120120 }
121121
122122 let ( conds, blocks) = if_sequence ( expr) ;
123- lint_same_then_else ( cx, blocks. as_slice ( ) ) ;
124- lint_same_cond ( cx, conds. as_slice ( ) ) ;
123+ lint_same_then_else ( cx, & blocks) ;
124+ lint_same_cond ( cx, & conds) ;
125125 lint_match_arms ( cx, expr) ;
126126 }
127127 }
@@ -219,8 +219,8 @@ fn lint_match_arms(cx: &LateContext, expr: &Expr) {
219219/// Eg. would return `([a, b], [c, d, e])` for the expression
220220/// `if a { c } else if b { d } else { e }`.
221221fn if_sequence ( mut expr : & Expr ) -> ( SmallVector < & Expr > , SmallVector < & Block > ) {
222- let mut conds = SmallVector :: zero ( ) ;
223- let mut blocks = SmallVector :: zero ( ) ;
222+ let mut conds = SmallVector :: new ( ) ;
223+ let mut blocks = SmallVector :: new ( ) ;
224224
225225 while let ExprIf ( ref cond, ref then_block, ref else_expr) = expr. node {
226226 conds. push ( & * * cond) ;
@@ -256,7 +256,7 @@ fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap<Interned
256256 }
257257 PatKind :: Binding ( _, ref ident, ref as_pat) => {
258258 if let Entry :: Vacant ( v) = map. entry ( ident. node . as_str ( ) ) {
259- v. insert ( cx. tcx . pat_ty ( pat) ) ;
259+ v. insert ( cx. tcx . tables ( ) . pat_ty ( pat) ) ;
260260 }
261261 if let Some ( ref as_pat) = * as_pat {
262262 bindings_impl ( cx, as_pat, map) ;
0 commit comments