Skip to content

Commit 62edbbe

Browse files
committed
Add regression test for #89436
1 parent c2f428d commit 62edbbe

File tree

1 file changed

+44
-0
lines changed
  • src/test/ui/higher-rank-trait-bounds/normalize-under-binder

1 file changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// check-pass
2+
3+
#![allow(unused)]
4+
5+
trait MiniYokeable<'a> {
6+
type Output;
7+
}
8+
9+
struct MiniYoke<Y: for<'a> MiniYokeable<'a>> {
10+
pub yokeable: Y,
11+
}
12+
13+
fn map_project_broken<Y, P>(
14+
source: MiniYoke<Y>,
15+
f: impl for<'a> FnOnce(
16+
<Y as MiniYokeable<'a>>::Output,
17+
core::marker::PhantomData<&'a ()>,
18+
) -> <P as MiniYokeable<'a>>::Output,
19+
) -> MiniYoke<P>
20+
where
21+
Y: for<'a> MiniYokeable<'a>,
22+
P: for<'a> MiniYokeable<'a>
23+
{
24+
unimplemented!()
25+
}
26+
27+
struct Bar<'a> {
28+
string_1: &'a str,
29+
string_2: &'a str,
30+
}
31+
32+
impl<'a> MiniYokeable<'a> for Bar<'static> {
33+
type Output = Bar<'a>;
34+
}
35+
36+
impl<'a> MiniYokeable<'a> for &'static str {
37+
type Output = &'a str;
38+
}
39+
40+
fn demo_broken(bar: MiniYoke<Bar<'static>>) -> MiniYoke<&'static str> {
41+
map_project_broken(bar, |bar, _| bar.string_1)
42+
}
43+
44+
fn main() {}

0 commit comments

Comments
 (0)