Skip to content

Commit b81bd96

Browse files
committed
Rename hir_attrs query as hir_attr_map.
To make room for the moving of `Map::attrs` to `TyCtxt::hir_attrs` in the next commit. (It makes sense to rename the query, because it has many fewer uses than the method.)
1 parent 05d742b commit b81bd96

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

compiler/rustc_lint/src/levels.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fn lints_that_dont_need_to_run(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LintId> {
152152
#[instrument(level = "trace", skip(tcx), ret)]
153153
fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLevelMap {
154154
let store = unerased_lint_store(tcx.sess);
155-
let attrs = tcx.hir_attrs(owner);
155+
let attrs = tcx.hir_attr_map(owner);
156156

157157
let mut levels = LintLevelsBuilder {
158158
sess: tcx.sess,

compiler/rustc_middle/src/hir/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ impl<'hir> Map<'hir> {
908908
/// Given a node ID, gets a list of attributes associated with the AST
909909
/// corresponding to the node-ID.
910910
pub fn attrs(self, id: HirId) -> &'hir [Attribute] {
911-
self.tcx.hir_attrs(id.owner).get(id.local_id)
911+
self.tcx.hir_attr_map(id.owner).get(id.local_id)
912912
}
913913

914914
/// Gets the span of the definition of the specified HIR node.

compiler/rustc_middle/src/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub fn provide(providers: &mut Providers) {
202202
}
203203
})
204204
};
205-
providers.hir_attrs = |tcx, id| {
205+
providers.hir_attr_map = |tcx, id| {
206206
tcx.hir_crate(()).owners[id.def_id].as_owner().map_or(AttributeMap::EMPTY, |o| &o.attrs)
207207
};
208208
providers.def_span = |tcx, def_id| tcx.hir().span(tcx.local_def_id_to_hir_id(def_id));

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ rustc_queries! {
198198
///
199199
/// This can be conveniently accessed by methods on `tcx.hir()`.
200200
/// Avoid calling this query directly.
201-
query hir_attrs(key: hir::OwnerId) -> &'tcx hir::AttributeMap<'tcx> {
201+
query hir_attr_map(key: hir::OwnerId) -> &'tcx hir::AttributeMap<'tcx> {
202202
desc { |tcx| "getting HIR owner attributes in `{}`", tcx.def_path_str(key) }
203203
feedable
204204
}

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
12891289
),
12901290
bodies,
12911291
})));
1292-
self.feed_owner_id().hir_attrs(attrs);
1292+
self.feed_owner_id().hir_attr_map(attrs);
12931293
}
12941294
}
12951295

0 commit comments

Comments
 (0)