[−][src]Struct rustc_mir::borrow_check::MirBorrowckCtxt
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
tcx: TyCtxt<'cx, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
mir: &'cx Mir<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
mir_def_id: DefId
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
move_data: &'cx MoveData<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
location_table: &'cx LocationTable
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Map from MIR Location
to LocationIndex
; created
when MIR borrowck begins.
param_env: ParamEnv<'gcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
movable_generator: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
locals_are_invalidated_at_exit: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This keeps track of whether local variables are free-ed when the function
exits even without a StorageDead
, which appears to be the case for
constants.
I'm not sure this is the right approach - @eddyb could you try and figure this out?
access_place_error_reported: FxHashSet<(Place<'tcx>, Span)>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This field keeps track of when borrow errors are reported in the access_place function
so that there is no duplicate reporting. This field cannot also be used for the conflicting
borrow errors that is handled by the reservation_error_reported
field as the inclusion
of the Span
type (while required to mute some errors) stops the muting of the reservation
errors.
reservation_error_reported: FxHashSet<Place<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This field keeps track of when borrow conflict errors are reported for reservations, so that we don't report seemingly duplicate errors for corresponding activations
FIXME: Ideally this would be a set of BorrowIndex, not Places, but it is currently inconvenient to track down the BorrowIndex at the time we detect and report a reservation error.
moved_error_reported: FxHashSet<Place<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This field keeps track of errors reported in the checking of moved variables, so that we don't report seemingly duplicate errors.
errors_buffer: Vec<Diagnostic>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Errors to be reported buffer
used_mut: FxHashSet<Local>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This field keeps track of all the local variables that are declared mut and are mutated. Used for the warning issued by an unused mutable local variable.
used_mut_upvars: SmallVec<[Field; 8]>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
If the function we're checking is a closure, then we'll need to report back the list of mutable upvars that have been used. This field keeps track of them.
nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Non-lexical region inference context, if NLL is enabled. This contains the results from region inference and lets us e.g. find out which CFG points are contained in each borrow region.
borrow_set: Rc<BorrowSet<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The set of borrows extracted from the MIR
dominators: Dominators<BasicBlock>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Dominators for MIR
Methods
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
pub(super) fn report_use_of_moved_or_uninitialized(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
(place, span): (&Place<'tcx>, Span),
mpi: MovePathIndex
)
[src]
pub(super) fn report_use_of_moved_or_uninitialized(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
(place, span): (&Place<'tcx>, Span),
mpi: MovePathIndex
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_move_out_while_borrowed(
&mut self,
context: Context,
(place, _span): (&Place<'tcx>, Span),
borrow: &BorrowData<'tcx>
)
[src]
pub(super) fn report_move_out_while_borrowed(
&mut self,
context: Context,
(place, _span): (&Place<'tcx>, Span),
borrow: &BorrowData<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_use_while_mutably_borrowed(
&mut self,
context: Context,
(place, _span): (&Place<'tcx>, Span),
borrow: &BorrowData<'tcx>
)
[src]
pub(super) fn report_use_while_mutably_borrowed(
&mut self,
context: Context,
(place, _span): (&Place<'tcx>, Span),
borrow: &BorrowData<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_conflicting_borrow(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
gen_borrow_kind: BorrowKind,
issued_borrow: &BorrowData<'tcx>
)
[src]
pub(super) fn report_conflicting_borrow(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
gen_borrow_kind: BorrowKind,
issued_borrow: &BorrowData<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_borrowed_value_does_not_live_long_enough(
&mut self,
context: Context,
borrow: &BorrowData<'tcx>,
place_span: (&Place<'tcx>, Span),
kind: Option<WriteKind>
)
[src]
pub(super) fn report_borrowed_value_does_not_live_long_enough(
&mut self,
context: Context,
borrow: &BorrowData<'tcx>,
place_span: (&Place<'tcx>, Span),
kind: Option<WriteKind>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn report_local_value_does_not_live_long_enough(
&mut self,
context: Context,
name: &String,
scope_tree: &Lrc<ScopeTree>,
borrow: &BorrowData<'tcx>,
reason: BorrowContainsPointReason<'tcx>,
drop_span: Span,
borrow_span: Span,
kind_place: Option<(WriteKind, &Place<'tcx>)>
) -> DiagnosticBuilder<'cx>
[src]
fn report_local_value_does_not_live_long_enough(
&mut self,
context: Context,
name: &String,
scope_tree: &Lrc<ScopeTree>,
borrow: &BorrowData<'tcx>,
reason: BorrowContainsPointReason<'tcx>,
drop_span: Span,
borrow_span: Span,
kind_place: Option<(WriteKind, &Place<'tcx>)>
) -> DiagnosticBuilder<'cx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn report_thread_local_value_does_not_live_long_enough(
&mut self,
drop_span: Span,
borrow_span: Span
) -> DiagnosticBuilder<'cx>
[src]
fn report_thread_local_value_does_not_live_long_enough(
&mut self,
drop_span: Span,
borrow_span: Span
) -> DiagnosticBuilder<'cx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn report_temporary_value_does_not_live_long_enough(
&mut self,
context: Context,
scope_tree: &Lrc<ScopeTree>,
borrow: &BorrowData<'tcx>,
reason: BorrowContainsPointReason<'tcx>,
drop_span: Span,
proper_span: Span
) -> DiagnosticBuilder<'cx>
[src]
fn report_temporary_value_does_not_live_long_enough(
&mut self,
context: Context,
scope_tree: &Lrc<ScopeTree>,
borrow: &BorrowData<'tcx>,
reason: BorrowContainsPointReason<'tcx>,
drop_span: Span,
proper_span: Span
) -> DiagnosticBuilder<'cx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn get_moved_indexes(
&mut self,
context: Context,
mpi: MovePathIndex
) -> Vec<MoveOutIndex>
[src]
fn get_moved_indexes(
&mut self,
context: Context,
mpi: MovePathIndex
) -> Vec<MoveOutIndex>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_illegal_mutation_of_borrowed(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
loan: &BorrowData<'tcx>
)
[src]
pub(super) fn report_illegal_mutation_of_borrowed(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
loan: &BorrowData<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn report_illegal_reassignment(
&mut self,
_context: Context,
(place, span): (&Place<'tcx>, Span),
assigned_span: Span,
err_place: &Place<'tcx>
)
[src]
pub(super) fn report_illegal_reassignment(
&mut self,
_context: Context,
(place, span): (&Place<'tcx>, Span),
assigned_span: Span,
err_place: &Place<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Reports an illegal reassignment; for example, an assignment to
(part of) a non-mut
local that occurs potentially after that
local has already been initialized. place
is the path being
assigned; err_place
is a place providing a reason why
place
is not mutable (e.g. the non-mut
local x
in an
assignment to x.f
).
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
pub(super) fn describe_place(
&self,
place: &Place<'tcx>
) -> Option<String>
[src]
pub(super) fn describe_place(
&self,
place: &Place<'tcx>
) -> Option<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub(super) fn describe_place_with_options(
&self,
place: &Place<'tcx>,
including_downcast: IncludingDowncast
) -> Option<String>
[src]
pub(super) fn describe_place_with_options(
&self,
place: &Place<'tcx>,
including_downcast: IncludingDowncast
) -> Option<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn append_place_to_string(
&self,
place: &Place<'tcx>,
buf: &mut String,
autoderef: bool,
including_downcast: &IncludingDowncast
) -> Result<(), ()>
[src]
fn append_place_to_string(
&self,
place: &Place<'tcx>,
buf: &mut String,
autoderef: bool,
including_downcast: &IncludingDowncast
) -> Result<(), ()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn append_local_to_string(
&self,
local_index: Local,
buf: &mut String
) -> Result<(), ()>
[src]
fn append_local_to_string(
&self,
local_index: Local,
buf: &mut String
) -> Result<(), ()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn describe_field(&self, base: &Place, field: Field) -> String
[src]
fn describe_field(&self, base: &Place, field: Field) -> String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn describe_field_from_ty(&self, ty: &Ty, field: Field) -> String
[src]
fn describe_field_from_ty(&self, ty: &Ty, field: Field) -> String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn retrieve_type_for_place(&self, place: &Place<'tcx>) -> Option<Ty>
[src]
fn retrieve_type_for_place(&self, place: &Place<'tcx>) -> Option<Ty>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn is_place_thread_local(&self, place: &Place<'tcx>) -> bool
[src]
pub fn is_place_thread_local(&self, place: &Place<'tcx>) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Check if a place is a thread-local static.
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
pub(super) fn move_spans(
&self,
moved_place: &Place<'tcx>,
location: Location
) -> UseSpans
[src]
pub(super) fn move_spans(
&self,
moved_place: &Place<'tcx>,
location: Location
) -> UseSpans
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Finds the spans associated to a move or copy of move_place at location.
pub(super) fn borrow_spans(
&self,
use_span: Span,
location: Location
) -> UseSpans
[src]
pub(super) fn borrow_spans(
&self,
use_span: Span,
location: Location
) -> UseSpans
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Finds the span of arguments of a closure (within maybe_closure_span
)
and its usage of the local assigned at location
.
This is done by searching in statements succeeding location
and originating from maybe_closure_span
.
pub(super) fn retrieve_borrow_spans(
&self,
borrow: &BorrowData
) -> UseSpans
[src]
pub(super) fn retrieve_borrow_spans(
&self,
borrow: &BorrowData
) -> UseSpans
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Helper to retrieve span(s) of given borrow from the current MIR representation
impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx>
pub(crate) fn report_move_errors(
&mut self,
move_errors: Vec<(Place<'tcx>, MoveError<'tcx>)>
)
[src]
pub(crate) fn report_move_errors(
&mut self,
move_errors: Vec<(Place<'tcx>, MoveError<'tcx>)>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn group_move_errors(
&self,
errors: Vec<(Place<'tcx>, MoveError<'tcx>)>
) -> Vec<GroupedMoveError<'tcx>>
[src]
fn group_move_errors(
&self,
errors: Vec<(Place<'tcx>, MoveError<'tcx>)>
) -> Vec<GroupedMoveError<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn append_to_grouped_errors(
&self,
grouped_errors: &mut Vec<GroupedMoveError<'tcx>>,
original_path: Place<'tcx>,
error: MoveError<'tcx>
)
[src]
fn append_to_grouped_errors(
&self,
grouped_errors: &mut Vec<GroupedMoveError<'tcx>>,
original_path: Place<'tcx>,
error: MoveError<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn append_binding_error(
&self,
grouped_errors: &mut Vec<GroupedMoveError<'tcx>>,
kind: IllegalMoveOriginKind<'tcx>,
original_path: Place<'tcx>,
move_from: &Place<'tcx>,
bind_to: Local,
match_place: &Option<Place<'tcx>>,
match_span: Span,
statement_span: Span
)
[src]
fn append_binding_error(
&self,
grouped_errors: &mut Vec<GroupedMoveError<'tcx>>,
kind: IllegalMoveOriginKind<'tcx>,
original_path: Place<'tcx>,
move_from: &Place<'tcx>,
bind_to: Local,
match_place: &Option<Place<'tcx>>,
match_span: Span,
statement_span: Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn report(&mut self, error: GroupedMoveError<'tcx>)
[src]
fn report(&mut self, error: GroupedMoveError<'tcx>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn add_move_hints(
&self,
error: GroupedMoveError<'tcx>,
err: &mut DiagnosticBuilder<'a>,
span: Span
)
[src]
fn add_move_hints(
&self,
error: GroupedMoveError<'tcx>,
err: &mut DiagnosticBuilder<'a>,
span: Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn add_move_error_suggestions(
&self,
err: &mut DiagnosticBuilder<'a>,
binds_to: &[Local]
)
[src]
fn add_move_error_suggestions(
&self,
err: &mut DiagnosticBuilder<'a>,
binds_to: &[Local]
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn add_move_error_details(
&self,
err: &mut DiagnosticBuilder<'a>,
binds_to: &[Local]
)
[src]
fn add_move_error_details(
&self,
err: &mut DiagnosticBuilder<'a>,
binds_to: &[Local]
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx>
pub(super) fn report_mutability_error(
&mut self,
access_place: &Place<'tcx>,
span: Span,
the_place_err: &Place<'tcx>,
error_access: AccessKind,
location: Location
)
[src]
pub(super) fn report_mutability_error(
&mut self,
access_place: &Place<'tcx>,
span: Span,
the_place_err: &Place<'tcx>,
error_access: AccessKind,
location: Location
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
ⓘImportant traits for Prefixes<'cx, 'gcx, 'tcx>pub(super) fn prefixes(
&self,
place: &'cx Place<'tcx>,
kind: PrefixSet
) -> Prefixes<'cx, 'gcx, 'tcx>
[src]
pub(super) fn prefixes(
&self,
place: &'cx Place<'tcx>,
kind: PrefixSet
) -> Prefixes<'cx, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns an iterator over the prefixes of place
(inclusive) from longest to smallest, potentially
terminating the iteration early based on kind
.
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
pub(crate) fn gather_used_muts(&mut self, locals: FxHashSet<Local>)
[src]
pub(crate) fn gather_used_muts(&mut self, locals: FxHashSet<Local>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Walks the MIR looking for assignments to a set of locals, as part of the unused mutable
local variables lint, to update the context's used_mut
in a single walk.
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
pub(in borrow_check) fn explain_why_borrow_contains_point(
&self,
context: Context,
borrow: &BorrowData<'tcx>,
kind_place: Option<(WriteKind, &Place<'tcx>)>,
err: &mut DiagnosticBuilder
)
[src]
pub(in borrow_check) fn explain_why_borrow_contains_point(
&self,
context: Context,
borrow: &BorrowData<'tcx>,
kind_place: Option<(WriteKind, &Place<'tcx>)>,
err: &mut DiagnosticBuilder
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Adds annotations to err
explaining why the borrow contains the
point from context
. This is key for the "3-point errors"
described in the NLL RFC.
Parameters
borrow
: the borrow in questioncontext
: where the borrow occurskind_place
: if Some, this describes the statement that triggered the error.- first half is the kind of write, if any, being performed
- second half is the place being accessed
err
: where the error annotations are going to be added
pub(in borrow_check) fn find_why_borrow_contains_point(
&self,
context: Context,
borrow: &BorrowData<'tcx>
) -> BorrowContainsPointReason<'tcx>
[src]
pub(in borrow_check) fn find_why_borrow_contains_point(
&self,
context: Context,
borrow: &BorrowData<'tcx>
) -> BorrowContainsPointReason<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Finds the reason that [explain_why_borrow_contains_point] will report but doesn't add it to any message. This is a separate function in case the caller wants to change the error they report based on the reason that will be reported.
pub(in borrow_check) fn report_why_borrow_contains_point(
&self,
err: &mut DiagnosticBuilder,
reason: BorrowContainsPointReason<'tcx>,
kind_place: Option<(WriteKind, &Place<'tcx>)>
)
[src]
pub(in borrow_check) fn report_why_borrow_contains_point(
&self,
err: &mut DiagnosticBuilder,
reason: BorrowContainsPointReason<'tcx>,
kind_place: Option<(WriteKind, &Place<'tcx>)>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Adds annotations to err
for the explanation reason
. This is a
separate method so that the caller can change their error message based
on the reason that is going to be reported.
fn is_borrow_location_in_loop(&self, borrow_location: Location) -> bool
[src]
fn is_borrow_location_in_loop(&self, borrow_location: Location) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Check if a borrow location is within a loop.
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
fn visit_terminator_drop(
&mut self,
loc: Location,
term: &Terminator<'tcx>,
flow_state: &Flows<'cx, 'gcx, 'tcx>,
drop_place: &Place<'tcx>,
erased_drop_place_ty: Ty<'gcx>,
span: Span,
prev_seen: SeenTy<'_, 'gcx>
)
[src]
fn visit_terminator_drop(
&mut self,
loc: Location,
term: &Terminator<'tcx>,
flow_state: &Flows<'cx, 'gcx, 'tcx>,
drop_place: &Place<'tcx>,
erased_drop_place_ty: Ty<'gcx>,
span: Span,
prev_seen: SeenTy<'_, 'gcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Invokes access_place
as appropriate for dropping the value
at drop_place
. Note that the actual Drop
in the MIR is
always for a variable (e.g., Drop(x)
) -- but we recursively
break this variable down into subpaths (e.g., Drop(x.foo)
)
to indicate more precisely which fields might actually be
accessed by a destructor.
fn access_place(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
kind: (ShallowOrDeep, ReadOrWrite),
is_local_mutation_allowed: LocalMutationIsAllowed,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn access_place(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
kind: (ShallowOrDeep, ReadOrWrite),
is_local_mutation_allowed: LocalMutationIsAllowed,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Checks an access to the given place to see if it is allowed. Examines the set of borrows that are in scope, as well as which paths have been initialized, to ensure that (a) the place is initialized and (b) it is not borrowed in some way that would prevent this access.
Returns true if an error is reported, false otherwise.
fn check_access_for_conflict(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
sd: ShallowOrDeep,
rw: ReadOrWrite,
flow_state: &Flows<'cx, 'gcx, 'tcx>
) -> bool
[src]
fn check_access_for_conflict(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
sd: ShallowOrDeep,
rw: ReadOrWrite,
flow_state: &Flows<'cx, 'gcx, 'tcx>
) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn mutate_place(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
kind: ShallowOrDeep,
mode: MutateMode,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn mutate_place(
&mut self,
context: Context,
place_span: (&Place<'tcx>, Span),
kind: ShallowOrDeep,
mode: MutateMode,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn consume_rvalue(
&mut self,
context: Context,
(rvalue, span): (&Rvalue<'tcx>, Span),
_location: Location,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn consume_rvalue(
&mut self,
context: Context,
(rvalue, span): (&Rvalue<'tcx>, Span),
_location: Location,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn consume_operand(
&mut self,
context: Context,
(operand, span): (&Operand<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn consume_operand(
&mut self,
context: Context,
(operand, span): (&Operand<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_for_invalidation_at_exit(
&mut self,
context: Context,
borrow: &BorrowData<'tcx>,
span: Span
)
[src]
fn check_for_invalidation_at_exit(
&mut self,
context: Context,
borrow: &BorrowData<'tcx>,
span: Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns whether a borrow of this place is invalidated when the function exits
fn check_for_local_borrow(
&mut self,
borrow: &BorrowData<'tcx>,
yield_span: Span
)
[src]
fn check_for_local_borrow(
&mut self,
borrow: &BorrowData<'tcx>,
yield_span: Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Reports an error if this is a borrow of local data. This is called for all Yield statements on movable generators
fn check_activations(
&mut self,
location: Location,
span: Span,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn check_activations(
&mut self,
location: Location,
span: Span,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx>
fn check_if_reassignment_to_immutable_state(
&mut self,
context: Context,
local: Local,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn check_if_reassignment_to_immutable_state(
&mut self,
context: Context,
local: Local,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_if_full_path_is_moved(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn check_if_full_path_is_moved(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_if_path_or_subpath_is_moved(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn check_if_path_or_subpath_is_moved(
&mut self,
context: Context,
desired_action: InitializationRequiringAction,
place_span: (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn move_path_closest_to(
&mut self,
place: &Place<'tcx>
) -> Result<MovePathIndex, NoMovePathFound>
[src]
fn move_path_closest_to(
&mut self,
place: &Place<'tcx>
) -> Result<MovePathIndex, NoMovePathFound>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Currently MoveData does not store entries for all places in the input MIR. For example it will currently filter out places that are Copy; thus we do not track places of shared reference type. This routine will walk up a place along its prefixes, searching for a foundational place that is tracked in the MoveData.
An Err result includes a tag indicated why the search failed. Currently this can only occur if the place is built off of a static variable, as we do not track those in the MoveData.
fn move_path_for_place(&mut self, place: &Place<'tcx>) -> Option<MovePathIndex>
[src]
fn move_path_for_place(&mut self, place: &Place<'tcx>) -> Option<MovePathIndex>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_if_assigned_path_is_moved(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn check_if_assigned_path_is_moved(
&mut self,
context: Context,
(place, span): (&Place<'tcx>, Span),
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_access_permissions(
&mut self,
(place, span): (&Place<'tcx>, Span),
kind: ReadOrWrite,
is_local_mutation_allowed: LocalMutationIsAllowed,
flow_state: &Flows<'cx, 'gcx, 'tcx>,
location: Location
) -> bool
[src]
fn check_access_permissions(
&mut self,
(place, span): (&Place<'tcx>, Span),
kind: ReadOrWrite,
is_local_mutation_allowed: LocalMutationIsAllowed,
flow_state: &Flows<'cx, 'gcx, 'tcx>,
location: Location
) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Check the permissions for the given place and read or write kind
Returns true if an error is reported, false otherwise.
fn add_used_mut<'d>(
&mut self,
root_place: RootPlace<'d, 'tcx>,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
[src]
fn add_used_mut<'d>(
&mut self,
root_place: RootPlace<'d, 'tcx>,
flow_state: &Flows<'cx, 'gcx, 'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Adds the place into the used mutable variables set
fn is_mutable<'d>(
&self,
place: &'d Place<'tcx>,
is_local_mutation_allowed: LocalMutationIsAllowed
) -> Result<RootPlace<'d, 'tcx>, &'d Place<'tcx>>
[src]
fn is_mutable<'d>(
&self,
place: &'d Place<'tcx>,
is_local_mutation_allowed: LocalMutationIsAllowed
) -> Result<RootPlace<'d, 'tcx>, &'d Place<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether this value be written or borrowed mutably. Returns the root place if the place passed in is a projection.
Trait Implementations
impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
type FlowState = Flows<'cx, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn mir(&self) -> &'cx Mir<'tcx>
[src]
fn mir(&self) -> &'cx Mir<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_block_entry(&mut self, bb: BasicBlock, flow_state: &Self::FlowState)
[src]
fn visit_block_entry(&mut self, bb: BasicBlock, flow_state: &Self::FlowState)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_statement_entry(
&mut self,
location: Location,
stmt: &Statement<'tcx>,
flow_state: &Self::FlowState
)
[src]
fn visit_statement_entry(
&mut self,
location: Location,
stmt: &Statement<'tcx>,
flow_state: &Self::FlowState
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_terminator_entry(
&mut self,
location: Location,
term: &Terminator<'tcx>,
flow_state: &Self::FlowState
)
[src]
fn visit_terminator_entry(
&mut self,
location: Location,
term: &Terminator<'tcx>,
flow_state: &Self::FlowState
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState)
[src]
fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn process_basic_block(
&mut self,
bb: BasicBlock,
flow_state: &mut Self::FlowState
)
[src]
fn process_basic_block(
&mut self,
bb: BasicBlock,
flow_state: &mut Self::FlowState
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'cx, 'gcx, 'tcx> !Send for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Send for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Sync for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Sync for MirBorrowckCtxt<'cx, 'gcx, 'tcx>
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T
impl<T> MaybeResult for T
[src]
impl<T> MaybeResult for T
fn from_ok(x: T) -> T
[src]
fn from_ok(x: T) -> T
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T,
[src]
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, T> Captures for T where
T: ?Sized,
[src]
impl<'a, T> Captures for T where
T: ?Sized,