]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/object_safety.rs
Prevent the creation of `TraitRef` without dedicated methods
[rust.git] / compiler / rustc_trait_selection / src / traits / object_safety.rs
index 3e85ea69635e645c953b4e3eec401e1f3390e318..71919b2078ef678fd043c161bd3c85e4bcf86507 100644 (file)
@@ -703,9 +703,7 @@ fn receiver_is_dispatchable<'tcx>(
                     }
                 });
 
-            ty::Binder::dummy(ty::TraitRef { def_id: unsize_did, substs })
-                .without_const()
-                .to_predicate(tcx)
+            ty::Binder::dummy(tcx.mk_trait_ref(unsize_did, substs)).to_predicate(tcx)
         };
 
         let caller_bounds: Vec<Predicate<'tcx>> =