-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
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.
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
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
Projects
Status
Done