<Foo as Trait>::AssocType triggers non-Copy
union check even when it is copy
#90903
Labels
C-bug
Category: This is a bug.
Copy
union check even when it is copy
#90903
Hello, I ran into what I think is a bug with unions and type normalization.
Playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b9c65cbec84f266463da8192cf7c2d21
I expected to see this happen: This should compile:
<Foo as Trait>::Assoc
is both bounded to beCopy
and should normalize directly tou8
since it uses a concrete type.Instead, this happened:
Wrapping the type in
ManuallyDrop
does indeed work, and is a possible workaround for simple types, but I believe this should still work.Meta
Stable 1.56.1 playground, happens on nightly 1.58.0-nightly (2021-11-13 b416e38) playground as well
Maybe this is connected to #81199? If I remove
impl Trait for Foo
it ICEs on stable and errors on nightly (i.e. fixed on nightly).The text was updated successfully, but these errors were encountered: