Skip to content

Fix ICE when documentation includes intra-doc-link #66211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rustdoc: Support --extern-private but treat as --extern
This makes `rustdoc` support `--extern-private` but treats it
the same as `--extern` which is useful for making the CLI more
similar to `rustc` to ease test suite integration.

Signed-off-by: Daniel Silverstone <[email protected]>
  • Loading branch information
kinnison committed Nov 8, 2019
commit 2c33568a77cf308c91129e0f0a4d4d53f1689ebb
4 changes: 3 additions & 1 deletion src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,12 @@ fn parse_extern_html_roots(
/// Extracts `--extern CRATE=PATH` arguments from `matches` and
/// returns a map mapping crate names to their paths or else an
/// error message.
/// Also handles `--extern-private` which for the purposes of rustdoc
/// we can treat as `--extern`
// FIXME(eddyb) This shouldn't be duplicated with `rustc::session`.
fn parse_externs(matches: &getopts::Matches) -> Result<Externs, String> {
let mut externs: BTreeMap<_, ExternEntry> = BTreeMap::new();
for arg in &matches.opt_strs("extern") {
for arg in matches.opt_strs("extern").iter().chain(matches.opt_strs("extern-private").iter()) {
let mut parts = arg.splitn(2, '=');
let name = parts.next().ok_or("--extern value must not be empty".to_string())?;
let location = parts.next().map(|s| s.to_string());
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ fn opts() -> Vec<RustcOptGroup> {
stable("extern", |o| {
o.optmulti("", "extern", "pass an --extern to rustc", "NAME=PATH")
}),
stable("extern-private", |o| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be stable, it's not even stable in rustc: #66655

o.optmulti("", "extern-private",
"pass an --extern to rustc (compatibility only)", "NAME=PATH")
}),
unstable("extern-html-root-url", |o| {
o.optmulti("", "extern-html-root-url",
"base URL to use for dependencies", "NAME=URL")
Expand Down