diff options
| -rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/canonical.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/combine.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/equate.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/glb.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/lub.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/nll_relate/mod.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/sub.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/build/matches/test.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/infer.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/method_chain.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/util.rs | 2 |
15 files changed, 22 insertions, 41 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 42949143431..18d7bde60d7 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -1,6 +1,7 @@ //! This query borrow-checks the MIR to (further) ensure it is not broken. #![allow(rustc::potential_query_instability)] +#![feature(associated_type_bounds)] #![feature(box_patterns)] #![feature(let_chains)] #![feature(min_specialization)] diff --git a/compiler/rustc_borrowck/src/type_check/canonical.rs b/compiler/rustc_borrowck/src/type_check/canonical.rs index 1be20f18707..b27d5d20532 100644 --- a/compiler/rustc_borrowck/src/type_check/canonical.rs +++ b/compiler/rustc_borrowck/src/type_check/canonical.rs @@ -117,7 +117,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { pub(super) fn prove_predicates( &mut self, - predicates: impl IntoIterator<Item = impl ToPredicate<'tcx> + std::fmt::Debug>, + predicates: impl IntoIterator<Item: ToPredicate<'tcx> + std::fmt::Debug>, locations: Locations, category: ConstraintCategory<'tcx>, ) { diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 243545640f9..33292e871b1 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -478,10 +478,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> { self.obligations.extend(obligations.into_iter()); } - pub fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ToPredicate<'tcx>>, - ) { + pub fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ToPredicate<'tcx>>) { self.obligations.extend(obligations.into_iter().map(|to_pred| { Obligation::new(self.infcx.tcx, self.trace.cause.clone(), self.param_env, to_pred) })) @@ -814,10 +811,7 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> { /// Register predicates that must hold in order for this relation to hold. Uses /// a default obligation cause, [`ObligationEmittingRelation::register_obligations`] should /// be used if control over the obligaton causes is required. - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ToPredicate<'tcx>>, - ); + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ToPredicate<'tcx>>); /// Register an obligation that both constants must be equal to each other. /// diff --git a/compiler/rustc_infer/src/infer/equate.rs b/compiler/rustc_infer/src/infer/equate.rs index f830e9b3c53..54a62326ef7 100644 --- a/compiler/rustc_infer/src/infer/equate.rs +++ b/compiler/rustc_infer/src/infer/equate.rs @@ -201,10 +201,7 @@ impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> { } impl<'tcx> ObligationEmittingRelation<'tcx> for Equate<'_, '_, 'tcx> { - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, - ) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { self.fields.register_predicates(obligations); } diff --git a/compiler/rustc_infer/src/infer/glb.rs b/compiler/rustc_infer/src/infer/glb.rs index 37ef022f827..49df393d83b 100644 --- a/compiler/rustc_infer/src/infer/glb.rs +++ b/compiler/rustc_infer/src/infer/glb.rs @@ -148,10 +148,7 @@ impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Glb<'combine, 'infcx, } impl<'tcx> ObligationEmittingRelation<'tcx> for Glb<'_, '_, 'tcx> { - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, - ) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { self.fields.register_predicates(obligations); } diff --git a/compiler/rustc_infer/src/infer/lub.rs b/compiler/rustc_infer/src/infer/lub.rs index f541fcbceed..c871ccb21f8 100644 --- a/compiler/rustc_infer/src/infer/lub.rs +++ b/compiler/rustc_infer/src/infer/lub.rs @@ -148,10 +148,7 @@ impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Lub<'combine, 'infcx, } impl<'tcx> ObligationEmittingRelation<'tcx> for Lub<'_, '_, 'tcx> { - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, - ) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { self.fields.register_predicates(obligations); } diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs index 214a5850fb6..6e413a7f412 100644 --- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs +++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs @@ -763,10 +763,7 @@ impl<'tcx, D> ObligationEmittingRelation<'tcx> for TypeRelating<'_, 'tcx, D> where D: TypeRelatingDelegate<'tcx>, { - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, - ) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { self.delegate.register_obligations( obligations .into_iter() diff --git a/compiler/rustc_infer/src/infer/sub.rs b/compiler/rustc_infer/src/infer/sub.rs index b4e647dcc9b..4c003789a4e 100644 --- a/compiler/rustc_infer/src/infer/sub.rs +++ b/compiler/rustc_infer/src/infer/sub.rs @@ -228,10 +228,7 @@ impl<'tcx> TypeRelation<'tcx> for Sub<'_, '_, 'tcx> { } impl<'tcx> ObligationEmittingRelation<'tcx> for Sub<'_, '_, 'tcx> { - fn register_predicates( - &mut self, - obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, - ) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { self.fields.register_predicates(obligations); } diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index b03ecb59750..bdc313c2141 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -13,6 +13,7 @@ //! This API is completely unstable and subject to change. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![feature(associated_type_bounds)] #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(extend_one)] diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index f347604a2cd..6bf54fa5417 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1856,7 +1856,7 @@ impl<'tcx> TyCtxt<'tcx> { pub fn mk_fn_def( self, def_id: DefId, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> Ty<'tcx> { let substs = self.check_substs(def_id, substs); self.mk_ty(FnDef(def_id, substs)) @@ -1866,7 +1866,7 @@ impl<'tcx> TyCtxt<'tcx> { fn check_substs( self, _def_id: DefId, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> SubstsRef<'tcx> { let substs = substs.into_iter().map(Into::into); #[cfg(debug_assertions)] @@ -1901,7 +1901,7 @@ impl<'tcx> TyCtxt<'tcx> { pub fn mk_projection( self, item_def_id: DefId, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> Ty<'tcx> { self.mk_alias(ty::Projection, self.mk_alias_ty(item_def_id, substs)) } @@ -2293,7 +2293,7 @@ impl<'tcx> TyCtxt<'tcx> { pub fn mk_trait_ref( self, trait_def_id: DefId, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> ty::TraitRef<'tcx> { let substs = self.check_substs(trait_def_id, substs); ty::TraitRef { def_id: trait_def_id, substs, _use_mk_trait_ref_instead: () } @@ -2302,7 +2302,7 @@ impl<'tcx> TyCtxt<'tcx> { pub fn mk_alias_ty( self, def_id: DefId, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> ty::AliasTy<'tcx> { let substs = self.check_substs(def_id, substs); ty::AliasTy { def_id, substs, _use_mk_alias_ty_instead: () } @@ -2472,7 +2472,7 @@ impl<'tcx> TyCtxtAt<'tcx> { pub fn mk_trait_ref( self, trait_lang_item: LangItem, - substs: impl IntoIterator<Item = impl Into<ty::GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<ty::GenericArg<'tcx>>>, ) -> ty::TraitRef<'tcx> { let trait_def_id = self.require_lang_item(trait_lang_item, Some(self.span)); self.tcx.mk_trait_ref(trait_def_id, substs) diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 7563656f91b..658f09a850d 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -568,7 +568,7 @@ impl<'tcx> GeneratorSubsts<'tcx> { self, def_id: DefId, tcx: TyCtxt<'tcx>, - ) -> impl Iterator<Item = impl Iterator<Item = Ty<'tcx>> + Captures<'tcx>> { + ) -> impl Iterator<Item: Iterator<Item = Ty<'tcx>> + Captures<'tcx>> { let layout = tcx.generator_layout(def_id).unwrap(); layout.variant_fields.iter().map(move |variant| { variant.iter().map(move |field| { diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs index 8859f5002e4..2de89f67dfd 100644 --- a/compiler/rustc_mir_build/src/build/matches/test.rs +++ b/compiler/rustc_mir_build/src/build/matches/test.rs @@ -832,7 +832,7 @@ fn trait_method<'tcx>( tcx: TyCtxt<'tcx>, trait_def_id: DefId, method_name: Symbol, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> ConstantKind<'tcx> { // The unhygienic comparison here is acceptable because this is only // used on known traits. diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs index 015029b7ac4..9b47c7299bb 100644 --- a/compiler/rustc_trait_selection/src/infer.rs +++ b/compiler/rustc_trait_selection/src/infer.rs @@ -42,7 +42,7 @@ pub trait InferCtxtExt<'tcx> { fn type_implements_trait( &self, trait_def_id: DefId, - params: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + params: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, param_env: ty::ParamEnv<'tcx>, ) -> traits::EvaluationResult; } @@ -82,7 +82,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { fn type_implements_trait( &self, trait_def_id: DefId, - params: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + params: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, param_env: ty::ParamEnv<'tcx>, ) -> traits::EvaluationResult { let trait_ref = self.tcx.mk_trait_ref(trait_def_id, params); diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/method_chain.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/method_chain.rs index 9474c70cb53..1174efdbfa8 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/method_chain.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/method_chain.rs @@ -98,7 +98,7 @@ impl<'tcx> ObligationEmittingRelation<'tcx> for CollectAllMismatches<'_, 'tcx> { fn register_predicates( &mut self, - _obligations: impl IntoIterator<Item = impl ty::ToPredicate<'tcx>>, + _obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>, ) { // FIXME(deferred_projection_equality) } diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index 0c55c35ffb4..638a6592c08 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -239,7 +239,7 @@ pub fn predicate_for_trait_def<'tcx>( cause: ObligationCause<'tcx>, trait_def_id: DefId, recursion_depth: usize, - params: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + params: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> PredicateObligation<'tcx> { let trait_ref = tcx.mk_trait_ref(trait_def_id, params); predicate_for_trait_ref(tcx, cause, param_env, trait_ref, recursion_depth) |
