Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ba96988
add some comments to Windows remove_dir_all
RalfJung Oct 1, 2026
e90fd2c
avoid re-reading the same dir entries over and over
RalfJung Oct 1, 2026
dff7a20
std: use `SOCK_NONBLOCK` in `connect_timeout`
joboet Oct 8, 2026
2cf8532
Rename `PostTypeckUntilBorrowck` -> `PostTypeckThroughBorrowck`
Jamesbarford Oct 14, 2026
71ee80a
Remove -Z option
Jamesbarford Oct 19, 2026
205d6ac
Add reference annotations for unions
traviscross Aug 28, 2026
2eef187
update to illumos sysroot 20210501
gwr Aug 25, 2026
0f64fe6
chore(triagebot): allow `llm-assisted` label to be set without write …
jieyouxu Oct 22, 2026
88898fe
rmake: Rename the `symbols` to `obj`
tgross35 Sep 21, 2026
2dc48e7
rmake: Add helpers for iterating symbols and objects
tgross35 Sep 21, 2026
01844ed
Remove docs mentioning instability of wasm64
madsmtm Oct 22, 2026
92e885a
update PassBuilder constructor calls
zmodem Oct 22, 2026
222c583
Avoid cloning CFG-related analysis data.
dianqk May 22, 2026
31d8b41
use a default LLVMContext in LLVMRustPrintPasses
zmodem Oct 22, 2026
e642769
clippy: Avoid hashing FileName
Zalathar Oct 17, 2026
9a82d1a
Sort `impl_dep_tracking_hash_via_hash!`
Zalathar Oct 17, 2026
d82fe8a
Avoid stdlib's `impl Hash for Path` for stable hashing
Zalathar Oct 17, 2026
63e2ea2
Declare through
aerooneqq Oct 22, 2026
d1702ce
Rollup merge of #164458 - Zalathar:path-hash, r=jieyouxu
JonathanBrouwer Oct 22, 2026
57dc51e
Rollup merge of #161790 - gwr:gwr2, r=tgross35
JonathanBrouwer Oct 22, 2026
a92c9ed
Rollup merge of #163087 - tgross35:rmake-syms, r=jieyouxu
JonathanBrouwer Oct 22, 2026
02eac2f
Rollup merge of #163586 - RalfJung:win-remove-dir-all, r=ChrisDenton
JonathanBrouwer Oct 22, 2026
2015161
Rollup merge of #163983 - joboet:sock_nonblock_connect, r=JohnTitor
JonathanBrouwer Oct 22, 2026
56e00d5
Rollup merge of #164307 - Jamesbarford:chore/PostTypeckUntilBorrowck-…
JonathanBrouwer Oct 22, 2026
cd7a7c6
Rollup merge of #164425 - aerooneqq:make-syntax-context-index, r=petr…
JonathanBrouwer Oct 22, 2026
9b007cb
Rollup merge of #156841 - dianqk:avoid-clone, r=mu001999
JonathanBrouwer Oct 22, 2026
209922e
Rollup merge of #164654 - traviscross:TC/add-reference-annotations_un…
JonathanBrouwer Oct 22, 2026
90a6197
Rollup merge of #164717 - jieyouxu:jieyouxu/label, r=lqd
JonathanBrouwer Oct 22, 2026
2eb7d4c
Rollup merge of #164735 - madsmtm:wasm64-docs, r=alexcrichton
JonathanBrouwer Oct 22, 2026
dce705a
Rollup merge of #164737 - zmodem:passbuilder, r=nikic
JonathanBrouwer Oct 22, 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
7 changes: 5 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3843,8 +3843,11 @@ impl<'diag, 'tcx> MirBorrowckCtxt<'_, 'diag, 'tcx> {
location: Location,
) -> impl Iterator<Item = Location> {
if location.statement_index == 0 {
let predecessors = body.basic_blocks.predecessors()[location.block].to_vec();
Either::Left(predecessors.into_iter().map(move |bb| body.terminator_loc(bb)))
Either::Left(
body.basic_blocks.predecessors()[location.block]
.iter()
.map(|&bb| body.terminator_loc(bb)),
)
} else {
Either::Right(std::iter::once(Location {
statement_index: location.statement_index - 1,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/implied_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub(super) fn mir_borrowck_implied_outlives_bounds<'tcx>(
// parent body, so for these we do want to define opaque types. Not doing so can result
// in incorrect errors when normalizing implied bounds.
let typing_env = if tcx.is_typeck_child(body_def_id.to_def_id()) {
TypingEnv::post_typeck_until_borrowck(tcx, body_def_id)
TypingEnv::post_typeck_through_borrowck(tcx, body_def_id)
} else {
TypingEnv::non_body_analysis(tcx, body_def_id)
};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ pub(crate) struct BorrowckInferCtxt<'tcx> {

impl<'tcx> BorrowckInferCtxt<'tcx> {
pub(crate) fn new(tcx: TyCtxt<'tcx>, def_id: LocalDefId, root_def_id: LocalDefId) -> Self {
let typing_mode = if tcx.use_typing_mode_post_typeck_until_borrowck() {
let typing_mode = if tcx.use_typing_mode_post_typeck_through_borrowck() {
TypingMode::borrowck(tcx, def_id)
} else {
TypingMode::analysis_in_body(tcx, def_id)
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ fn collect_defining_uses<'tcx>(
DefiningScopeKind::MirBorrowck,
) {
// A non-defining use. This is a hard error on stable and gets ignored
// with `TypingMode::PostTypeckUntilBorrowck`.
if infcx.tcx.use_typing_mode_post_typeck_until_borrowck() {
// with `TypingMode::PostTypeckThroughBorrowck`.
if infcx.tcx.use_typing_mode_post_typeck_through_borrowck() {
match err {
NonDefiningUseReason::Tainted(guar) => add_hidden_type(
infcx.tcx,
Expand Down Expand Up @@ -327,7 +327,7 @@ fn compute_definition_site_hidden_types_from_defining_uses<'tcx>(
// If we're using the next solver, the unconstrained region may be resolved by a
// fully defining use from another body.
// So we don't generate error eagerly here.
if rcx.infcx.tcx.use_typing_mode_post_typeck_until_borrowck() {
if rcx.infcx.tcx.use_typing_mode_post_typeck_through_borrowck() {
unconstrained_hidden_type_errors.push(UnexpectedHiddenRegion {
def_id,
hidden_type,
Expand Down Expand Up @@ -362,7 +362,7 @@ fn compute_definition_site_hidden_types_from_defining_uses<'tcx>(
DefinitionSiteHiddenType::new_error(tcx, guar)
});

if !rcx.infcx.tcx.use_typing_mode_post_typeck_until_borrowck() {
if !rcx.infcx.tcx.use_typing_mode_post_typeck_through_borrowck() {
// Sometimes, when the hidden type is an inference variable, it can happen that
// the hidden type becomes the opaque type itself. In this case, this was an opaque
// usage of the opaque type and we can ignore it. This check is mirrored in typeck's
Expand Down Expand Up @@ -539,7 +539,7 @@ pub(crate) fn apply_definition_site_hidden_types<'tcx>(
let mut errors = Vec::new();
for &(key, hidden_type) in opaque_types {
let Some(expected) = hidden_types.get(&key.def_id) else {
if !tcx.use_typing_mode_post_typeck_until_borrowck() {
if !tcx.use_typing_mode_post_typeck_through_borrowck() {
if let &ty::Alias(_, ty::AliasTy { kind: ty::Opaque { def_id }, args, .. }) =
hidden_type.ty.kind()
&& def_id == key.def_id.to_def_id()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Qualif for HasMutInterior {
let freeze_def_id = cx.tcx.require_lang_item(LangItem::Freeze, cx.body.span);
let did = cx.body.source.def_id().expect_local();

let typing_env = if cx.tcx.use_typing_mode_post_typeck_until_borrowck() {
let typing_env = if cx.tcx.use_typing_mode_post_typeck_through_borrowck() {
cx.typing_env
} else {
ty::TypingEnv::new(cx.typing_env.param_env, TypingMode::analysis_in_body(cx.tcx, did))
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn retry_codegen_mode_with_postanalysis<'tcx, K: TypeVisitable<TyCtxt<'tcx>>, V>
}
ty::TypingMode::Coherence
| ty::TypingMode::Typeck { .. }
| ty::TypingMode::PostTypeckUntilBorrowck { .. }
| ty::TypingMode::PostTypeckThroughBorrowck { .. }
| ty::TypingMode::PostBorrowck { .. }
| ty::TypingMode::Reflection
| ty::TypingMode::PostAnalysis => {}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn assert_typing_mode(typing_mode: ty::TypingMode<'_>) {
ty::TypingMode::Coherence
| ty::TypingMode::Typeck { .. }
| ty::TypingMode::Reflection
| ty::TypingMode::PostTypeckUntilBorrowck { .. }
| ty::TypingMode::PostTypeckThroughBorrowck { .. }
| ty::TypingMode::PostBorrowck { .. } => bug!(
"Const eval should always happens in PostAnalysis or Codegen mode. See the comment on `assert_typing_mode` for more details."
),
Expand Down
125 changes: 123 additions & 2 deletions compiler/rustc_data_structures/src/stable_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::num::NonZero;

use rustc_index::bit_set::{self, DenseBitSet};
use rustc_index::{Idx, IndexSlice, IndexVec};
use rustc_macros::StableHash;
use smallvec::SmallVec;
use thin_vec::ThinVec;

Expand Down Expand Up @@ -37,6 +38,25 @@ pub trait StableHashCtxt {
fn assert_default_stable_hash_controls(&self, msg: &str);
}

/// Dummy impl of [`StableHashCtxt`], for code that can't provide a real context,
/// and only wants to compute stable hashes for types that don't rely on the context.
pub struct DummyStableHashCtxt;

impl StableHashCtxt for DummyStableHashCtxt {
fn stable_hash_span(&mut self, _span: RawSpan, _hasher: &mut StableHasher) {
panic!("method on dummy stable-hash context was unexpectedly called");
}
fn def_path_hash(&self, _def_id: RawDefId) -> Fingerprint {
panic!("method on dummy stable-hash context was unexpectedly called");
}
fn stable_hash_controls(&self) -> StableHashControls {
panic!("method on dummy stable-hash context was unexpectedly called");
}
fn assert_default_stable_hash_controls(&self, _msg: &str) {
panic!("method on dummy stable-hash context was unexpectedly called");
}
}

// A type used to work around `Span` not being visible in this crate. It is the same size as
// `Span` but has a different alignment.
pub struct RawSpan(pub u64);
Expand Down Expand Up @@ -71,6 +91,18 @@ pub struct RawDefId(pub u32, pub u32);
/// - `stable_hash()` must be independent of the host architecture. The
/// `StableHasher` takes care of endianness and `isize`/`usize` platform
/// differences.
///
/// # Consistency across compiler stages
///
/// Because the stage1 compiler is built against the bootstrap stdlib, but the stage2
/// compiler uses in-tree stdlib, implementations of `StableHash` must not rely on `Hash`
/// impls that were provided or derived by the standard library. Doing so leads to weird
/// bugs and CI failures that can block changes to those stdlib hash impls.
///
/// (Unfortunately, as of late 2026 we have many stable-hash impls that _do_
/// leak details of stdlib hash impls.)
///
/// See <https://github.com/rust-lang/rust/pull/164458> for more context.
pub trait StableHash {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher);
}
Expand Down Expand Up @@ -575,8 +607,97 @@ impl<R: Idx, C: Idx> StableHash for bit_set::BitMatrix<R, C> {

impl_stable_traits_for_trivial_type!(::std::ffi::OsStr);

impl_stable_traits_for_trivial_type!(::std::path::Path);
impl_stable_traits_for_trivial_type!(::std::path::PathBuf);
impl StableHash for std::path::Path {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
use std::path::{Component, Prefix};

/// Tag value to be mixed in with each kind of component/prefix.
#[derive(StableHash)]
enum Tag {
StartOfPath,
PrefixVerbatim,
PrefixVerbatimUNC,
PrefixVerbatimDisk,
PrefixDeviceNS,
PrefixUNC,
PrefixDisk,
RootDir,
CurDir,
ParentDir,
Normal,
EndOfPath,
}

// Explicitly tag the start of each path, so that empty paths always hash something.
Tag::StartOfPath.stable_hash(hcx, hasher);

for (i, component) in self.components().enumerate() {
// Mix in the index of each component, to avoid potentially trivial collisions
// between inputs like `("foo/bar", "baz")` and `("foo", "bar/baz")`.
i.stable_hash(hcx, hasher);
match component {
Component::Prefix(prefix) => match prefix.kind() {
Prefix::Verbatim(os_str) => {
Tag::PrefixVerbatim.stable_hash(hcx, hasher);
os_str.stable_hash(hcx, hasher);
}
Prefix::VerbatimUNC(host, share) => {
Tag::PrefixVerbatimUNC.stable_hash(hcx, hasher);
host.stable_hash(hcx, hasher);
share.stable_hash(hcx, hasher);
}
Prefix::VerbatimDisk(letter) => {
Tag::PrefixVerbatimDisk.stable_hash(hcx, hasher);
letter.stable_hash(hcx, hasher);
}
Prefix::DeviceNS(os_str) => {
Tag::PrefixDeviceNS.stable_hash(hcx, hasher);
os_str.stable_hash(hcx, hasher);
}
Prefix::UNC(host, share) => {
Tag::PrefixUNC.stable_hash(hcx, hasher);
host.stable_hash(hcx, hasher);
share.stable_hash(hcx, hasher);
}
Prefix::Disk(letter) => {
Tag::PrefixDisk.stable_hash(hcx, hasher);
letter.stable_hash(hcx, hasher);
}
},
Component::RootDir => Tag::RootDir.stable_hash(hcx, hasher),
Component::CurDir => Tag::CurDir.stable_hash(hcx, hasher),
Component::ParentDir => Tag::ParentDir.stable_hash(hcx, hasher),
Component::Normal(os_str) => {
Tag::Normal.stable_hash(hcx, hasher);
os_str.stable_hash(hcx, hasher);
}
}
}

// Explicitly tag the end of each path, so that empty paths always hash something.
// (Tagging the start and the end and the component-index is potentially overkill.)
Tag::EndOfPath.stable_hash(hcx, hasher);
}
}

impl StableOrd for std::path::Path {
/// FIXME(Zalathar): Unstably sorting paths is pre-existing behavior, but potentially wrong.
const CAN_USE_UNSTABLE_SORT: bool = true;
/// Stdlib path sorting should (hopefully) not change.
const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED: () = ();
}

impl StableHash for std::path::PathBuf {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
self.as_path().stable_hash(hcx, hasher);
}
}

impl StableOrd for std::path::PathBuf {
const CAN_USE_UNSTABLE_SORT: bool = <std::path::Path as StableOrd>::CAN_USE_UNSTABLE_SORT;
/// Stdlib path sorting should (hopefully) not change.
const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED: () = ();
}

// It is not safe to implement StableHash for HashSet, HashMap or any other collection type
// with unstable but observable iteration order.
Expand Down
34 changes: 34 additions & 0 deletions compiler/rustc_data_structures/src/stable_hash/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

use super::*;

// The tests below compare the computed hashes to particular expected values
Expand Down Expand Up @@ -29,6 +31,19 @@ fn hash<T: StableHash>(t: &T) -> Hash128 {
h.finish()
}

/// Computes the stable hash of two values in sequence.
///
/// This is similar to computing the stable hash of `(a, b)`, except that it
/// avoids relying on the actual impl of StableHash for tuples.
fn hash_two(a: &impl StableHash, b: &impl StableHash) -> Hash128 {
let hcx = &mut DummyStableHashCtxt;
let mut hasher = StableHasher::new();

a.stable_hash(hcx, &mut hasher);
b.stable_hash(hcx, &mut hasher);
hasher.finish()
}

// Check that bit set hash includes the domain size.
#[test]
fn test_hash_bit_set() {
Expand Down Expand Up @@ -115,3 +130,22 @@ fn test_isize_compression() {
check_hash(0xFF, 0xFFFFFFFFFFFFFFFF);
check_hash(u64::MAX /* -1 */, 1);
}

#[test]
fn path_component_rebracketing() {
let hash_a = hash_two(&Path::new("alfa/bravo"), &Path::new("charlie"));
let hash_b = hash_two(&Path::new("alfa"), &Path::new("bravo/charlie"));

assert_ne!(hash_a, hash_b);
}

#[test]
fn empty_path_rebracketing() {
let nonempty_path = &Path::new("foo");
let empty_path = &Path::new("");

let hash_a = hash_two(nonempty_path, empty_path);
let hash_b = hash_two(empty_path, nonempty_path);

assert_ne!(hash_a, hash_b);
}
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ pub(super) fn check_coroutine_obligations(
}
} else {
// We're not checking region constraints here, so we can simply drop the
// added opaque type uses in `TypingMode::PostTypeckUntilBorrowck`.
// added opaque type uses in `TypingMode::PostTypeckThroughBorrowck`.
let _ = infcx.take_opaque_types();
}

Expand All @@ -2372,7 +2372,7 @@ pub(super) fn check_potentially_region_dependent_goals<'tcx>(
let typeck_results = tcx.typeck(def_id);
let param_env = tcx.param_env(def_id);

// We use `TypingMode::PostTypeckUntilBorrowck` as we want to use the opaque types computed by HIR typeck.
// We use `TypingMode::PostTypeckThroughBorrowck` as we want to use the opaque types computed by HIR typeck.
let typing_mode = TypingMode::borrowck(tcx, def_id);
let infcx = tcx.infer_ctxt().ignoring_regions().build(typing_mode);
let ocx = ObligationCtxt::new_with_diagnostics(&infcx);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
ty::TypingMode::Coherence
| ty::TypingMode::Reflection
| ty::TypingMode::PostTypeckUntilBorrowck { .. }
| ty::TypingMode::PostTypeckThroughBorrowck { .. }
| ty::TypingMode::PostBorrowck { .. }
| ty::TypingMode::PostAnalysis
| ty::TypingMode::Codegen => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
}
ty::TypingMode::Coherence
| ty::TypingMode::Reflection
| ty::TypingMode::PostTypeckUntilBorrowck { .. }
| ty::TypingMode::PostTypeckThroughBorrowck { .. }
| ty::TypingMode::PostBorrowck { .. }
| ty::TypingMode::PostAnalysis
| ty::TypingMode::Codegen => {
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ impl<'tcx> Drop for InferCtxt<'tcx> {
let mut inner = self.inner.borrow_mut();
let opaque_type_storage = &mut inner.opaque_type_storage;

// No need for the drop bomb when we're in `TypingMode::PostTypeckUntilBorrowck`, and the `InferCtxt`
// No need for the drop bomb when we're in `TypingMode::PostTypeckThroughBorrowck`, and the `InferCtxt`
// doesn't consider regions. This is okay since after typeck, the only reason we care about opaques is
// in relation to regions. In some places *after* typeck that aren't borrowck, we use
// `TypingMode::PostTypeckUntilBorrowck` to prevent defining opaque types and we simply don't care about regions.
// `TypingMode::PostTypeckThroughBorrowck` to prevent defining opaque types and we simply don't care about regions.
match self.typing_mode_raw() {
TypingMode::Coherence
| TypingMode::Typeck { .. }
Expand All @@ -373,7 +373,7 @@ impl<'tcx> Drop for InferCtxt<'tcx> {
| TypingMode::Codegen => {}
// In erased mode, the opaque type storage is always empty
TypingMode::ErasedNotCoherence(..) => {}
TypingMode::PostTypeckUntilBorrowck { .. } => {
TypingMode::PostTypeckThroughBorrowck { .. } => {
if !self.considering_regions {
return;
}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ impl<'tcx> InferCtxt<'tcx> {
debug_assert!(!self.next_trait_solver());
match self.typing_mode_raw().assert_not_erased() {
TypingMode::Typeck { defining_opaque_types_and_generators: defining_opaque_types }
| TypingMode::PostTypeckUntilBorrowck { defining_opaque_types } => {
| TypingMode::PostTypeckThroughBorrowck { defining_opaque_types } => {
id.into().as_local().is_some_and(|def_id| defining_opaque_types.contains(&def_id))
}
// FIXME(#132279): This function is quite weird in post-analysis
Expand Down Expand Up @@ -1683,7 +1683,7 @@ impl<'tcx> InferCtxt<'tcx> {
// errors and fail to reveal opaques while inside of bodies. We should rename this
// function and require explicit comments on all use-sites in the future.
ty::TypingMode::Typeck { defining_opaque_types_and_generators: _ }
| ty::TypingMode::PostTypeckUntilBorrowck { defining_opaque_types: _ } => {
| ty::TypingMode::PostTypeckThroughBorrowck { defining_opaque_types: _ } => {
TypingMode::non_body_analysis()
}
mode @ (ty::TypingMode::Coherence
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl<'tcx> InferCtxt<'tcx> {
);
}
}
ty::TypingMode::PostTypeckUntilBorrowck { .. } => {
ty::TypingMode::PostTypeckThroughBorrowck { .. } => {
let prev = self
.inner
.borrow_mut()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ impl<'tcx> LateContext<'tcx> {
/// building a new `InferCtxt`.
pub fn typing_mode(&self) -> TypingMode<'tcx> {
if let Some(body_id) = self.enclosing_body
&& self.tcx.use_typing_mode_post_typeck_until_borrowck()
&& self.tcx.use_typing_mode_post_typeck_through_borrowck()
{
let def_id = self.tcx.hir_enclosing_body_owner(body_id.hir_id);
TypingMode::post_borrowck_analysis(self.tcx, def_id)
Expand Down
Loading
Loading