]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/constrained_generic_params.rs
Auto merge of #65497 - choller:master, r=tmiasko
[rust.git] / src / librustc_typeck / constrained_generic_params.rs
index dd44f86717fe5fd1fe472261ca6a99ee4fa14957..1fdf49fde55b53082907be472a3865d543e88fc9 100644 (file)
@@ -55,7 +55,7 @@ struct ParameterCollector {
 
 impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
     fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
-        match t.sty {
+        match t.kind {
             ty::Projection(..) | ty::Opaque(..) if !self.include_nonconstraining => {
                 // projections are not injective
                 return false;
@@ -86,11 +86,11 @@ fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
 
 pub fn identify_constrained_generic_params<'tcx>(
     tcx: TyCtxt<'tcx>,
-    predicates: &ty::GenericPredicates<'tcx>,
+    predicates: ty::GenericPredicates<'tcx>,
     impl_trait_ref: Option<ty::TraitRef<'tcx>>,
     input_parameters: &mut FxHashSet<Parameter>,
 ) {
-    let mut predicates = predicates.predicates.clone();
+    let mut predicates = predicates.predicates.to_vec();
     setup_constraining_predicates(tcx, &mut predicates, impl_trait_ref, input_parameters);
 }