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 for AnnotationColumn
impl PartialEq 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 for AnnotationColumn
impl PartialOrd 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 StructuralPartialEq for AnnotationColumn
Auto Trait Implementations§
impl DynSend for AnnotationColumn
impl DynSync for AnnotationColumn
impl Freeze for AnnotationColumn
impl RefUnwindSafe for AnnotationColumn
impl Send for AnnotationColumn
impl Sync for AnnotationColumn
impl Unpin for AnnotationColumn
impl UnwindSafe for AnnotationColumn
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
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
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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