]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #106466 - clubby789:relative-module-fix, r=notriddle
authorMatthias Krüger <matthias.krueger@famsik.de>
Fri, 6 Jan 2023 20:26:11 +0000 (21:26 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Jan 2023 20:26:11 +0000 (21:26 +0100)
commiteb27b613b6a97123611b75168fc732c3818c8da5
tree505e5c73be8b3d2fd9bc7fa5c772dafcfdae2c49
parent72d650f47a7c23d31e16f54d71f7356fbcd651f5
parentd5d1c5716747ded8ca9746be71e70cceeaa9f422
Rollup merge of #106466 - clubby789:relative-module-fix, r=notriddle

Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links

Fixes #103517

While generating the location for modules source HTML to be saved at, a `..` path component appeared to be translated to `/up/`.
Additionally, while generating the navigation sidebar, `..` path components were ignored. This means that (as in the issue above), a *real* directory structure of:
```
sys/
  unix/
    mod.rs  <-- contains #![path = "../unix/mod.rs]
    cmath.rs
```
was rendered as:
```
sys/
  unix/
    mod.rs
    unix/
      cmath.rs  <-- links to sys/unix/unix/cmath.rs.html, 404
```
While the *files* were stored as
```
sys/
  unix/
    mod.rs.html
    up/
      unix/
        cmath.rs.html
```