diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-03-06 15:54:44 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-05-16 22:25:08 +0300 |
| commit | aad347c4f781bda18efb3f3cdbaa736e7e458e24 (patch) | |
| tree | 072f9170e2cc437aefddc428c7b11c930054ccc6 /src/librustc_const_eval | |
| parent | 8310de856db8ba78ba3f4c58e3fe6d3d87f2cb4f (diff) | |
| download | rust-aad347c4f781bda18efb3f3cdbaa736e7e458e24.tar.gz rust-aad347c4f781bda18efb3f3cdbaa736e7e458e24.zip | |
Remove hir::Ident
Diffstat (limited to 'src/librustc_const_eval')
| -rw-r--r-- | src/librustc_const_eval/check_match.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index 61d2408d5bf..2fb5d796589 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -240,24 +240,24 @@ fn check_expr(cx: &mut MatchCheckCtxt, ex: &hir::Expr) { fn check_for_bindings_named_the_same_as_variants(cx: &MatchCheckCtxt, pat: &Pat) { pat.walk(|p| { match p.node { - PatKind::Ident(hir::BindByValue(hir::MutImmutable), ident, None) => { + PatKind::Ident(hir::BindByValue(hir::MutImmutable), name, None) => { let pat_ty = cx.tcx.pat_ty(p); if let ty::TyEnum(edef, _) = pat_ty.sty { let def = cx.tcx.def_map.borrow().get(&p.id).map(|d| d.full_def()); if let Some(Def::Local(..)) = def { if edef.variants.iter().any(|variant| - variant.name == ident.node.unhygienic_name + variant.name == name.node.unhygienize() && variant.kind() == VariantKind::Unit ) { let ty_path = cx.tcx.item_path_str(edef.did); let mut err = struct_span_warn!(cx.tcx.sess, p.span, E0170, "pattern binding `{}` is named the same as one \ of the variants of the type `{}`", - ident.node, ty_path); + name.node, ty_path); help!(err, "if you meant to match on a variant, \ consider making the path in the pattern qualified: `{}::{}`", - ty_path, ident.node); + ty_path, name.node); err.emit(); } } |
