[−][src]Struct rustc_mir::borrow_check::diagnostics::outlives_suggestion::OutlivesSuggestionBuilder
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]
name: &RegionName
) -> bool
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]
&self,
mbcx: &MirBorrowckCtxt<'_, '_>,
region: RegionVid
) -> Option<RegionName>
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]
&self,
mbcx: &MirBorrowckCtxt<'_, '_>
) -> SmallVec<[SuggestedConstraint; 2]>
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]
&mut self,
fr: RegionVid,
outlived_fr: RegionVid
)
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]
&mut self,
mbcx: &MirBorrowckCtxt<'_, '_>,
errci: &ErrorConstraintInfo,
diag: &mut DiagnosticBuilder<'_>
)
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]
pub fn default() -> 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.