Skip to content

Commit

Permalink
Add 67684
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm committed Dec 19, 2020
1 parent 36e9c56 commit bae89cd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ices/67684.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

rustc -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib - << 'EOF'
trait ParseError {
type StreamError;
}
impl<T> ParseError for T {
type StreamError = ();
}
trait Stream {
type Error;
}
trait Parser
where
<Self as Parser>::PartialState: Default,
{
type PartialState;
fn parse_mode(&Self, Self::PartialState) {}
}
struct AndThen<A, B>(core::marker::PhantomData<(A, B)>);
impl<A, B> Parser for AndThen<A, B>
where
A: Stream,
B: Into<<A::Error as ParseError>::StreamError>,
{
type PartialState = ();
}
fn expr<A>() -> impl Parser
where
A: Stream,
{
AndThen::<A, ()>(core::marker::PhantomData)
}
fn parse_mode_impl<A>()
where
A::Error: ParseError,
A: Stream,
{
Parser::parse_mode(&expr::<A>(), Default::default())
}
EOF

0 comments on commit bae89cd

Please sign in to comment.