move the defaut object lifetime bound into the trait

This way, we don't have to repeat it.
This commit is contained in:
Niko Matsakis 2018-03-22 12:21:38 -04:00 committed by csmoe
parent 012262c4f2
commit bad80fe4ba

View file

@ -15,7 +15,7 @@ use hir::def_id::DefId;
use super::{FulfillmentContext, FulfillmentError};
use super::{ObligationCause, PendingPredicateObligation, PredicateObligation};
pub trait TraitEngine<'tcx> {
pub trait TraitEngine<'tcx>: 'tcx {
fn normalize_projection_type<'a, 'gcx>(
&mut self,
infcx: &InferCtxt<'a, 'gcx, 'tcx>,
@ -52,7 +52,7 @@ pub trait TraitEngine<'tcx> {
fn pending_obligations(&self) -> Vec<PendingPredicateObligation<'tcx>>;
}
impl<'a, 'gcx, 'tcx> TraitEngine<'tcx> + 'tcx {
impl<'a, 'gcx, 'tcx> dyn TraitEngine<'tcx> {
pub fn new(_tcx: TyCtxt<'_, '_, 'tcx>) -> Box<Self> {
Box::new(FulfillmentContext::new())
}