]> git.lizzy.rs Git - rust.git/commitdiff
Make all object-safety methods require a global TyCtxt
authorMichael Hewson <michael@michaelhewson.ca>
Mon, 2 Jul 2018 22:30:59 +0000 (18:30 -0400)
committerMichael Hewson <michael@michaelhewson.ca>
Thu, 1 Nov 2018 22:15:19 +0000 (18:15 -0400)
src/librustc/traits/error_reporting.rs
src/librustc/traits/object_safety.rs
src/librustc_typeck/astconv.rs

index b463faef1921ad966b24a97ac3b4e0494074d6c4..18ee98c515fb27dc643442f890b7b5d207aac060 100644 (file)
@@ -754,7 +754,8 @@ pub fn report_selection_error(&self,
                     }
 
                     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 @@ pub fn report_selection_error(&self,
             }
 
             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)
             }
 
index d5942e738fdd9ad6a334e9b9ed69eea92b10defd..bb0828e6eb8a04e57bb8b3a631ff460d73aba46d 100644 (file)
@@ -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
index 7ddc56974d816157abbf594c8c15c24f7d52765e..afd8c251b76508c30a8620020e7ae13317061172 100644 (file)
@@ -1013,7 +1013,7 @@ fn conv_object_ty_poly_trait_ref(&self,
         // 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)