Closed samueltardieu closed 2 months ago
Is there something missing for this PR to be reviewed and merged?
While working on #1091, I noticed that some tests are failing because all nodes corresponding to a Rust::QMARK
are mistakenly counted as exit points.
For example, in this code:
pub fn assert_ser_tokens<T: ?Sized>(value: &T, tokens: &[Token])
where
T: Serialize,
{
let mut ser = Serializer::new(tokens);
match value.serialize(&mut ser) {
Ok(_) => {}
Err(err) => panic!("value failed to serialize: {}", err),
}
if ser.remaining() > 0 {
panic!("{} remaining tokens", ser.remaining());
}
}
the ?
on the first line, inside <T: ?Sized>
, should not be counted as an exit point.
Therefore, adding Rust::QMARK
in an OR condition with Rust::ReturnExpression
doesn't fully address the issue.
@alexle0nte could you file a bug please ? @samueltardieu would you mind to have a look on it ?
Thank you.
A question mark operator
?
may exit the current function the same way areturn
will. It must be counted in the "nexits" statistics.