diff --git a/example/issue-72793.rs b/example/issue-72793.rs index 2e08fbca8ef..95d58b90e79 100644 --- a/example/issue-72793.rs +++ b/example/issue-72793.rs @@ -2,23 +2,21 @@ #![feature(type_alias_impl_trait)] -mod helper { - pub trait T { - type Item; - } - - pub type Alias<'a> = impl T; - - struct S; - impl<'a> T for &'a S { - type Item = &'a (); - } - - pub fn filter_positive<'a>() -> Alias<'a> { - &S - } +pub trait T { + type Item; +} + +pub type Alias<'a> = impl T; + +struct S; +impl<'a> T for &'a S { + type Item = &'a (); +} + +#[define_opaque(Alias)] +pub fn filter_positive<'a>() -> Alias<'a> { + &S } -use helper::*; fn with_positive(fun: impl Fn(Alias<'_>)) { fun(filter_positive());