Skip to content

Commit e249f2e

Browse files
committed
move raw span to tt reader
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for explanation how jointness checking works with *next* pair
1 parent b91e0a3 commit e249f2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/parse/lexer/tokentrees.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ impl<'a> TokenTreesReader<'a> {
207207
// Note that testing for joint-ness here is done via the raw
208208
// source span as the joint-ness is a property of the raw source
209209
// rather than wanting to take `override_span` into account.
210+
// Additionally, we actually check if the *next* pair of tokens
211+
// is joint, but this is equivalent to checking the current pair.
210212
let raw = self.string_reader.peek_span_src_raw;
211213
self.real_token();
212214
let is_joint = raw.hi() == self.string_reader.peek_span_src_raw.lo()
@@ -222,4 +224,3 @@ impl<'a> TokenTreesReader<'a> {
222224
self.span = t.sp;
223225
}
224226
}
225-

0 commit comments

Comments
 (0)