-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-rustc_attrsInternal rustc attributes gated on the `#[rustc_attrs]` feature gate.Internal rustc attributes gated on the `#[rustc_attrs]` feature gate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
#![feature(rustc_attrs)]
struct S<T>(T, T);
#[rustc_layout(debug)]
type T = S<str>;
This should complain about using an unsized type in a way that doesn't work. Instead, it prints some layout.
Probably the rustc_layout logic needs to fire of some sort of query to ensure the type is well-formed, or something like that? I know type aliases only get WF-checked "on use", and it seems somehow this attribute doesn't count as a use. How can we make it count as a use?
Metadata
Metadata
Assignees
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-rustc_attrsInternal rustc attributes gated on the `#[rustc_attrs]` feature gate.Internal rustc attributes gated on the `#[rustc_attrs]` feature gate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.