As pointed out by #1113, the ? operator can also represent an exit point within a Rust function, and therefore, it must be counted in the nexits metric.
However, not all Rust::QMARK nodes should be 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>, doesn't represent an exit point.
As pointed out by #1113, the
?
operator can also represent an exit point within a Rust function, and therefore, it must be counted in thenexits
metric.However, not all
Rust::QMARK
nodes should be counted as exit points. For example, in this code:the
?
on the first line, inside<T: ?Sized>
, doesn't represent an exit point.