Struct rustc_errors::snippet::AnnotationColumn
source · pub struct AnnotationColumn {
pub display: usize,
pub file: usize,
}
Fields§
§display: usize
the (0-indexed) column for display purposes, counted in characters, not utf-8 bytes
file: usize
the (0-indexed) column in the file, counted in characters, not utf-8 bytes.
this may be different from self.display
,
e.g. if the file contains hard tabs, because we convert tabs to spaces for error messages.
for example:
(hard tab)hello
^ this is display column 4, but file column 1
we want to keep around the correct file offset so that column numbers in error messages are correct. (motivated by https://github.com/rust-lang/rust/issues/109537)
Implementations§
source§impl AnnotationColumn
impl AnnotationColumn
pub fn from_loc(loc: &Loc) -> AnnotationColumn
Trait Implementations§
source§impl Clone for AnnotationColumn
impl Clone for AnnotationColumn
source§fn clone(&self) -> AnnotationColumn
fn clone(&self) -> AnnotationColumn
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AnnotationColumn
impl Debug for AnnotationColumn
source§impl Default for AnnotationColumn
impl Default for AnnotationColumn
source§fn default() -> AnnotationColumn
fn default() -> AnnotationColumn
Returns the “default value” for a type. Read more
source§impl Ord for AnnotationColumn
impl Ord for AnnotationColumn
source§fn cmp(&self, other: &AnnotationColumn) -> Ordering
fn cmp(&self, other: &AnnotationColumn) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AnnotationColumn> for AnnotationColumn
impl PartialEq<AnnotationColumn> for AnnotationColumn
source§fn eq(&self, other: &AnnotationColumn) -> bool
fn eq(&self, other: &AnnotationColumn) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AnnotationColumn> for AnnotationColumn
impl PartialOrd<AnnotationColumn> for AnnotationColumn
source§fn partial_cmp(&self, other: &AnnotationColumn) -> Option<Ordering>
fn partial_cmp(&self, other: &AnnotationColumn) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for AnnotationColumn
impl Eq for AnnotationColumn
impl StructuralEq for AnnotationColumn
impl StructuralPartialEq for AnnotationColumn
Auto Trait Implementations§
impl RefUnwindSafe for AnnotationColumn
impl Send for AnnotationColumn
impl Sync for AnnotationColumn
impl Unpin for AnnotationColumn
impl UnwindSafe for AnnotationColumn
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout§
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: 16 bytes