File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,17 @@ fn parse(webidl_source: &str, allowed_types: Option<&[&str]>) -> Result<Program>
68
68
. context ( ErrorKind :: ParsingWebIDLSource )
69
69
. into ( ) ,
70
70
weedle:: Err :: Error ( cx) | weedle:: Err :: Failure ( cx) => {
71
+ // Note that #[allow] here is a workaround for Geal/nom#843
72
+ // because the `Context` type here comes from `nom` and if
73
+ // something else in our crate graph enables the
74
+ // `verbose-errors` feature then we need to still compiled
75
+ // against the changed enum definition.
76
+ #[ allow( unreachable_patterns) ]
71
77
let remaining = match cx {
72
- weedle:: Context :: Code ( remaining, _) => remaining,
78
+ weedle:: Context :: Code ( remaining, _) => remaining. len ( ) ,
79
+ _ => 0 ,
73
80
} ;
74
- let pos = webidl_source. len ( ) - remaining. len ( ) ;
81
+ let pos = webidl_source. len ( ) - remaining;
75
82
format_err ! ( "failed to parse WebIDL" )
76
83
. context ( ErrorKind :: ParsingWebIDLSourcePos ( pos) )
77
84
. into ( )
You can’t perform that action at this time.
0 commit comments