-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: Implementors of a trait is not const-evaled, thus showing [T; 32 - 1 - 1 - 1 - 1 - 1 - 1 - 1]
#46727
Comments
The macro in question is the same for 2 years, as seen with blame. Here is a commit that introduced it: 975a8ed. |
Thanks for checking @xfix! Considering it's not due to change of generating macro, untagging |
Likely because array types now contain a constant expression instead of a fully evaluated |
Offending rustdoc code: https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/mod.rs#L2032 |
We attempt to const-evaluate when we get the type from HIR: rust/src/librustdoc/clean/mod.rs Line 2029 in 75a02a9
But not from rust/src/librustdoc/clean/mod.rs Lines 2155 to 2156 in 75a02a9
So a few lines from the former should be copied to the latter. |
Is anyone picking it up or should I wait a bit more before fixing it? |
This doesn't look too difficult, so I'll have a go at it. |
Const-eval array lengths in rustdoc. Fixes rust-lang#46727 r? @eddyb Big thanks to @eddyb for helping me figure this out.
Repro steps:
The array lengths are normal in 1.21.0, but it is not clear whether this is the effect of performing const evaluation or the macro generating these impl changed in the new version.
The text was updated successfully, but these errors were encountered: