Skip to main content

Module consumers

Module consumers 

Source
Expand description

A public API provided for the Rust compiler consumers. This file provides API for compiler consumers.

Re-exportsยง

use rustc_data_structures::fx::FxHashMap; ๐Ÿ”’
use rustc_hir::def_id::LocalDefId; ๐Ÿ”’
use rustc_index::IndexVec; ๐Ÿ”’
use rustc_middle::mir::Body; ๐Ÿ”’
use rustc_middle::mir::Promoted; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_span::bug; ๐Ÿ”’
pub use super::borrow_set::BorrowData;
pub use super::borrow_set::BorrowSet;
pub use super::borrow_set::TwoPhaseActivation;
pub use super::constraints::OutlivesConstraint;
pub use super::dataflow::BorrowIndex;
pub use super::dataflow::Borrows;
pub use super::dataflow::calculate_borrows_out_of_scope_at_location;
pub use super::place_ext::PlaceExt;
pub use super::places_conflict::PlaceConflictBias;
pub use super::places_conflict::places_conflict;
pub use super::polonius::legacy::PoloniusFacts as PoloniusInput;
pub use super::polonius::legacy::PoloniusLocationTable;
pub use super::polonius::legacy::PoloniusOutput;
pub use super::polonius::legacy::PoloniusRegionVid;
pub use super::polonius::legacy::RichLocation;
pub use super::polonius::legacy::RustcFacts;
pub use super::region_infer::RegionInferenceContext;
use crate::BorrowCheckRootCtxt; ๐Ÿ”’

Structsยง

BodyWithBorrowckFacts
A Body with information computed by the borrow checker. This struct is intended to be consumed by compiler consumers.
BorrowckConsumer ๐Ÿ”’
Struct used during mir borrowck to collect bodies with facts for a typeck root and all its nested bodies.

Enumsยง

ConsumerOptions
Options determining the output behavior of get_bodies_with_borrowck_facts.

Functionsยง

get_bodies_with_borrowck_facts
This function computes borrowck facts for the given def id and all its nested bodies. It must be called with a typeck root which will then borrowck all nested bodies as well. The ConsumerOptions determine which facts are returned. This function makes a copy of the bodies because it needs to regenerate the region identifiers. It should never be invoked during a typical compilation session due to the unnecessary overhead of returning BodyWithBorrowckFacts.