-
-
Notifications
You must be signed in to change notification settings - Fork 15k
MIR dead code analysis affects TAIT inference #99490
Copy link
Copy link
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`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-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`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.
Projects
StatusShow more project fields
Done
Given the code:
If you run the code, you can see that the compiler ends up "successfully" inferencing
Tait = Oneand succeeding compilation, even though upon visual inspection, the compiler should be raising an error sincefn twoshould cause the conflicting inferenceTait = Two<()>.The key here is the
todo!()macro, which causes theSimplifyCfgMIR pass to remove MIR that actually causes us to make this second inference.Is this expected? How would we even change this behavior, since it would require us to disentangle TAIT inference from borrowck..?