You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustdoc removes Try from <Self as Try>::Residual in std::ops::FromResidual #85454
Hypothesis: this a a weird case in the associated type normalization, since in just about any other position this would only be allowed because there'd be a where Self: Try in scope, but there's isn't here.
I researched a bit into this issue. The problem is that rustdoc never renders a <Self as X>::Y cast (where Self is the type to be cast) because of this check:
However, it's a bit harder to fix this because simply removing this check would lead to false-positive where Self is cast to the type of itself (<Self as Deref>::Target in a Deref impl for example), which is wrong too.
Activity
scottmcm commentedon May 18, 2021
Hypothesis: this a a weird case in the associated type normalization, since in just about any other position this would only be allowed because there'd be a
where Self: Tryin scope, but there's isn't here.(It's a very unusual case, and also broke R-A: rust-lang/rust-analyzer#8692)
Stupremee commentedon May 19, 2021
I researched a bit into this issue. The problem is that rustdoc never renders a
<Self as X>::Ycast (whereSelfis the type to be cast) because of this check:rust/src/librustdoc/html/format.rs
Lines 840 to 845 in 9f8012e
This is another example where the cast is stripped away by rustdoc:
would be shown as:
However, it's a bit harder to fix this because simply removing this check would lead to false-positive where
Selfis cast to the type of itself (<Self as Deref>::Targetin aDerefimpl for example), which is wrong too.Auto merge of rust-lang#85479 - Stupremee:render-Self_as-type-casts, …
Stupremee commentedon May 24, 2021
This needs to be re-opened because it does not work if the trait is re-exported.
Compare https://doc.rust-lang.org/nightly/std/ops/trait.FromResidual.html with https://doc.rust-lang.org/nightly/core/ops/trait.FromResidual.html
I will try to investigate and fix it in the next few days
cynecx commentedon May 25, 2021
@Stupremee #84579 might be related.
Stupremee commentedon May 25, 2021
Cross Crate re-exports are really weird in general. They already caused me so much pain
cynecx commentedon May 25, 2021
@Stupremee #84579 (comment) might be interesting.
Auto merge of rust-lang#86449 - Stupremee:render-self-cast-in-type-bo…