-
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
Tracking Issue for rustdoc show-type-layout
#113248
Comments
How does this interact with https://doc.rust-lang.org/rustdoc/advanced-features.html#interactions-between-platform-specific-docs? Won't it cause errors or ICEs if you use it on a crate that compiles with rustdoc but not rustc, because you need to run typeck to determine layout? |
Document tracking issue for rustdoc `show-type-layout` Tracking issue: rust-lang#113248 `@rustbot` label +T-rustdoc +A-docs
Document tracking issue for rustdoc `show-type-layout` Tracking issue: rust-lang#113248 ``@rustbot`` label +T-rustdoc +A-docs
For generics I'd say something along the lines of
Since this is probably not something that you want in all types what about opting in? #[doc_layout("x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu")]
struct MyStruct {...} Which gets deduplicated if it happens to be the same? |
i don't think it's true that the layout is some fixed offset like that. if you think about e.g. |
Heh, that's fair. #[doc_layout] // Defaults to target that is building it
struct S<T> {
a: usize,
b: T,
c: Option<T>,
d: SomePrivateStruct<T>,
e: PhantomData<T>,
f: SomeOtherZST<T>,
g: [T; 10],
}
I think that if we make it opt in it's not bad to leak the private structs. |
This is a tracking issue for the rustdoc
show-type-layout
/show_type_layout
feature. This displays the layout layout (size & alignment) of types in the documentation.This feature was formerly known as
document_type_layout
Usage is described at rustdoc unstable features
Zulip thread for discussion: https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Rustdoc.20.60show-type-layout.60.20feature
Steps
Unresolved Questions
show-type-layout
#113248 (comment))Implementation history
@rustbot label +T-rustdoc
The text was updated successfully, but these errors were encountered: