Description
This is allowed:
type T = impl Copy;
let foo: T = (1u32, 2u32);
But this isn't:
type T = impl Copy; // error: unconstrained opaque type
let foo: T = (1u32, 2u32);
let (a, b) = foo;
It seems strange to me that adding code causes a type that was previously properly constrained to not longer be so. I'm not sure if it's a diagnostics issue, or if it should indeed be allowed...
See playground
rustc 1.62.0-nightly (a707f40 2022-04-29)
@rustbot label A-impl-trait F-type_alias_impl_trait
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: This is a bug.`#[feature(type_alias_impl_trait)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.
Type
Projects
Status
Done