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
|
@ -226,13 +226,11 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
|
|||
false
|
||||
};
|
||||
|
||||
let expected_trait_ref = self.cx.resolve_vars_if_possible(ty::TraitRef {
|
||||
def_id: trait_def_id,
|
||||
substs: expected_substs,
|
||||
});
|
||||
let actual_trait_ref = self
|
||||
let expected_trait_ref = self
|
||||
.cx
|
||||
.resolve_vars_if_possible(ty::TraitRef { def_id: trait_def_id, substs: actual_substs });
|
||||
.resolve_vars_if_possible(self.cx.tcx.mk_trait_ref(trait_def_id, expected_substs));
|
||||
let actual_trait_ref =
|
||||
self.cx.resolve_vars_if_possible(self.cx.tcx.mk_trait_ref(trait_def_id, actual_substs));
|
||||
|
||||
// Search the expected and actual trait references to see (a)
|
||||
// whether the sub/sup placeholders appear in them (sometimes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue