Rollup merge of #124955 - nnethercote:next_ty_var, r=lcnr
Use fewer origins when creating type variables. To reduce lots of repetitive boilerplate code. Details in the individual commit messages. r? ``@lcnr``
This commit is contained in:
commit
0ee258009c
41 changed files with 135 additions and 339 deletions
|
@ -1,6 +1,5 @@
|
|||
use rustc_hir::{def::DefKind, Body, Item, ItemKind, Node, TyKind};
|
||||
use rustc_hir::{Path, QPath};
|
||||
use rustc_infer::infer::type_variable::TypeVariableOrigin;
|
||||
use rustc_infer::infer::InferCtxt;
|
||||
use rustc_infer::traits::{Obligation, ObligationCause};
|
||||
use rustc_middle::ty::{self, Binder, Ty, TyCtxt, TypeFoldable, TypeFolder};
|
||||
|
@ -337,7 +336,7 @@ impl<'a, 'tcx, F: FnMut(DefId) -> bool> TypeFolder<TyCtxt<'tcx>>
|
|||
if let Some(def) = t.ty_adt_def()
|
||||
&& (self.did_has_local_parent)(def.did())
|
||||
{
|
||||
self.infcx.next_ty_var(TypeVariableOrigin { param_def_id: None, span: self.infer_span })
|
||||
self.infcx.next_ty_var(self.infer_span)
|
||||
} else {
|
||||
t.super_fold_with(self)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue