Skip to content

Commit

Permalink
Rollup merge of rust-lang#120037 - compiler-errors:remove-next-root-v…
Browse files Browse the repository at this point in the history
…ar-helper, r=lcnr

Remove `next_root_ty_var`

Uhh we seem to not have any test that relies on this anymore. Maybe due to the way we changed alias-relate or whatever.

Removing this hack helper fn because rust-lang#119106 is the general solution.

r? lcnr
  • Loading branch information
matthiaskrgr committed Jan 18, 2024
2 parents fa52eda + 9d15b50 commit 39514a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let parent_args =
GenericArgs::identity_for_item(tcx, tcx.typeck_root_def_id(expr_def_id.to_def_id()));

let tupled_upvars_ty = self.next_root_ty_var(TypeVariableOrigin {
let tupled_upvars_ty = self.next_ty_var(TypeVariableOrigin {
kind: TypeVariableOriginKind::ClosureSynthetic,
span: expr_span,
});
Expand Down Expand Up @@ -101,7 +101,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

// Create a type variable (for now) to represent the closure kind.
// It will be unified during the upvar inference phase (`upvar.rs`)
None => self.next_root_ty_var(TypeVariableOrigin {
None => self.next_ty_var(TypeVariableOrigin {
// FIXME(eddyb) distinguish closure kind inference variables from the rest.
kind: TypeVariableOriginKind::ClosureSynthetic,
span: expr_span,
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
pub fn errors_reported_since_creation(&self) -> bool {
self.dcx().err_count() > self.err_count_on_creation
}

pub fn next_root_ty_var(&self, origin: TypeVariableOrigin) -> Ty<'tcx> {
Ty::new_var(self.tcx, self.next_ty_var_id_in_universe(origin, ty::UniverseIndex::ROOT))
}
}

impl<'a, 'tcx> Deref for FnCtxt<'a, 'tcx> {
Expand Down

0 comments on commit 39514a9

Please sign in to comment.