Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ac609f9
Distinguish or/refutable/irrefutable patterns in `InterPat`
Zalathar Aug 2, 2026
b12184e
Distinguish or/testable patterns in `MatchPairTree`
Zalathar Aug 2, 2026
5a9a6d8
ci: Move dependency installs to a separate script
tgross35 Aug 13, 2026
c2a81bf
ci: Enable `CARGO_TERM_VERBOSE`
tgross35 Aug 17, 2026
ca1a7c0
ci: Increase the timeout of MSRV builds
tgross35 Aug 17, 2026
90e1401
ci: Fix the command for local Docker use
tgross35 Aug 17, 2026
d03ac90
ci: Set `-Dlinker_messages`
tgross35 Aug 17, 2026
34ed943
ci: Split and sort docker dependencies
tgross35 Aug 17, 2026
482100d
bench: Update pinned nightly to 2026-08-06
tgross35 Aug 7, 2026
e45bb36
ci: Delete `RUST_TEST_THREADS=1`
tgross35 Aug 17, 2026
cfb82de
enable `f128` tests against system libs on windows
folkertdev Aug 14, 2026
06a0163
ci: Don't test with `--benches` in debug mode
tgross35 Aug 18, 2026
90c7ab4
ci: Group output into sections
tgross35 Aug 18, 2026
c0a0e10
Rename `#[ppc_alias]` to `#[ppc_name]`
beetrees Aug 18, 2026
18af4dd
c-b: Remove `#[aapcs_on_arm]`
beetrees Aug 18, 2026
c757f71
Prepare for merging from rust-lang/rust
invalid-email-address Aug 20, 2026
ad6805c
Merge ref 'f7d782a3be46' from rust-lang/rust
invalid-email-address Aug 20, 2026
c49aa70
bench: Update pinned nightly to 2026-08-19
tgross35 Aug 20, 2026
20da4a3
Revert "ci: Add a patch for compiler-rt execstack"
nicholasbishop Aug 23, 2026
467cc0c
ci: Disable install-action fallback for nextest
Gelbpunkt Aug 7, 2026
3d8ae4d
test: Allow Clippy's `needless-range-loop`
tgross35 Aug 25, 2026
c620c1c
implement `Complex` mul and div
folkertdev Aug 17, 2026
e853a10
test: Move `AlignedSlice` from the benchmark to `builtins-test`
tgross35 Aug 26, 2026
53e4a92
test: Move `mem` config and setup functions to `builtins-test`
tgross35 Aug 26, 2026
6fcc4fc
bench: Move `mem` from `AlignedVec` to `AlignedSlice`
tgross35 Aug 26, 2026
8c6c020
test: Add a test and icount benchmark for `strlen`
tgross35 Aug 26, 2026
1e4d3fd
ci: build and test with s390x-resolute runner
marcoieni Jul 9, 2026
ccc0ca9
libm: Remove an MSRV hack that is no longer needed
tgross35 Aug 26, 2026
82ee18a
stabilize map functions
Qelxiros Aug 4, 2026
178eb4b
attach naked function target features to module assembly
folkertdev Aug 6, 2026
61dec22
c-b: Drop the removed `abi_unadjusted` feature gate
HuzaifaAbdulRehman Aug 30, 2026
7b98255
ci: Disable the i686-pc-windows-gnu job
tgross35 Aug 31, 2026
41258df
Move more `rustdoc-html` tests using `--test` into the right folder
GuillaumeGomez Aug 30, 2026
2a534f5
`BUILTIN_ATTRIBUTE_MAP` improvements
nnethercote Aug 31, 2026
9670dfa
Use `GateFn` in `AttributeStability`
nnethercote Aug 31, 2026
cd09177
Derive `StableHash` for three feature structs
nnethercote Aug 31, 2026
b18fed1
Return a slice instead of `&Vec<T>` in two methods
nnethercote Aug 31, 2026
799c6d0
Various comment improvements
nnethercote Aug 31, 2026
6146d3a
Use `NonZero<u32>` consistently
nnethercote Aug 31, 2026
ca967fa
Add a missing backtick
nnethercote Aug 31, 2026
ef2ae3a
Streamline a check
nnethercote Aug 31, 2026
60be562
Simplify `find_gated_cfg`
nnethercote Aug 31, 2026
892c6bb
explicitly track inherent const generic args kind
khyperia Aug 31, 2026
614d9ea
Fix invalid `compile-args` ui tests argument
GuillaumeGomez Aug 30, 2026
af2d4bc
Switch dist-aarch64-linux to EC2 and update dist-x86_64-linux
Mark-Simulacrum Aug 30, 2026
1483f9b
remove `_{style}` recovery for diagnostic structs
mejrs Aug 31, 2026
12a11b5
Prepare for merging from rust-lang/rust
folkertdev Aug 31, 2026
56095fb
Merge ref '45f215f136e0' from rust-lang/rust
folkertdev Aug 31, 2026
e18a012
Move track_caller on closures gating to attribute parsing
mejrs Aug 31, 2026
9f89751
Move polonius loan liveness computation prior to RegionInferenceConte…
jackh726 Aug 28, 2026
6ad5c17
Move record_live_region_variance to be a freestanding function
jackh726 Aug 28, 2026
b58ee5b
Minor trace updates
jackh726 Aug 28, 2026
ace4015
Rollup merge of #162077 - folkertdev:compiler-builtins-sync-2026-09-3…
GuillaumeGomez Aug 31, 2026
236e7ce
Rollup merge of #137720 - folkertdev:naked-function-target-feature, r…
GuillaumeGomez Aug 31, 2026
19969d8
Rollup merge of #160534 - Qelxiros:stabilize-smart-pointer-map, r=nia-e
GuillaumeGomez Aug 31, 2026
c0ba229
Rollup merge of #160551 - Zalathar:inter-pat, r=Nadrieril
GuillaumeGomez Aug 31, 2026
440d746
Rollup merge of #161929 - khyperia:explicitly-track-inherent-args, r=…
GuillaumeGomez Aug 31, 2026
966e0b7
Rollup merge of #162063 - Mark-Simulacrum:aarch64-ec2, r=Kobzol
GuillaumeGomez Aug 31, 2026
f9d3559
Rollup merge of #161937 - jackh726:polonius-cleanups-2, r=lqd
GuillaumeGomez Aug 31, 2026
42bd805
Rollup merge of #162014 - GuillaumeGomez:more-ui-tests, r=fmease
GuillaumeGomez Aug 31, 2026
19bf046
Rollup merge of #162051 - nnethercote:rustc_feature-cleanups, r=Jonat…
GuillaumeGomez Aug 31, 2026
a0caa1b
Rollup merge of #162055 - mejrs:_style, r=JonathanBrouwer
GuillaumeGomez Aug 31, 2026
22b6695
Rollup merge of #162075 - mejrs:track_caller_closure_gating, r=Jonath…
GuillaumeGomez Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3634,6 +3634,7 @@ version = "0.0.0"
dependencies = [
"rustc_abi",
"rustc_ast",
"rustc_attr_ir",
"rustc_attr_parsing",
"rustc_data_structures",
"rustc_errors",
Expand Down Expand Up @@ -4068,6 +4069,7 @@ name = "rustc_feature"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"rustc_macros",
"rustc_span",
"serde",
"serde_json",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ doctest = false
# tidy-alphabetical-start
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_ir = { path = "../rustc_attr_ir" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
Expand Down
42 changes: 12 additions & 30 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ use std::ops::ControlFlow;
use std::sync::Arc;

use rustc_ast::node_id::NodeMap;
use rustc_ast::visit::{Visitor, walk_expr};
use rustc_ast::*;
use rustc_attr_ir::lang_items::LangItem;
use rustc_attr_ir::target::Target;
use rustc_errors::msg;
use rustc_hir as hir;
use rustc_hir::attrs::lang_items::LangItem;
use rustc_hir::HirId;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{HirId, Target, find_attr};
use rustc_middle::span_bug;
use rustc_middle::ty::TyCtxt;
use rustc_session::diagnostics::report_lit_error;
use rustc_span::{ByteSymbol, DUMMY_SP, DesugaringKind, Ident, Span, Spanned, Symbol, respan, sym};
use thin_vec::{ThinVec, thin_vec};
use visit::{Visitor, walk_expr};

mod closure;

use crate::diagnostics::{
Expand Down Expand Up @@ -882,35 +882,17 @@ impl<'hir> LoweringContext<'_, 'hir> {

/// Forwards a possible `#[track_caller]` annotation from `outer_hir_id` to
/// `inner_hir_id` in case the `async_fn_track_caller` feature is enabled.
pub(super) fn maybe_forward_track_caller(
&mut self,
span: Span,
outer_hir_id: HirId,
inner_hir_id: HirId,
) {
pub(super) fn maybe_forward_track_caller(&mut self, outer_hir_id: HirId, inner_hir_id: HirId) {
if self.tcx.features().async_fn_track_caller()
&& let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
&& find_attr!(*attrs, TrackCaller(_))
&& let Some(t) = attrs.iter().find(|a| {
matches!(
a,
rustc_attr_ir::Attribute::Parsed(rustc_attr_ir::AttributeKind::TrackCaller(_))
)
})
{
let unstable_span = self.mark_span_with_reason(
DesugaringKind::Async,
span,
Some(Arc::clone(&self.allow_gen_future)),
);
self.lower_attrs(
inner_hir_id,
&[Attribute {
kind: AttrKind::Normal(Box::new(NormalAttr::from_ident(Ident::new(
sym::track_caller,
span,
)))),
id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(),
style: AttrStyle::Outer,
span: unstable_span,
}],
span,
Target::Fn,
);
self.attrs.insert(inner_hir_id.local_id, std::slice::from_ref(t));
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
)
});

this.maybe_forward_track_caller(body.span, closure_hir_id, expr.hir_id);
this.maybe_forward_track_caller(closure_hir_id, expr.hir_id);

(parameters, expr)
});
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

// FIXME(async_fn_track_caller): Can this be moved above?
let hir_id = expr.hir_id;
this.maybe_forward_track_caller(body.span, fn_id, hir_id);
this.maybe_forward_track_caller(fn_id, hir_id);

(parameters, expr)
})
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ fn parse_cfg_attr_internal<'a>(
}

fn try_gate_cfg(name: Symbol, span: Span, sess: &Session, features: Option<&Features>) {
let gate = find_gated_cfg(|sym| sym == name);
let gate = find_gated_cfg(name);
if let (Some(feats), Some(gated_cfg)) = (features, gate) {
gate_cfg(gated_cfg, span, sess, feats);
}
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ impl NoArgsAttributeParser for TrackCallerParser {
});
}
}
Target::Closure if !cx.features().closure_track_caller() => {
feature_err(
cx.sess(),
sym::closure_track_caller,
attr_span,
"`#[track_caller]` on closures is currently unstable",
)
.emit();
}
_ => {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn check_keyword(cx: &mut AcceptContext<'_, '_>, keyword: Symbol, span: Span) ->

fn check_attribute(cx: &mut AcceptContext<'_, '_>, attribute: Symbol, span: Span) -> bool {
// FIXME: This should support attributes with namespace like `diagnostic::do_not_recommend`.
if rustc_feature::BUILTIN_ATTRIBUTE_MAP.contains(&attribute) {
if rustc_feature::BUILTIN_ATTRIBUTE_SET.contains(&attribute) {
return true;
}
cx.emit_err(DocAttributeNotAttribute { span, attribute });
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_parsing/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_attr_ir::target::Target;
use rustc_attr_ir::{AttrArgs, AttrItem, AttrPath, Attribute, AttributeKind, HashIgnoredAttrId};
use rustc_data_structures::sync::{DynSend, DynSync};
use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, Level, MultiSpan};
use rustc_feature::{BUILTIN_ATTRIBUTE_MAP, Features};
use rustc_feature::{BUILTIN_ATTRIBUTE_SET, Features};
use rustc_lint_defs::{LintId, RegisteredTools};
use rustc_session::Session;
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
Expand Down Expand Up @@ -376,7 +376,7 @@ impl<'sess> AttributeParser<'sess> {
);
self.check_attribute_stability(&attr_path, attr_span, accept.stability);
if let [part] = parts.as_slice() {
debug_assert!(BUILTIN_ATTRIBUTE_MAP.contains(part));
debug_assert!(BUILTIN_ATTRIBUTE_SET.contains(part));
}

let Some(args) = ArgParser::from_attr_args(
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_parsing/src/validate_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_ast::{
};
use rustc_attr_ir::AttrPath;
use rustc_errors::{Applicability, Diagnostic, PResult};
use rustc_feature::BUILTIN_ATTRIBUTE_MAP;
use rustc_feature::BUILTIN_ATTRIBUTE_SET;
use rustc_lint_defs::builtin::ILL_FORMED_ATTRIBUTE_INPUT;
use rustc_parse::parse_in;
use rustc_session::diagnostics::report_lit_error;
Expand All @@ -27,7 +27,7 @@ pub fn check_attr(psess: &ParseSess, attr: &Attribute) {
AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) | AttrKind::DocComment(..) => return,
}

let builtin_attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name));
let builtin_attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_SET.get(&name));

// Check input tokens for built-in and key-value attributes.
if let Some(name) = builtin_attr_info {
Expand Down
23 changes: 15 additions & 8 deletions compiler/rustc_borrowck/src/nll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub(crate) fn compute_regions<'tcx>(
let polonius_output = root_cx.consumer.as_ref().map_or(false, |c| c.polonius_output())
|| infcx.tcx.sess.opts.unstable_opts.polonius.is_legacy_enabled();

let lowered_constraints = compute_sccs_applying_placeholder_outlives_constraints(
let mut lowered_constraints = compute_sccs_applying_placeholder_outlives_constraints(
constraints,
&universal_region_relations,
infcx,
Expand All @@ -144,20 +144,27 @@ pub(crate) fn compute_regions<'tcx>(
&lowered_constraints,
);

// If requested for `-Zpolonius=next`, compute loan liveness information.
// This is done prior to `RegionInferenceContext::new`, because we may add
// additional liveness constraints.
if let Some(polonius_context) = polonius_context.as_mut() {
let _timer = infcx.tcx.prof.generic_activity("borrowck_polonius_loan_liveness");
polonius_context.compute_loan_liveness(
&mut lowered_constraints.liveness_constraints,
lowered_constraints.outlives_constraints.outlives().iter().copied(),
&universal_region_relations.universal_regions,
body,
borrow_set,
);
}

let mut regioncx = RegionInferenceContext::new(
infcx,
lowered_constraints,
universal_region_relations,
location_map,
);

// If requested for `-Zpolonius=next`, convert NLL constraints to localized outlives constraints
// and use them to compute loan liveness.
if let Some(polonius_context) = polonius_context.as_mut() {
let _timer = infcx.tcx.prof.generic_activity("borrowck_polonius_loan_liveness");
polonius_context.compute_loan_liveness(&mut regioncx, body, borrow_set)
}

// If requested: dump NLL facts, and run legacy polonius analysis.
let polonius_output = polonius_facts.as_ref().and_then(|polonius_facts| {
if infcx.tcx.sess.opts.unstable_opts.nll_facts {
Expand Down
32 changes: 15 additions & 17 deletions compiler/rustc_borrowck/src/polonius/liveness_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@ use rustc_middle::ty::relate::{
};
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt, TypeVisitable};

use super::{ConstraintDirection, PoloniusContext};
use super::ConstraintDirection;
use crate::universal_regions::UniversalRegions;

impl PoloniusContext {
/// Record the variance of each region contained within the given value.
pub(crate) fn record_live_region_variance<'tcx>(
&mut self,
tcx: TyCtxt<'tcx>,
universal_regions: &UniversalRegions<'tcx>,
value: impl TypeVisitable<TyCtxt<'tcx>> + Relate<TyCtxt<'tcx>>,
) {
let mut extractor = VarianceExtractor {
tcx,
ambient_variance: ty::Variance::Covariant,
directions: &mut self.live_region_variances,
universal_regions,
};
extractor.relate(value, value).expect("Can't have a type error relating to itself");
}
/// Record the variance of each region contained within the given value.
pub(crate) fn record_live_region_variance<'tcx>(
tcx: TyCtxt<'tcx>,
live_region_variances: &mut BTreeMap<RegionVid, ConstraintDirection>,
universal_regions: &UniversalRegions<'tcx>,
value: impl TypeVisitable<TyCtxt<'tcx>> + Relate<TyCtxt<'tcx>>,
) {
let mut extractor = VarianceExtractor {
tcx,
ambient_variance: ty::Variance::Covariant,
directions: live_region_variances,
universal_regions,
};
extractor.relate(value, value).expect("Can't have a type error relating to itself");
}

/// Extracts variances for regions contained within types. Follows the same structure as
Expand Down
21 changes: 12 additions & 9 deletions compiler/rustc_borrowck/src/polonius/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ use rustc_mir_dataflow::points::PointIndex;

pub(self) use self::constraints::*;
pub(crate) use self::dump::dump_polonius_mir;
pub(crate) use self::liveness_constraints::record_live_region_variance;
use crate::BorrowSet;
use crate::constraints::OutlivesConstraint;
use crate::dataflow::BorrowIndex;
use crate::region_infer::values::LivenessValues;
use crate::{BorrowSet, RegionInferenceContext};
use crate::universal_regions::UniversalRegions;

pub(crate) type LiveLoans = SparseBitMatrix<PointIndex, BorrowIndex>;

Expand All @@ -65,7 +68,7 @@ pub(crate) struct PoloniusContext {

/// The expected edge direction per live region: the kind of directed edge we'll create as
/// liveness constraints depends on the variance of types with respect to each contained region.
live_region_variances: BTreeMap<RegionVid, ConstraintDirection>,
pub(crate) live_region_variances: BTreeMap<RegionVid, ConstraintDirection>,

/// The regions that outlive free regions are used to distinguish relevant live locals from
/// boring locals. A boring local is one whose type contains only such regions. Polonius
Expand All @@ -77,7 +80,7 @@ pub(crate) struct PoloniusContext {
/// The direction a constraint can flow into. Used to create liveness constraints according to
/// variance.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
enum ConstraintDirection {
pub(crate) enum ConstraintDirection {
/// For covariant cases, we add a forward edge `O at P1 -> O at P2`.
Forward,

Expand All @@ -101,31 +104,31 @@ impl PoloniusContext {
/// The constraint data will be used to compute errors and diagnostics.
pub(crate) fn compute_loan_liveness<'tcx>(
&mut self,
regioncx: &mut RegionInferenceContext<'tcx>,
liveness: &mut LivenessValues,
outlives_constraints: impl Iterator<Item = OutlivesConstraint<'tcx>>,
universal_regions: &UniversalRegions<'tcx>,
body: &Body<'tcx>,
borrow_set: &BorrowSet<'tcx>,
) {
let liveness = regioncx.liveness_constraints();

// We don't need to prepare the graph (index NLL constraints, etc.) if we have no loans to
// trace throughout localized constraints.
if borrow_set.len() > 0 {
// From the outlives constraints, liveness, and variances, we can compute reachability
// on the lazy localized constraint graph to trace the liveness of loans, for the next
// step in the chain (the NLL loan scope and active loans computations).
let graph = LocalizedConstraintGraph::new(liveness, regioncx.outlives_constraints());
let graph = LocalizedConstraintGraph::new(liveness, outlives_constraints);

let mut live_loans = LiveLoans::new(borrow_set.len());
let mut visitor = LoanLivenessVisitor { liveness, live_loans: &mut live_loans };
graph.traverse(
body,
liveness,
&self.live_region_variances,
regioncx.universal_regions(),
universal_regions,
borrow_set,
&mut visitor,
);
regioncx.record_live_loans(live_loans);
liveness.record_live_loans(live_loans);

// The graph can be traversed again during MIR dumping, so we store it here.
self.graph = Some(graph);
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::constraints::{ConstraintSccIndex, OutlivesConstraint, OutlivesConstra
use crate::dataflow::BorrowIndex;
use crate::diagnostics::{RegionErrorKind, RegionErrors, UniverseInfo};
use crate::handle_placeholders::{LoweredConstraints, RegionTracker};
use crate::polonius::LiveLoans;
use crate::polonius::legacy::PoloniusOutput;
use crate::region_infer::values::{LivenessValues, RegionElement, RegionValues};
use crate::type_check::Locations;
Expand Down Expand Up @@ -1874,12 +1873,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
&self.liveness_constraints
}

/// When using `-Zpolonius=next`, records the given live loans for the loan scopes and active
/// loans dataflow computations.
pub(crate) fn record_live_loans(&mut self, live_loans: LiveLoans) {
self.liveness_constraints.record_live_loans(live_loans);
}

/// Returns whether the `loan_idx` is live at the given `location`: whether its issuing
/// region is contained within the type of a variable that is live at this point.
/// Note: for now, the sets of live loans is only available when using `-Zpolonius=next`.
Expand Down
11 changes: 8 additions & 3 deletions compiler/rustc_borrowck/src/type_check/liveness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tracing::debug;

use super::TypeChecker;
use crate::constraints::OutlivesConstraintSet;
use crate::polonius::PoloniusContext;
use crate::polonius::{PoloniusContext, record_live_region_variance};
use crate::region_infer::values::LivenessValues;
use crate::universal_regions::UniversalRegions;

Expand Down Expand Up @@ -67,7 +67,7 @@ pub(super) fn generate<'tcx>(
let (relevant_live_locals, boring_locals) =
compute_relevant_live_locals(typeck.tcx(), &free_regions, typeck.body);

trace::trace(typeck, location_map, move_data, relevant_live_locals, boring_locals);
trace::trace(typeck, location_map, move_data, &relevant_live_locals, &boring_locals);

// Mark regions that should be live where they appear within rvalues or within a call: like
// args, regions, and types.
Expand Down Expand Up @@ -220,7 +220,12 @@ impl<'a, 'tcx> LiveVariablesVisitor<'a, 'tcx> {

// When using `-Zpolonius=next`, we record the variance of each live region.
if let Some(polonius_context) = self.polonius_context {
polonius_context.record_live_region_variance(self.tcx, self.universal_regions, value);
record_live_region_variance(
self.tcx,
&mut polonius_context.live_region_variances,
self.universal_regions,
value,
);
}
}
}
Loading
Loading