Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
let diverging_roots: UnordSet<ty::TyVid> = self
.diverging_type_vars
.borrow()
.items()
.map(|&ty| self.shallow_resolve(ty))
.iter()
.map(|&ty_id| self.shallow_resolve(Ty::new_var(self.tcx, ty_id)))
.filter_map(|ty| ty.ty_vid())
.map(|vid| self.root_var(vid))
.collect();
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
for a in &adj {
match a.kind {
Adjust::NeverToAny => {
if a.target.is_ty_var() {
self.diverging_type_vars.borrow_mut().insert(a.target);
if let ty::Infer(ty::TyVar(a_id)) = a.target.kind() {
self.diverging_type_vars.borrow_mut().push(*a_id);
debug!("apply_adjustments: adding `{:?}` as diverging type var", a.target);
}
}
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use std::cell::{Cell, RefCell};
use std::ops::Deref;

use rustc_data_structures::unord::UnordSet;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::{self as hir, HirId, HirIdMap};
use rustc_infer::infer::{InferCtxt, InferOk, OpaqueTypeStorageEntries, TyCtxtInferExt};
use rustc_middle::span_bug;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, TypingMode};
use rustc_middle::ty::{self, Ty, TyCtxt, TyVid, TypeVisitableExt, TypingMode};
use rustc_span::Span;
use rustc_span::def_id::LocalDefIdMap;
use rustc_trait_selection::traits::{self, FulfillmentError, TraitEngine, TraitEngineExt as _};
Expand Down Expand Up @@ -66,7 +65,7 @@ pub(crate) struct TypeckRootCtxt<'tcx> {
/// Whenever we introduce an adjustment from `!` into a type variable,
/// we record that type variable here. This is later used to inform
/// fallback. See the `fallback` module for details.
pub(super) diverging_type_vars: RefCell<UnordSet<Ty<'tcx>>>,
pub(super) diverging_type_vars: RefCell<Vec<TyVid>>,
}

impl<'tcx> Deref for TypeckRootCtxt<'tcx> {
Expand Down
Loading