Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Fix Issue 38777 When looking through for a closing bracket in the loop condition, adds them to expecteds. https://github.com/rust-lang/rust/issues/38777
This commit is contained in:
@@ -652,7 +652,7 @@ impl<'a> Parser<'a> {
|
||||
Err(err)
|
||||
}
|
||||
} else {
|
||||
self.expect_one_of(unsafe { slice::from_raw_parts(t, 1) }, &[])
|
||||
self.expect_one_of(slice::from_ref(t), &[])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1108,7 +1108,12 @@ impl<'a> Parser<'a> {
|
||||
{
|
||||
let mut first: bool = true;
|
||||
let mut v = vec![];
|
||||
while !kets.contains(&&self.token) {
|
||||
while !kets.iter().any(|k| {
|
||||
match expect {
|
||||
TokenExpectType::Expect => self.check(k),
|
||||
TokenExpectType::NoExpect => self.token == **k,
|
||||
}
|
||||
}) {
|
||||
match self.token {
|
||||
token::CloseDelim(..) | token::Eof => break,
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user