Prevent the creation of TraitRef
without dedicated methods
This commit is contained in:
parent
a5cd3bde95
commit
6af3638709
9 changed files with 44 additions and 47 deletions
|
@ -570,7 +570,7 @@ fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, id: hir::ItemId) {
|
|||
assoc_item,
|
||||
assoc_item,
|
||||
default.span,
|
||||
ty::TraitRef { def_id: it.owner_id.to_def_id(), substs: trait_substs },
|
||||
tcx.mk_trait_ref(it.owner_id.to_def_id(), trait_substs),
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -160,7 +160,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
|
|||
// instead of requiring an additional `+ 'a`.
|
||||
match pred.kind().skip_binder() {
|
||||
ty::PredicateKind::Clause(ty::Clause::Trait(ty::TraitPredicate {
|
||||
trait_ref: ty::TraitRef { def_id: _, substs },
|
||||
trait_ref: ty::TraitRef { def_id: _, substs, .. },
|
||||
constness: _,
|
||||
polarity: _,
|
||||
})) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue