Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d534db0

Browse files
committedMar 14, 2025
Auto merge of #138499 - lcnr:borrowck-typeck_root, r=<try>
borrowck typeck children together with their root This is a theoretical breaking change, see the `non-structural-match-types-cycle-err.rs` test. Opening for a crater run. r? compiler-errors
2 parents f7b4354 + f319a98 commit d534db0

File tree

79 files changed

+583
-1299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+583
-1299
lines changed
 

‎compiler/rustc_ast_passes/src/feature_gate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
483483
half_open_range_patterns_in_slices,
484484
"half-open range patterns in slices are unstable"
485485
);
486-
gate_all!(inline_const_pat, "inline-const in pattern position is experimental");
487486
gate_all!(associated_const_equality, "associated const equality is incomplete");
488487
gate_all!(yeet_expr, "`do yeet` expression is experimental");
489488
gate_all!(dyn_star, "`dyn*` trait objects are experimental");

‎compiler/rustc_borrowck/src/consumers.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This file provides API for compiler consumers.
22
33
use rustc_hir::def_id::LocalDefId;
4-
use rustc_index::{IndexSlice, IndexVec};
4+
use rustc_index::IndexVec;
55
use rustc_middle::mir::{Body, Promoted};
66
use rustc_middle::ty::TyCtxt;
77

@@ -15,6 +15,7 @@ pub use super::polonius::legacy::{
1515
RichLocation, RustcFacts,
1616
};
1717
pub use super::region_infer::RegionInferenceContext;
18+
use crate::BorrowCheckRootCtxt;
1819

1920
/// Options determining the output behavior of [`get_body_with_borrowck_facts`].
2021
///
@@ -97,11 +98,9 @@ pub struct BodyWithBorrowckFacts<'tcx> {
9798
/// * Polonius is highly unstable, so expect regular changes in its signature or other details.
9899
pub fn get_body_with_borrowck_facts(
99100
tcx: TyCtxt<'_>,
100-
def: LocalDefId,
101+
def_id: LocalDefId,
101102
options: ConsumerOptions,
102103
) -> BodyWithBorrowckFacts<'_> {
103-
let (input_body, promoted) = tcx.mir_promoted(def);
104-
let input_body: &Body<'_> = &input_body.borrow();
105-
let promoted: &IndexSlice<_, _> = &promoted.borrow();
106-
*super::do_mir_borrowck(tcx, input_body, promoted, Some(options)).1.unwrap()
104+
let mut root_cx = BorrowCheckRootCtxt::new(def_id);
105+
*root_cx.do_mir_borrowck(tcx, def_id, Some(options)).1.unwrap()
107106
}
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.