Skip to content

Commit f61e5ca

Browse files
committed
Auto merge of #79976 - jyn514:assertion-failure, r=jyn514
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`
2 parents 7efc097 + 130dbe4 commit f61e5ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/librustdoc/passes/collect_intra_doc_links.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
436436
// Try looking for methods and associated items.
437437
let mut split = path_str.rsplitn(2, "::");
438438
// NB: `split`'s first element is always defined, even if the delimiter was not present.
439+
// NB: `item_str` could be empty when resolving in the root namespace (e.g. `::std`).
439440
let item_str = split.next().unwrap();
440-
assert!(!item_str.is_empty());
441441
let item_name = Symbol::intern(item_str);
442442
let path_root = split
443443
.next()

0 commit comments

Comments
 (0)