]> git.lizzy.rs Git - rust.git/commit
rustdoc: emit JS paths for struct-like variants
authorTom Jakubowski <tom@crystae.net>
Tue, 24 Sep 2019 01:37:20 +0000 (18:37 -0700)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 30 Jan 2020 12:39:01 +0000 (13:39 +0100)
commit05c6f329e785c9b53a50217de0f21df906ae7ba0
tree88b76de47b013a520fec929bcc399576f0446629
parentb60f08bd6d3fbe784eb47a57e0c41954454af3dd
rustdoc: emit JS paths for struct-like variants

On the backend, rustdoc now emits `paths` entries to a crate's search
index for struct-like enum variants, and index items of type structfield
which belong to such variants point to their variant parents in the
`paths` table, rather than their enum grandparents.  The path entry for
a variant is the fully qualified module path plus the enum name.

On the frontend, the search code recognizes structfields belonging to
structlike variants in the `paths` table and re-constructs the URL to
the field's anchor on the enum documentation page.

closes #16017
src/librustdoc/html/static/main.js