Skip to content

Commit 4783f3d

Browse files
committed
Make all object-safety methods require a global TyCtxt
1 parent e92e9ce commit 4783f3d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
699699
}
700700

701701
ty::Predicate::ObjectSafe(trait_def_id) => {
702-
let violations = self.tcx.object_safety_violations(trait_def_id);
702+
let violations = self.tcx.global_tcx().object_safety_violations(trait_def_id);
703703
self.tcx.report_object_safety_error(span,
704704
trait_def_id,
705705
violations)
@@ -820,7 +820,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
820820
}
821821

822822
TraitNotObjectSafe(did) => {
823-
let violations = self.tcx.object_safety_violations(did);
823+
let violations = self.tcx.global_tcx().object_safety_violations(did);
824824
self.tcx.report_object_safety_error(span, did,
825825
violations)
826826
}

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub enum MethodViolationCode {
8989
NonStandardSelfType,
9090
}
9191

92-
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
92+
impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
9393

9494
/// Returns the object safety violations that affect
9595
/// astconv - currently, Self in supertraits. This is needed

src/librustc_typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
687687
// most importantly, that the supertraits don't contain Self,
688688
// to avoid ICE-s.
689689
let object_safety_violations =
690-
tcx.astconv_object_safety_violations(principal.def_id());
690+
tcx.global_tcx().astconv_object_safety_violations(principal.def_id());
691691
if !object_safety_violations.is_empty() {
692692
tcx.report_object_safety_error(
693693
span, principal.def_id(), object_safety_violations)

0 commit comments

Comments
 (0)