Skip to content

Commit 9ce8f74

Browse files
committed
Add 67684
Issue: rust-lang/rust#67684
1 parent cb6f961 commit 9ce8f74

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

ices/67684.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
rustc -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib - << 'EOF'
4+
trait ParseError {
5+
type StreamError;
6+
}
7+
impl<T> ParseError for T {
8+
type StreamError = ();
9+
}
10+
trait Stream {
11+
type Error;
12+
}
13+
trait Parser
14+
where
15+
<Self as Parser>::PartialState: Default,
16+
{
17+
type PartialState;
18+
fn parse_mode(&Self, Self::PartialState) {}
19+
}
20+
struct AndThen<A, B>(core::marker::PhantomData<(A, B)>);
21+
impl<A, B> Parser for AndThen<A, B>
22+
where
23+
A: Stream,
24+
B: Into<<A::Error as ParseError>::StreamError>,
25+
{
26+
type PartialState = ();
27+
}
28+
fn expr<A>() -> impl Parser
29+
where
30+
A: Stream,
31+
{
32+
AndThen::<A, ()>(core::marker::PhantomData)
33+
}
34+
fn parse_mode_impl<A>()
35+
where
36+
A::Error: ParseError,
37+
A: Stream,
38+
{
39+
Parser::parse_mode(&expr::<A>(), Default::default())
40+
}
41+
EOF

0 commit comments

Comments
 (0)