mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-09 16:37:36 +00:00
Split the assertion in NodeRange::new
.
This commit is contained in:
parent
0bae33fcd5
commit
39b38a94e3
@ -238,7 +238,8 @@ impl NodeRange {
|
||||
// is the position of the function's start token. This gives
|
||||
// `NodeRange(10..15)`.
|
||||
fn new(ParserRange(parser_range): ParserRange, start_pos: u32) -> NodeRange {
|
||||
assert!(parser_range.start >= start_pos && parser_range.end >= start_pos);
|
||||
assert!(!parser_range.is_empty());
|
||||
assert!(parser_range.start >= start_pos);
|
||||
NodeRange((parser_range.start - start_pos)..(parser_range.end - start_pos))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user