]> git.lizzy.rs Git - rust.git/commit
Remove `StringReader::col`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 8 May 2018 09:58:54 +0000 (19:58 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Mon, 14 May 2018 04:41:34 +0000 (14:41 +1000)
commite913d692117e57ea2908461865aa08037f0bd2b9
treeb756de98b23cedccbf0fd731d3c7e71876960f5c
parent444b770f4cd8d817e7b7fec683ea301620034d13
Remove `StringReader::col`.

It only has a single use, within code handling indented block comments.
We can replace that with the new `FileMap::col_pos()`, which computes
the col position (BytePos instead of CharPos) based on the record of the
last newline char (which we already record).

This is actually an improvement, because
`trim_whitespace_prefix_and_push_line()` was using `col`, which is a
`CharPos`, as a slice index, which is a byte/char confusion.
src/libsyntax/parse/lexer/comments.rs
src/libsyntax/parse/lexer/mod.rs
src/libsyntax_pos/lib.rs