Skip to content

Commit

Permalink
Auto merge of rust-lang#79976 - jyn514:assertion-failure, r=jyn514
Browse files Browse the repository at this point in the history
Remove incorrect assert

Fixes an assertion failure when resolving `::std` (or any other crate that uses the `::` style, see https://github.com/rust-lang/rust/pull/79809/files#r541776478, https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Perf.20failing).

Unblocks rust-lang/rustc-perf#806.

r? `@ghost` - this is a trivial fix and breaking rustc-perf so I'm going to approve it unilaterally. cc `@Mark-Simulacrum` `@Eric-Arellano`
  • Loading branch information
bors committed Dec 12, 2020
2 parents 7efc097 + 130dbe4 commit f61e5ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
// Try looking for methods and associated items.
let mut split = path_str.rsplitn(2, "::");
// NB: `split`'s first element is always defined, even if the delimiter was not present.
// NB: `item_str` could be empty when resolving in the root namespace (e.g. `::std`).
let item_str = split.next().unwrap();
assert!(!item_str.is_empty());
let item_name = Symbol::intern(item_str);
let path_root = split
.next()
Expand Down

0 comments on commit f61e5ca

Please sign in to comment.