Skip to content

Commit 7976cd6

Browse files
authored
Rollup merge of #99257 - Manishearth:regression, r=jackh726
Add regression test for #89436 I never got around to adding such a test. In general I think the `yoke` crate has a bunch of interesting testcases that exercise various edges of the algorithms here, it would be nice if we could simply depend on the crate and add some tests that exercise it, but I don't think that's possible. Do you or `@eddyb` think there's any use trying to upstream a bunch of common yoke minimal working example code to the testsuite and having a ton of yoke tests?
2 parents 6dae197 + 62edbbe commit 7976cd6

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)