Add opaque type attributes
This allows for the code to compile on `nightly`.
This commit is contained in:
parent
e76d93cb24
commit
f267718a78
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue