Implement #[define_opaque] attribute for functions.
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
mod helper {
|
|
||||||
pub trait T {
|
pub trait T {
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
@@ -14,11 +13,10 @@ mod helper {
|
|||||||
type Item = &'a ();
|
type Item = &'a ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[define_opaque(Alias)]
|
||||||
pub fn filter_positive<'a>() -> Alias<'a> {
|
pub fn filter_positive<'a>() -> Alias<'a> {
|
||||||
&S
|
&S
|
||||||
}
|
}
|
||||||
}
|
|
||||||
use helper::*;
|
|
||||||
|
|
||||||
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
||||||
fun(filter_positive());
|
fun(filter_positive());
|
||||||
|
|||||||
Reference in New Issue
Block a user