Skip to content

Commit a6ee46d

Browse files
committed
rustc: Resolve expressions in literal and range patterns
1 parent 71fd542 commit a6ee46d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/rustc/middle/resolve3.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import syntax::ast::{ident, trait_ref, impure_fn, instance_var, item};
1717
import syntax::ast::{item_class, item_const, item_enum, item_fn, item_mac};
1818
import syntax::ast::{item_foreign_mod, item_trait, item_impl, item_mod};
1919
import syntax::ast::{item_ty, local, local_crate, method, node_id, pat};
20-
import syntax::ast::{pat_enum, pat_ident, path, prim_ty, stmt_decl, ty};
20+
import syntax::ast::{pat_enum, pat_ident, pat_lit, pat_range, path, prim_ty};
21+
import syntax::ast::{stmt_decl, ty};
2122
import syntax::ast::{ty_bool, ty_char, ty_constr, ty_f, ty_f32, ty_f64};
2223
import syntax::ast::{ty_float, ty_i, ty_i16, ty_i32, ty_i64, ty_i8, ty_int};
2324
import syntax::ast::{ty_param, ty_path, ty_str, ty_u, ty_u16, ty_u32, ty_u64};
@@ -3640,6 +3641,15 @@ class Resolver {
36403641
}
36413642
}
36423643

3644+
pat_lit(expr) {
3645+
self.resolve_expr(expr, visitor);
3646+
}
3647+
3648+
pat_range(first_expr, last_expr) {
3649+
self.resolve_expr(first_expr, visitor);
3650+
self.resolve_expr(last_expr, visitor);
3651+
}
3652+
36433653
_ {
36443654
// Nothing to do.
36453655
}

0 commit comments

Comments
 (0)