Skip to content

Commit 72a2102

Browse files
committed
add test
1 parent 71f8fd5 commit 72a2102

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Taken directly from that issue.
2+
//
3+
// This test detected that we didn't correctly resolve
4+
// inference variables when computing implied bounds.
5+
//
6+
// check-pass
7+
pub trait BuilderFn<'a> {
8+
type Output;
9+
}
10+
11+
impl<'a, F, Out> BuilderFn<'a> for F
12+
where
13+
F: FnOnce(&'a mut ()) -> Out,
14+
{
15+
type Output = Out;
16+
}
17+
18+
pub trait ConstructionFirm {
19+
type Builder: for<'a> BuilderFn<'a>;
20+
}
21+
22+
pub trait Campus<T>
23+
where
24+
T: ConstructionFirm,
25+
{
26+
fn add_building(
27+
&mut self,
28+
building: &mut <<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output,
29+
);
30+
}
31+
32+
struct ArchitectsInc {}
33+
34+
impl ConstructionFirm for ArchitectsInc {
35+
type Builder = fn(&mut ()) -> PrettyCondo<'_>;
36+
}
37+
38+
struct PrettyCondo<'a> {
39+
_marker: &'a mut (),
40+
}
41+
42+
struct CondoEstate {}
43+
44+
impl Campus<ArchitectsInc> for CondoEstate {
45+
fn add_building(&mut self, _building: &mut PrettyCondo<'_>) {
46+
todo!()
47+
}
48+
}
49+
50+
fn main() {}

0 commit comments

Comments
 (0)