File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments