diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-21 18:33:05 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-03-12 08:55:37 +1100 |
| commit | 256c27e748b477c1ec1c59bdc23afade5eec84aa (patch) | |
| tree | 4d3d238ca0b2c12f6834797810e19a6d4602deba /compiler/rustc_mir_build/src/builder/scope.rs | |
| parent | 281af35cc33e315bd6b52c8a0578108ece75e265 (diff) | |
| download | rust-256c27e748b477c1ec1c59bdc23afade5eec84aa.tar.gz rust-256c27e748b477c1ec1c59bdc23afade5eec84aa.zip | |
Move methods from `Map` to `TyCtxt`, part 4.
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
Diffstat (limited to 'compiler/rustc_mir_build/src/builder/scope.rs')
| -rw-r--r-- | compiler/rustc_mir_build/src/builder/scope.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 81561239491..27ff01b4803 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -942,14 +942,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { assert_eq!(orig_id.owner, self.hir_id.owner); let mut id = orig_id; - let hir = self.tcx.hir(); loop { if id == self.hir_id { // This is a moderately common case, mostly hit for previously unseen nodes. break; } - if hir.attrs(id).iter().any(|attr| Level::from_attr(attr).is_some()) { + if self.tcx.hir_attrs(id).iter().any(|attr| Level::from_attr(attr).is_some()) { // This is a rare case. It's for a node path that doesn't reach the root due to an // intervening lint level attribute. This result doesn't get cached. return id; |
