-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
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
I tried this code:
#![feature(type_alias_impl_trait)]
fn main() {
type Opaque = impl Sized;
#[define_opaque(Opaque)]
fn make_opaque() -> Opaque {
1i32
}
}
I expected the code to compile. But instead I got this error:
error: item does not constrain `Opaque::{opaque#0}`
--> src/main.rs:3:4
|
3 | fn main() {
| ^^^^
|
= note: consider removing `#[define_opaque]` or adding an empty `#[define_opaque()]`
note: this opaque type is supposed to be constrained
--> src/main.rs:4:19
|
4 | type Opaque = impl Sized;
| ^^^^^^^^^^
@rustbot labels +F-type_alias_impl_trait
Meta
Reproduces on the playground with version 1.91.0-nightly (2025-08-11 1ebbd87a62ce96a72b22)
fmease
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.