We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[define_opaque]
1 parent 540565e commit d9de940Copy full SHA for d9de940
example/issue-72793.rs
@@ -2,23 +2,21 @@
2
3
#![feature(type_alias_impl_trait)]
4
5
-mod helper {
6
- pub trait T {
7
- type Item;
8
- }
+pub trait T {
+ type Item;
+}
9
10
- pub type Alias<'a> = impl T<Item = &'a ()>;
+pub type Alias<'a> = impl T<Item = &'a ()>;
11
12
- struct S;
13
- impl<'a> T for &'a S {
14
- type Item = &'a ();
15
+struct S;
+impl<'a> T for &'a S {
+ type Item = &'a ();
16
17
- pub fn filter_positive<'a>() -> Alias<'a> {
18
- &S
19
+#[define_opaque(Alias)]
+pub fn filter_positive<'a>() -> Alias<'a> {
+ &S
20
}
21
-use helper::*;
22
23
fn with_positive(fun: impl Fn(Alias<'_>)) {
24
fun(filter_positive());
0 commit comments