From 5e4618ff1433e92009c7478933874f5f23b34e29 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Thu, 3 Nov 2022 16:42:28 +0100 Subject: [PATCH] address review comment --- src/bootstrap/doc.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 0045856e2c9..1357718b84e 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -12,7 +12,7 @@ use std::fs; use std::io; use std::path::{Path, PathBuf}; -use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step}; +use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step}; use crate::cache::{Interned, INTERNER}; use crate::compile; use crate::config::{Config, TargetSelection}; @@ -370,7 +370,10 @@ impl Step for Standalone { // We open doc/index.html as the default if invoked as `x.py doc --open` // with no particular explicit doc requested (e.g. library/core). - builder.maybe_open_in_browser::(out.join("index.html")); + if builder.paths.is_empty() || builder.was_invoked_explicitly::(Kind::Doc) { + let index = out.join("index.html"); + builder.open_in_browser(&index); + } } }