I've been on a wild ride trying to figure out exactly what's been going on.
Minimal example: clone https://github.com/la10736/rstest and run RUSTDOCFLAGS="-Z unstable-options --static-root-path /" cargo +nightly doc --target x86_64-unknown-linux-gnu. The links to static files should start with /; instead they start with ../.
Note that if you omit --target, the --static-root-path / argument works fine. I'm not sure why they conflict in this way.
This is the root cause of rust-lang/docs.rs#422.
This is similar but not the same as #62940.
cc @QuietMisdreavus @pietroalbini