Skip to content

Commit 281af35

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 d2642ab commit 281af35

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
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
@@ -1299,7 +1299,7 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
12991299
),
13001300
bodies,
13011301
})));
1302-
self.feed_owner_id().hir_attrs(attrs);
1302+
self.feed_owner_id().hir_attr_map(attrs);
13031303
}
13041304
}
13051305

compiler/rustc_ty_utils/src/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'tcx> OpaqueTypeCollector<'tcx> {
187187
if !hir_id.is_owner() {
188188
return;
189189
}
190-
let Some(defines) = self.tcx.hir_attrs(hir_id.owner).define_opaque else {
190+
let Some(defines) = self.tcx.hir_attr_map(hir_id.owner).define_opaque else {
191191
return;
192192
};
193193
for &(span, define) in defines {

0 commit comments

Comments
 (0)