Make all object-safety methods require a global TyCtxt
This commit is contained in:
parent
451987d86c
commit
d14af130f6
3 changed files with 5 additions and 4 deletions
|
|
@ -754,7 +754,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
|
||||
ty::Predicate::ObjectSafe(trait_def_id) => {
|
||||
let violations = self.tcx.object_safety_violations(trait_def_id);
|
||||
let violations = self.tcx.global_tcx()
|
||||
.object_safety_violations(trait_def_id);
|
||||
self.tcx.report_object_safety_error(span,
|
||||
trait_def_id,
|
||||
violations)
|
||||
|
|
@ -875,7 +876,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
|
||||
TraitNotObjectSafe(did) => {
|
||||
let violations = self.tcx.object_safety_violations(did);
|
||||
let violations = self.tcx.global_tcx().object_safety_violations(did);
|
||||
self.tcx.report_object_safety_error(span, did, violations)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ pub enum MethodViolationCode {
|
|||
NonStandardSelfType,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
||||
impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
|
||||
|
||||
/// Returns the object safety violations that affect
|
||||
/// astconv - currently, Self in supertraits. This is needed
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
|
|||
// most importantly, that the supertraits don't contain Self,
|
||||
// to avoid ICE-s.
|
||||
let object_safety_violations =
|
||||
tcx.astconv_object_safety_violations(principal.def_id());
|
||||
tcx.global_tcx().astconv_object_safety_violations(principal.def_id());
|
||||
if !object_safety_violations.is_empty() {
|
||||
tcx.report_object_safety_error(
|
||||
span, principal.def_id(), object_safety_violations)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue