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)
I tried this code:
I expected the code to compile. But instead I got this error:
@rustbot labels +F-type_alias_impl_trait
Meta
Reproduces on the playground with version
1.91.0-nightly (2025-08-11 1ebbd87a62ce96a72b22)