Struct rustc_middle::ty::print::pretty::RegionHighlightMode[−][src]

pub struct RegionHighlightMode {
    highlight_regions: [Option<(RegionKind, usize)>; 3],
    highlight_bound_region: Option<(BoundRegionKind, usize)>,
}
Expand description

The “region highlights” are used to control region printing during specific error messages. When a “region highlight” is enabled, it gives an alternate way to print specific regions. For now, we always print those regions using a number, so something like “'0”.

Regions not selected by the region highlight mode are presently unaffected.

Fields

highlight_regions: [Option<(RegionKind, usize)>; 3]
Expand description

If enabled, when we see the selected region, use “'N” instead of the ordinary behavior.

highlight_bound_region: Option<(BoundRegionKind, usize)>
Expand description

If enabled, when printing a “free region” that originated from the given ty::BoundRegionKind, print it as “'1”. Free regions that would ordinarily have names print as normal.

This is used when you have a signature like fn foo(x: &u32, y: &'a u32) and we want to give a name to the region of the reference x.

Implementations

impl RegionHighlightMode[src]

pub fn maybe_highlighting_region(
    &mut self,
    region: Option<Region<'_>>,
    number: Option<usize>
)
[src]

If region and number are both Some, invokes highlighting_region.

pub fn highlighting_region(&mut self, region: Region<'_>, number: usize)[src]

Highlights the region inference variable vid as 'N.

pub fn highlighting_region_vid(&mut self, vid: RegionVid, number: usize)[src]

Convenience wrapper for highlighting_region.

fn region_highlighted(&self, region: Region<'_>) -> Option<usize>[src]

Returns Some(n) with the number to use for the given region, if any.

pub fn highlighting_bound_region(&mut self, br: BoundRegionKind, number: usize)[src]

Highlight the given bound region. We can only highlight one bound region at a time. See the field highlight_bound_region for more detailed notes.

Trait Implementations

impl Clone for RegionHighlightMode[src]

fn clone(&self) -> RegionHighlightMode[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for RegionHighlightMode[src]

fn default() -> RegionHighlightMode[src]

Returns the “default value” for a type. Read more

impl Copy for RegionHighlightMode[src]

Auto Trait Implementations

impl RefUnwindSafe for RegionHighlightMode

impl Send for RegionHighlightMode

impl Sync for RegionHighlightMode

impl Unpin for RegionHighlightMode

impl UnwindSafe for RegionHighlightMode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy, 
[src]

pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]

pub fn allocate_from_iter(
    &'a Arena<'tcx>,
    impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> MaybeResult<T> for T[src]

type Error = !

pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]

pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]