Skip to content

Commit 99d5a80

Browse files
Remove next_root_ty_var
1 parent fa0dc20 commit 99d5a80

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compiler/rustc_hir_typeck/src/closure.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
154154
let parent_args =
155155
GenericArgs::identity_for_item(tcx, tcx.typeck_root_def_id(expr_def_id.to_def_id()));
156156

157-
let tupled_upvars_ty = self.next_root_ty_var(TypeVariableOrigin {
157+
let tupled_upvars_ty = self.next_ty_var(TypeVariableOrigin {
158158
kind: TypeVariableOriginKind::ClosureSynthetic,
159159
span: expr_span,
160160
});
@@ -181,7 +181,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
181181

182182
// Create a type variable (for now) to represent the closure kind.
183183
// It will be unified during the upvar inference phase (`upvar.rs`)
184-
None => self.next_root_ty_var(TypeVariableOrigin {
184+
None => self.next_ty_var(TypeVariableOrigin {
185185
// FIXME(eddyb) distinguish closure kind inference variables from the rest.
186186
kind: TypeVariableOriginKind::ClosureSynthetic,
187187
span: expr_span,

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
190190
pub fn errors_reported_since_creation(&self) -> bool {
191191
self.dcx().err_count() > self.err_count_on_creation
192192
}
193-
194-
pub fn next_root_ty_var(&self, origin: TypeVariableOrigin) -> Ty<'tcx> {
195-
Ty::new_var(self.tcx, self.next_ty_var_id_in_universe(origin, ty::UniverseIndex::ROOT))
196-
}
197193
}
198194

199195
impl<'a, 'tcx> Deref for FnCtxt<'a, 'tcx> {

0 commit comments

Comments
 (0)