]> git.lizzy.rs Git - rust.git/commitdiff
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)
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
```


Trivial merge