Use associated_type_bounds where applicable - closes #61738
This commit is contained in:
parent
d4abb08be6
commit
3a6a29b4ec
25 changed files with 169 additions and 124 deletions
|
|
@ -61,6 +61,7 @@
|
|||
#![feature(proc_macro_hygiene)]
|
||||
#![feature(log_syntax)]
|
||||
#![feature(mem_take)]
|
||||
#![feature(associated_type_bounds)]
|
||||
|
||||
#![recursion_limit="512"]
|
||||
|
||||
|
|
|
|||
|
|
@ -3901,7 +3901,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// each predicate must be preceded by the obligations required
|
||||
// to normalize it.
|
||||
// for example, if we have:
|
||||
// impl<U: Iterator, V: Iterator<Item=U>> Foo for V where U::Item: Copy
|
||||
// impl<U: Iterator<Item: Copy>, V: Iterator<Item = U>> Foo for V
|
||||
// the impl will have the following predicates:
|
||||
// <V as Iterator>::Item = U,
|
||||
// U: Iterator, U: Sized,
|
||||
|
|
|
|||
|
|
@ -980,8 +980,7 @@ EnumTypeFoldableImpl! {
|
|||
(chalk_engine::DelayedLiteral::Negative)(a),
|
||||
(chalk_engine::DelayedLiteral::Positive)(a, b),
|
||||
} where
|
||||
C: chalk_engine::context::Context + Clone,
|
||||
C::CanonicalConstrainedSubst: TypeFoldable<'tcx>,
|
||||
C: chalk_engine::context::Context<CanonicalConstrainedSubst: TypeFoldable<'tcx>> + Clone,
|
||||
}
|
||||
|
||||
EnumTypeFoldableImpl! {
|
||||
|
|
@ -989,8 +988,7 @@ EnumTypeFoldableImpl! {
|
|||
(chalk_engine::Literal::Negative)(a),
|
||||
(chalk_engine::Literal::Positive)(a),
|
||||
} where
|
||||
C: chalk_engine::context::Context + Clone,
|
||||
C::GoalInEnvironment: Clone + TypeFoldable<'tcx>,
|
||||
C: chalk_engine::context::Context<GoalInEnvironment: Clone + TypeFoldable<'tcx>> + Clone,
|
||||
}
|
||||
|
||||
CloneTypeFoldableAndLiftImpls! {
|
||||
|
|
|
|||
|
|
@ -2663,8 +2663,8 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
unsafety: hir::Unsafety,
|
||||
abi: abi::Abi)
|
||||
-> <I::Item as InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>>::Output
|
||||
where I: Iterator,
|
||||
I::Item: InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>
|
||||
where
|
||||
I: Iterator<Item: InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>>,
|
||||
{
|
||||
inputs.chain(iter::once(output)).intern_with(|xs| ty::FnSig {
|
||||
inputs_and_output: self.intern_type_list(xs),
|
||||
|
|
|
|||
|
|
@ -2027,9 +2027,9 @@ impl ty::query::TyCtxtAt<'tcx> {
|
|||
|
||||
impl<'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
|
||||
where
|
||||
C: LayoutOf<Ty = Ty<'tcx>> + HasTyCtxt<'tcx>,
|
||||
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
|
||||
C: HasParamEnv<'tcx>,
|
||||
C: LayoutOf<Ty = Ty<'tcx>, TyLayout: MaybeResult<TyLayout<'tcx>>>
|
||||
+ HasTyCtxt<'tcx>
|
||||
+ HasParamEnv<'tcx>,
|
||||
{
|
||||
fn for_variant(this: TyLayout<'tcx>, cx: &C, variant_index: VariantIdx) -> TyLayout<'tcx> {
|
||||
let details = match this.variants {
|
||||
|
|
|
|||
|
|
@ -1055,9 +1055,8 @@ fn encode_query_results<'a, 'tcx, Q, E>(
|
|||
query_result_index: &mut EncodedQueryResultIndex,
|
||||
) -> Result<(), E::Error>
|
||||
where
|
||||
Q: super::config::QueryDescription<'tcx>,
|
||||
Q: super::config::QueryDescription<'tcx, Value: Encodable>,
|
||||
E: 'a + TyEncoder,
|
||||
Q::Value: Encodable,
|
||||
{
|
||||
let desc = &format!("encode_query_results for {}",
|
||||
::std::any::type_name::<Q>());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue