Use Box
instead of Rc
for polonius_output
.
Refcounting isn't needed.
This commit is contained in:
parent
89e84c053d
commit
3d7fe9e7dd
@ -79,7 +79,7 @@ pub struct BodyWithBorrowckFacts<'tcx> {
|
||||
pub input_facts: Option<Box<PoloniusInput>>,
|
||||
/// Polonius output facts. Populated when using
|
||||
/// [`ConsumerOptions::PoloniusOutputFacts`].
|
||||
pub output_facts: Option<Rc<PoloniusOutput>>,
|
||||
pub output_facts: Option<Box<PoloniusOutput>>,
|
||||
}
|
||||
|
||||
/// This function computes borrowck facts for the given body. The [`ConsumerOptions`]
|
||||
|
@ -586,7 +586,7 @@ struct MirBorrowckCtxt<'a, 'infcx, 'tcx> {
|
||||
next_region_name: RefCell<usize>,
|
||||
|
||||
/// Results of Polonius analysis.
|
||||
polonius_output: Option<Rc<PoloniusOutput>>,
|
||||
polonius_output: Option<Box<PoloniusOutput>>,
|
||||
|
||||
diags: diags::BorrowckDiags<'infcx, 'tcx>,
|
||||
move_errors: Vec<MoveError<'tcx>>,
|
||||
|
@ -42,7 +42,7 @@ pub(crate) struct NllOutput<'tcx> {
|
||||
pub regioncx: RegionInferenceContext<'tcx>,
|
||||
pub opaque_type_values: FxIndexMap<LocalDefId, OpaqueHiddenType<'tcx>>,
|
||||
pub polonius_input: Option<Box<AllFacts>>,
|
||||
pub polonius_output: Option<Rc<PoloniusOutput>>,
|
||||
pub polonius_output: Option<Box<PoloniusOutput>>,
|
||||
pub opt_closure_req: Option<ClosureRegionRequirements<'tcx>>,
|
||||
pub nll_errors: RegionErrors<'tcx>,
|
||||
}
|
||||
@ -184,7 +184,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
|
||||
let algorithm = Algorithm::from_str(&algorithm).unwrap();
|
||||
debug!("compute_regions: using polonius algorithm {:?}", algorithm);
|
||||
let _prof_timer = infcx.tcx.prof.generic_activity("polonius_analysis");
|
||||
Some(Rc::new(Output::compute(all_facts, algorithm, false)))
|
||||
Some(Box::new(Output::compute(all_facts, algorithm, false)))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
&mut self,
|
||||
infcx: &InferCtxt<'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
polonius_output: Option<Rc<PoloniusOutput>>,
|
||||
polonius_output: Option<Box<PoloniusOutput>>,
|
||||
) -> (Option<ClosureRegionRequirements<'tcx>>, RegionErrors<'tcx>) {
|
||||
let mir_def_id = body.source.def_id();
|
||||
self.propagate_constraints();
|
||||
@ -663,7 +663,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
self.check_polonius_subset_errors(
|
||||
outlives_requirements.as_mut(),
|
||||
&mut errors_buffer,
|
||||
polonius_output.expect("Polonius output is unavailable despite `-Z polonius`"),
|
||||
polonius_output
|
||||
.as_ref()
|
||||
.expect("Polonius output is unavailable despite `-Z polonius`"),
|
||||
);
|
||||
} else {
|
||||
self.check_universal_regions(outlives_requirements.as_mut(), &mut errors_buffer);
|
||||
@ -1411,7 +1413,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
&self,
|
||||
mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
errors_buffer: &mut RegionErrors<'tcx>,
|
||||
polonius_output: Rc<PoloniusOutput>,
|
||||
polonius_output: &PoloniusOutput,
|
||||
) {
|
||||
debug!(
|
||||
"check_polonius_subset_errors: {} subset_errors",
|
||||
|
Loading…
x
Reference in New Issue
Block a user