Remove TraitRef::new

This commit is contained in:
Oli Scherer 2022-12-13 11:25:31 +00:00
parent 65069d5c5b
commit fa87abf963

View File

@ -15,7 +15,7 @@
use rustc_middle::traits::Reveal;
use rustc_middle::ty::{
self, Binder, BoundConstness, Clause, GenericParamDefKind, ImplPolarity, ParamEnv, PredicateKind, TraitPredicate,
TraitRef, Ty, TyCtxt,
Ty, TyCtxt,
};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
@ -513,9 +513,9 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
tcx.mk_predicates(ty_predicates.iter().map(|&(p, _)| p).chain(
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
tcx.mk_predicate(Binder::dummy(PredicateKind::Clause(Clause::Trait(TraitPredicate {
trait_ref: TraitRef::new(
trait_ref: tcx.mk_trait_ref(
eq_trait_id,
tcx.mk_substs(std::iter::once(tcx.mk_param_from_def(param))),
[tcx.mk_param_from_def(param)],
),
constness: BoundConstness::NotConst,
polarity: ImplPolarity::Positive,