Skip to content

rustdoc generation of search-index.js depends on the order crates are documented #61216

Closed
@ollie27

Description

@ollie27

Take two crates:

foo.rs:

pub struct FooBar;

bar.rs:

pub struct BarFoo;

Using rustdoc 1.36.0-nightly (8869ee03d 2019-05-23) for example and running rustdoc foo.rs then rustdoc bar.rs gives a search-index.js:

var N=null,E="",T="t",U="u",searchIndex={};
var R=["result","FooBar","BarFoo","try_from","try_into","borrow","borrow_mut","type_id","typeid"];
searchIndex["bar"]={"doc":E,"i":[[3,R[2],"bar",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[3],E,E,0,[[[U]],[R[0]]]],[11,R[4],E,E,0,[[],[R[0]]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[T]]],[11,R[7],E,E,0,[[["self"]],[R[8]]]]],"p":[[3,R[2]]]};
searchIndex["foo"]={"doc":E,"i":[[3,R[1],"foo",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[3],E,E,0,[[[U]],[R[0]]]],[11,R[4],E,E,0,[[],[R[0]]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[T]]],[11,R[7],E,E,0,[[["self"]],[R[8]]]]],"p":[[3,R[1]]]};
initSearch(searchIndex);addSearchOptions(searchIndex);

but running rustdoc bar.rs then rustdoc foo.rs gives:

var N=null,E="",T="t",U="u",searchIndex={};
var R=["result","BarFoo","try_from","try_into","borrow","borrow_mut","type_id","typeid","FooBar"];
searchIndex["bar"]={"doc":E,"i":[[3,R[1],"bar",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[2],E,E,0,[[[U]],[R[0]]]],[11,R[3],E,E,0,[[],[R[0]]]],[11,R[4],E,E,0,[[["self"]],[T]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[R[7]]]]],"p":[[3,R[1]]]};
searchIndex["foo"]={"doc":E,"i":[[3,R[8],"foo",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[2],E,E,0,[[[U]],[R[0]]]],[11,R[3],E,E,0,[[],[R[0]]]],[11,R[4],E,E,0,[[["self"]],[T]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[R[7]]]]],"p":[[3,R[8]]]};
initSearch(searchIndex);addSearchOptions(searchIndex);

They should be identical and they are when using --disable-minification. This breaks reproducible builds (#34902).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-reproducibilityArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions