Skip to content

Commit d9de940

Browse files
committed
Implement #[define_opaque] attribute for functions.
1 parent 540565e commit d9de940

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

example/issue-72793.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
#![feature(type_alias_impl_trait)]
44

5-
mod helper {
6-
pub trait T {
7-
type Item;
8-
}
5+
pub trait T {
6+
type Item;
7+
}
98

10-
pub type Alias<'a> = impl T<Item = &'a ()>;
9+
pub type Alias<'a> = impl T<Item = &'a ()>;
1110

12-
struct S;
13-
impl<'a> T for &'a S {
14-
type Item = &'a ();
15-
}
11+
struct S;
12+
impl<'a> T for &'a S {
13+
type Item = &'a ();
14+
}
1615

17-
pub fn filter_positive<'a>() -> Alias<'a> {
18-
&S
19-
}
16+
#[define_opaque(Alias)]
17+
pub fn filter_positive<'a>() -> Alias<'a> {
18+
&S
2019
}
21-
use helper::*;
2220

2321
fn with_positive(fun: impl Fn(Alias<'_>)) {
2422
fun(filter_positive());

0 commit comments

Comments
 (0)