rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.65k stars 12.49k forks source link

rustdoc generates invalid link: `url#impl-id/method.name` #128676

Closed RalfJung closed 1 month ago

RalfJung commented 1 month ago

I spotted this in these search results: the TyCtxt::adt_def result links to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#impl-TyCtxt%3C'tcx%3E/method.adt_def which is not a valid link.

Cc @rust-lang/rustdoc

camelid commented 1 month ago

cc @notriddle -- I think these are supposed to be autoredirected in JS?

notriddle commented 1 month ago

Okay...

This happens because there's more than one impl<'tcx> TyCtxt<'tcx> and the one we want is currently named #impl-TyCtxt%3C'tcx%3E-35. The URL escaping is fine; the -35 is the problem.