Avoid Rc
in BodyWithBorrowckFacts
.
It can own these two fields.
This commit is contained in:
parent
3d7fe9e7dd
commit
d9975ce2b4
@ -1,7 +1,5 @@
|
|||||||
//! This file provides API for compiler consumers.
|
//! This file provides API for compiler consumers.
|
||||||
|
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use rustc_hir::def_id::LocalDefId;
|
use rustc_hir::def_id::LocalDefId;
|
||||||
use rustc_index::{IndexSlice, IndexVec};
|
use rustc_index::{IndexSlice, IndexVec};
|
||||||
use rustc_middle::mir::{Body, Promoted};
|
use rustc_middle::mir::{Body, Promoted};
|
||||||
@ -65,10 +63,10 @@ pub struct BodyWithBorrowckFacts<'tcx> {
|
|||||||
/// The mir bodies of promoteds.
|
/// The mir bodies of promoteds.
|
||||||
pub promoted: IndexVec<Promoted, Body<'tcx>>,
|
pub promoted: IndexVec<Promoted, Body<'tcx>>,
|
||||||
/// The set of borrows occurring in `body` with data about them.
|
/// The set of borrows occurring in `body` with data about them.
|
||||||
pub borrow_set: Rc<BorrowSet<'tcx>>,
|
pub borrow_set: BorrowSet<'tcx>,
|
||||||
/// Context generated during borrowck, intended to be passed to
|
/// Context generated during borrowck, intended to be passed to
|
||||||
/// [`calculate_borrows_out_of_scope_at_location`].
|
/// [`calculate_borrows_out_of_scope_at_location`].
|
||||||
pub region_inference_context: Rc<RegionInferenceContext<'tcx>>,
|
pub region_inference_context: RegionInferenceContext<'tcx>,
|
||||||
/// The table that maps Polonius points to locations in the table.
|
/// The table that maps Polonius points to locations in the table.
|
||||||
/// Populated when using [`ConsumerOptions::PoloniusInputFacts`]
|
/// Populated when using [`ConsumerOptions::PoloniusInputFacts`]
|
||||||
/// or [`ConsumerOptions::PoloniusOutputFacts`].
|
/// or [`ConsumerOptions::PoloniusOutputFacts`].
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use consumers::{BodyWithBorrowckFacts, ConsumerOptions};
|
use consumers::{BodyWithBorrowckFacts, ConsumerOptions};
|
||||||
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
|
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
|
||||||
@ -420,8 +419,8 @@ fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) {
|
|||||||
Some(Box::new(BodyWithBorrowckFacts {
|
Some(Box::new(BodyWithBorrowckFacts {
|
||||||
body: body_owned,
|
body: body_owned,
|
||||||
promoted,
|
promoted,
|
||||||
borrow_set: Rc::new(borrow_set),
|
borrow_set,
|
||||||
region_inference_context: Rc::new(regioncx),
|
region_inference_context: regioncx,
|
||||||
location_table: polonius_input.as_ref().map(|_| location_table),
|
location_table: polonius_input.as_ref().map(|_| location_table),
|
||||||
input_facts: polonius_input,
|
input_facts: polonius_input,
|
||||||
output_facts,
|
output_facts,
|
||||||
|
Loading…
Reference in New Issue
Block a user