Skip to content

Commit 994d9d0

Browse files
committed
Address remaining feedback items
1 parent f4a7938 commit 994d9d0

File tree

4 files changed

+5
-28
lines changed

4 files changed

+5
-28
lines changed

src/librustc_metadata/locator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl<'a> CrateLocator<'a> {
489489
{
490490
err.note(&format!("the `{}` target may not be installed", self.triple));
491491
} else if self.crate_name == sym::profiler_builtins {
492-
err.note(&"the compiler may have been built without `profiler = true`");
492+
err.note(&"the compiler may have been built without the profiler runtime");
493493
}
494494
err.span_label(self.span, "can't find crate");
495495
err

src/librustc_middle/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn fn_sig<'hir>(node: Node<'hir>) -> Option<&'hir FnSig<'hir>> {
5656
}
5757
}
5858

59-
fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
59+
pub fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
6060
match node {
6161
Node::Item(Item {
6262
kind: ItemKind::Const(_, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body),

src/librustc_middle/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ rustc_queries! {
215215
}
216216

217217
query coverage_data(key: DefId) -> Option<mir::CoverageData> {
218-
desc { |tcx| "retrieving coverage data, if computed from MIR for `{}`", tcx.def_path_str(key) }
218+
desc { |tcx| "retrieving coverage data from MIR for `{}`", tcx.def_path_str(key) }
219219
storage(ArenaCacheSelector<'tcx>)
220220
cache_on_disk_if { key.is_local() }
221221
}

src/librustc_mir/transform/instrument_coverage.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::util::patch::MirPatch;
33
use rustc_data_structures::fingerprint::Fingerprint;
44
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
55
use rustc_hir::lang_items;
6-
use rustc_hir::*;
6+
use rustc_middle::hir;
77
use rustc_middle::ich::StableHashingContext;
88
use rustc_middle::mir::interpret::Scalar;
99
use rustc_middle::mir::{
@@ -140,7 +140,7 @@ fn placeholder_block(span: Span) -> BasicBlockData<'tcx> {
140140

141141
fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, src: &MirSource<'tcx>) -> u64 {
142142
let fn_body_id = match tcx.hir().get_if_local(src.def_id()) {
143-
Some(node) => match associated_body(node) {
143+
Some(node) => match hir::map::associated_body(node) {
144144
Some(body_id) => body_id,
145145
_ => bug!("instrumented MirSource does not include a function body: {:?}", node),
146146
},
@@ -159,26 +159,3 @@ fn hash(
159159
node.hash_stable(hcx, &mut stable_hasher);
160160
stable_hasher.finish()
161161
}
162-
163-
fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
164-
match node {
165-
Node::Item(Item {
166-
kind: ItemKind::Const(_, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body),
167-
..
168-
})
169-
| Node::TraitItem(TraitItem {
170-
kind:
171-
TraitItemKind::Const(_, Some(body)) | TraitItemKind::Fn(_, TraitFn::Provided(body)),
172-
..
173-
})
174-
| Node::ImplItem(ImplItem {
175-
kind: ImplItemKind::Const(_, body) | ImplItemKind::Fn(_, body),
176-
..
177-
})
178-
| Node::Expr(Expr { kind: ExprKind::Closure(.., body, _, _), .. }) => Some(*body),
179-
180-
Node::AnonConst(constant) => Some(constant.body),
181-
182-
_ => None,
183-
}
184-
}

0 commit comments

Comments
 (0)