Closed
Description
The following currently passes the structural match check and causes an ICE later on:
(now that #72153 has landed, this emits an error)
#![feature(const_fn, type_alias_impl_trait)]
type F = impl Send;
// This does not implement structural match
struct A;
const fn value(a: A) -> F {
a
}
const V: F = value(A);
fn main() {
match value(A) {
V => println!("hey"),
}
}
I believe we have to either leak the structural match property of opaque types,
(similar to Send
and Sync
afaict) or forbid this entirely.
I am in favor of the second option for now. It should not be a breaking change to go from the
second to the first later on.
This issue concerns the implementation in #72153
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done