diff options
| author | Pietro Albini <pietro.albini@ferrous-systems.com> | 2022-11-03 16:42:28 +0100 |
|---|---|---|
| committer | Pietro Albini <pietro.albini@ferrous-systems.com> | 2022-11-03 16:42:28 +0100 |
| commit | 5e4618ff1433e92009c7478933874f5f23b34e29 (patch) | |
| tree | 3b7e7851b7c04af61ed50e5c456b76a40c802fc3 | |
| parent | 6bc36d18ce5bcbf542718a177f179f169bfd756b (diff) | |
| download | rust-5e4618ff1433e92009c7478933874f5f23b34e29.tar.gz rust-5e4618ff1433e92009c7478933874f5f23b34e29.zip | |
address review comment
| -rw-r--r-- | src/bootstrap/doc.rs | 7 |
1 files 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::<Self>(out.join("index.html")); + if builder.paths.is_empty() || builder.was_invoked_explicitly::<Self>(Kind::Doc) { + let index = out.join("index.html"); + builder.open_in_browser(&index); + } } } |
