diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2024-12-12 10:37:37 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-01-29 15:45:13 +0000 |
| commit | f47ad710595c1d87daa8f6b67045574c7304f83e (patch) | |
| tree | cdcc8016f15eb381ca34b4ace84e1b300d910949 /compiler/rustc_passes/src/dead.rs | |
| parent | ccc9ba5c30c675824e9ca62b960830ff4a1858ea (diff) | |
| download | rust-f47ad710595c1d87daa8f6b67045574c7304f83e.tar.gz rust-f47ad710595c1d87daa8f6b67045574c7304f83e.zip | |
Eliminate PatKind::Path
Diffstat (limited to 'compiler/rustc_passes/src/dead.rs')
| -rw-r--r-- | compiler/rustc_passes/src/dead.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index e5b63b9b4a6..bc2bebdfef6 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -10,11 +10,10 @@ use hir::def_id::{LocalDefIdMap, LocalDefIdSet}; use rustc_abi::FieldIdx; use rustc_data_structures::unord::UnordSet; use rustc_errors::MultiSpan; -use rustc_hir as hir; use rustc_hir::def::{CtorOf, DefKind, Res}; use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId}; use rustc_hir::intravisit::{self, Visitor}; -use rustc_hir::{Node, PatKind, TyKind}; +use rustc_hir::{self as hir, Node, PatExpr, PatExprKind, PatKind, TyKind}; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::middle::privacy::Level; use rustc_middle::query::Providers; @@ -637,8 +636,8 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> { let res = self.typeck_results().qpath_res(path, pat.hir_id); self.handle_field_pattern_match(pat, res, fields); } - PatKind::Path(ref qpath) => { - let res = self.typeck_results().qpath_res(qpath, pat.hir_id); + PatKind::Expr(PatExpr { kind: PatExprKind::Path(ref qpath), hir_id, .. }) => { + let res = self.typeck_results().qpath_res(qpath, *hir_id); self.handle_res(res); } PatKind::TupleStruct(ref qpath, fields, dotdot) => { |
