CharPos in rustc_span - Rust (original) (raw)
pub struct CharPos(pub usize);
Expand description
A character offset.
Because of multibyte UTF-8 characters, a byte offset is not equivalent to a character offset. The SourceMap will convert BytePosvalues to CharPos
values as necessary.
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes