-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Don't ignore generator fields in miri #60889
Copy link
Copy link
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-miriArea: The miri toolArea: The miri toolAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.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.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-miriArea: The miri toolArea: The miri toolAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Right now, saved locals in generators are special-cased in miri, because they might not always be initialized.
With #59897 and #60187, we have the framework to fix this: fields are now only put in generator variants where they are live. The problem remains with aggregate fields, however, e.g.
In this case
x.1is never initialized. This still presents a special case, because we cannot have a partially-unitialized field in a regular struct or enum type.One way to remove the special-casing in miri is to wrap the type of every generator field in
MaybeUninitializedwhen we return it fromrustc::ty::layout::field(). This required makingMaybeUnitializeda lang item, though, and doesn't actually give us any new features.Eventually, I think we'd like to handle aggregate fields explicitly, so we can sanitize UB in generators.