Add opaque type attributes

This allows for the code to compile on `nightly`.
This commit is contained in:
Stan Manilov 2025-06-01 10:36:28 +03:00 committed by GitHub
parent e76d93cb24
commit f267718a78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -13,13 +13,16 @@ it can work across functions and function bodies.
To help explain how it works, let's consider an example.
```rust
#![feature(type_alias_impl_trait)]
mod m {
pub type Seq<T> = impl IntoIterator<Item = T>;
#[define_opaque(Seq)]
pub fn produce_singleton<T>(t: T) -> Seq<T> {
vec![t]
}
#[define_opaque(Seq)]
pub fn produce_doubleton<T>(t: T, u: T) -> Seq<T> {
vec![t, u]
}