We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
NodeRange::new
1 parent c44336c commit 88cbb7bCopy full SHA for 88cbb7b
compiler/rustc_parse/src/parser/mod.rs
@@ -237,6 +237,7 @@ impl NodeRange {
237
// is the position of the function's start token. This gives
238
// `NodeRange(10..15)`.
239
fn new(ParserRange(parser_range): ParserRange, start_pos: u32) -> NodeRange {
240
+ assert!(parser_range.start >= start_pos);
241
NodeRange((parser_range.start - start_pos)..(parser_range.end - start_pos))
242
}
243
0 commit comments