Add new ToPredicate
impls and TraitRef
methods to remove some ty::Binber::dummy
calls
This commit is contained in:
parent
4f2532fb53
commit
1b8c7784e5
9 changed files with 46 additions and 32 deletions
|
@ -57,7 +57,7 @@ impl<'tcx> Bounds<'tcx> {
|
|||
|
||||
pub fn push_sized(&mut self, tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, span: Span) {
|
||||
let sized_def_id = tcx.require_lang_item(LangItem::Sized, Some(span));
|
||||
let trait_ref = ty::Binder::dummy(ty::TraitRef::new(tcx, sized_def_id, [ty]));
|
||||
let trait_ref = ty::TraitRef::new(tcx, sized_def_id, [ty]);
|
||||
// Preferable to put this obligation first, since we report better errors for sized ambiguity.
|
||||
self.predicates.insert(0, (trait_ref.without_const().to_predicate(tcx), span));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue