diff options
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/thir.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/thir/visit.rs | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index 821f8c99704..84f5f3a4611 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -640,7 +640,6 @@ impl<'tcx> Pat<'tcx> { | Range(..) | Binding { subpattern: None, .. } | Constant { .. } - | NamedConstant { .. } | Error(_) => {} AscribeUserType { subpattern, .. } | Binding { subpattern: Some(subpattern), .. } @@ -787,12 +786,8 @@ pub enum PatKind<'tcx> { /// * `String`, if `string_deref_patterns` is enabled. Constant { value: mir::Const<'tcx>, - }, - - /// Same as `Constant`, but that came from a `const` that we can point at in diagnostics. - NamedConstant { - value: mir::Const<'tcx>, - span: Span, + /// The `const` item this constant came from, if any. + opt_def: Option<DefId>, }, /// Inline constant found while lowering a pattern. diff --git a/compiler/rustc_middle/src/thir/visit.rs b/compiler/rustc_middle/src/thir/visit.rs index 759ed77dbcb..92c0add65ba 100644 --- a/compiler/rustc_middle/src/thir/visit.rs +++ b/compiler/rustc_middle/src/thir/visit.rs @@ -246,7 +246,7 @@ pub fn walk_pat<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>( visitor.visit_pat(&subpattern.pattern); } } - Constant { value: _ } | NamedConstant { value: _, span: _ } => {} + Constant { value: _, opt_def: _ } => {} InlineConstant { def: _, subpattern } => visitor.visit_pat(subpattern), Range(_) => {} Slice { prefix, slice, suffix } | Array { prefix, slice, suffix } => { |
