Skip to content

Commit 86df5ce

Browse files
Do not attempt unsupported -Zself-profile for rustdoc
1 parent 3294414 commit 86df5ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a> CargoProcess<'a> {
258258
// subcommand that itself invokes `rustc` (so that the `FAKE_RUSTC`
259259
// machinery works).
260260
let subcommand = if let Some((ref mut processor, run_kind, ..)) = self.processor_etc {
261-
let profiler = processor.profiler();
261+
let profiler = processor.profiler(self.build_kind);
262262
if !profiler.is_run_kind_allowed(run_kind) {
263263
return Err(anyhow::anyhow!(
264264
"this profiler doesn't support {:?} runs",
@@ -300,7 +300,7 @@ impl<'a> CargoProcess<'a> {
300300
// onto rustc for the final crate, which is exactly the crate for which
301301
// we want to wrap rustc.
302302
if let Some((ref mut processor, ..)) = self.processor_etc {
303-
let profiler = processor.profiler().name();
303+
let profiler = processor.profiler(self.build_kind).name();
304304
cmd.arg("--wrap-rustc-with");
305305
cmd.arg(profiler);
306306
cmd.args(&self.rustc_args);
@@ -385,7 +385,7 @@ pub struct ProcessOutputData<'a> {
385385
/// processing.
386386
pub trait Processor {
387387
/// The `Profiler` being used.
388-
fn profiler(&self) -> Profiler;
388+
fn profiler(&self, _: BuildKind) -> Profiler;
389389

390390
/// Process the output produced by the particular `Profiler` being used.
391391
fn process_output(
@@ -507,8 +507,8 @@ impl<'a> MeasureProcessor<'a> {
507507
}
508508

509509
impl<'a> Processor for MeasureProcessor<'a> {
510-
fn profiler(&self) -> Profiler {
511-
if self.is_first_collection && self.self_profile {
510+
fn profiler(&self, build: BuildKind) -> Profiler {
511+
if self.is_first_collection && self.self_profile && build != BuildKind::Doc {
512512
Profiler::PerfStatSelfProfile
513513
} else {
514514
Profiler::PerfStat
@@ -633,7 +633,7 @@ impl<'a> ProfileProcessor<'a> {
633633
}
634634

635635
impl<'a> Processor for ProfileProcessor<'a> {
636-
fn profiler(&self) -> Profiler {
636+
fn profiler(&self, _: BuildKind) -> Profiler {
637637
self.profiler
638638
}
639639

0 commit comments

Comments
 (0)