[−][src]Struct rustc_mir::borrow_check::diagnostics::outlives_suggestion::OutlivesSuggestionBuilder

pub struct OutlivesSuggestionBuilder {
    constraints_to_add: BTreeMap<RegionVid, Vec<RegionVid>>,
}

Collects information about outlives constraints that needed to be added for a given MIR node corresponding to a function definition.

Adds a help note suggesting adding a where clause with the needed constraints.

Fields

constraints_to_add: BTreeMap<RegionVid, Vec<RegionVid>>

The list of outlives constraints that need to be added. Specifically, we map each free region to all other regions that it must outlive. I will use the shorthand fr: outlived_frs. Not all of these regions will already have names necessarily. Some could be implicit free regions that we inferred. These will need to be given names in the final suggestion message.

Implementations

impl OutlivesSuggestionBuilder[src]

pub(in borrow_check::diagnostics::outlives_suggestion) fn region_name_is_suggestable(
    name: &RegionName
) -> bool
[src]

Returns true iff the RegionNameSource is a valid source for an outlives suggestion.

pub(in borrow_check::diagnostics::outlives_suggestion) fn region_vid_to_name(
    &self,
    mbcx: &MirBorrowckCtxt<'_, '_>,
    region: RegionVid
) -> Option<RegionName>
[src]

Returns a name for the region if it is suggestable. See region_name_is_suggestable.

pub(in borrow_check::diagnostics::outlives_suggestion) fn compile_all_suggestions(
    &self,
    mbcx: &MirBorrowckCtxt<'_, '_>
) -> SmallVec<[SuggestedConstraint; 2]>
[src]

Compiles a list of all suggestions to be printed in the final big suggestion.

pub(crate) fn collect_constraint(
    &mut self,
    fr: RegionVid,
    outlived_fr: RegionVid
)
[src]

Add the outlives constraint fr: outlived_fr to the set of constraints we need to suggest.

pub(crate) fn intermediate_suggestion(
    &mut self,
    mbcx: &MirBorrowckCtxt<'_, '_>,
    errci: &ErrorConstraintInfo,
    diag: &mut DiagnosticBuilder<'_>
)
[src]

Emit an intermediate note on the given Diagnostic if the involved regions are suggestable.

pub(crate) fn add_suggestion(&self, mbcx: &mut MirBorrowckCtxt<'_, '_>)[src]

If there is a suggestion to emit, add a diagnostic to the buffer. This is the final suggestion including all collected constraints.

Trait Implementations

impl Default for OutlivesSuggestionBuilder[src]

Auto Trait Implementations

impl RefUnwindSafe for OutlivesSuggestionBuilder

impl Send for OutlivesSuggestionBuilder

impl Sync for OutlivesSuggestionBuilder

impl Unpin for OutlivesSuggestionBuilder

impl UnwindSafe for OutlivesSuggestionBuilder

Blanket Implementations

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

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

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

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

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

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.

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.

impl<T> WithConstness for T[src]