Closed
Description
Given the code:
#![feature(type_alias_impl_trait)]
type Tait = impl Sized;
struct One;
fn one() -> Tait { One }
struct Two<T>(T);
fn two() -> Tait { Two::<()>(todo!()) }
If you run the code, you can see that the compiler ends up "successfully" inferencing Tait = One
and succeeding compilation, even though upon visual inspection, the compiler should be raising an error since fn two
should cause the conflicting inference Tait = Two<()>
.
The key here is the todo!()
macro, which causes the SimplifyCfg
MIR 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..?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done