Skip to content

Commit 3fef3d8

Browse files
committed
Add @weiznich's regression test
1 parent c431cd7 commit 3fef3d8

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// check-pass
2+
// compile-flags: --emit=mir,link
3+
// Regression test for issue #68264
4+
// Checks that we don't encounter overflow
5+
// when running const-prop on functions with
6+
// complicated bounds
7+
pub trait Query {}
8+
9+
pub trait AsQuery {
10+
type Query: Query;
11+
}
12+
pub trait Table: AsQuery + Sized {}
13+
14+
pub trait LimitDsl {
15+
type Output;
16+
}
17+
18+
pub(crate) trait LoadQuery<Conn, U>: RunQueryDsl<Conn> {}
19+
20+
impl<T: Query> AsQuery for T {
21+
type Query = Self;
22+
}
23+
24+
impl<T> LimitDsl for T
25+
where
26+
T: Table,
27+
T::Query: LimitDsl,
28+
{
29+
type Output = <T::Query as LimitDsl>::Output;
30+
}
31+
32+
pub(crate) trait RunQueryDsl<Conn>: Sized {
33+
fn first<U>(self, _conn: &Conn) -> U
34+
where
35+
Self: LimitDsl,
36+
Self::Output: LoadQuery<Conn, U>,
37+
{
38+
// Overflow is caused by this function body
39+
unimplemented!()
40+
}
41+
}
42+
43+
fn main() {}

0 commit comments

Comments
 (0)