]> git.proxmox.com Git - rustc.git/blame - src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89436.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / higher-rank-trait-bounds / normalize-under-binder / issue-89436.rs
CommitLineData
064997fb
FG
1// check-pass
2
3#![allow(unused)]
4
5trait MiniYokeable<'a> {
6 type Output;
7}
8
9struct MiniYoke<Y: for<'a> MiniYokeable<'a>> {
10 pub yokeable: Y,
11}
12
13fn 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>
20where
21 Y: for<'a> MiniYokeable<'a>,
22 P: for<'a> MiniYokeable<'a>
23{
24 unimplemented!()
25}
26
27struct Bar<'a> {
28 string_1: &'a str,
29 string_2: &'a str,
30}
31
32impl<'a> MiniYokeable<'a> for Bar<'static> {
33 type Output = Bar<'a>;
34}
35
36impl<'a> MiniYokeable<'a> for &'static str {
37 type Output = &'a str;
38}
39
40fn demo_broken(bar: MiniYoke<Bar<'static>>) -> MiniYoke<&'static str> {
41 map_project_broken(bar, |bar, _| bar.string_1)
42}
43
44fn main() {}