diff options
| author | LeSeulArtichaut <leseulartichaut@gmail.com> | 2020-10-25 11:50:56 +0100 |
|---|---|---|
| committer | LeSeulArtichaut <leseulartichaut@gmail.com> | 2020-10-30 12:27:47 +0100 |
| commit | 9433eb83fefab6e18fe9d963d1005bd9924e8323 (patch) | |
| tree | 5d5c6fcde0ded32f4e13dcedc250ecac2e626dc2 /compiler/rustc_privacy/src | |
| parent | 24e1a7e6564edaf237a653bec147934d38cfac48 (diff) | |
| download | rust-9433eb83fefab6e18fe9d963d1005bd9924e8323.tar.gz rust-9433eb83fefab6e18fe9d963d1005bd9924e8323.zip | |
Remove implicit `Continue` type
Diffstat (limited to 'compiler/rustc_privacy/src')
| -rw-r--r-- | compiler/rustc_privacy/src/lib.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 306ae3eb036..4f7014ce2b7 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -56,7 +56,7 @@ trait DefIdVisitor<'tcx> { def_id: DefId, kind: &str, descr: &dyn fmt::Display, - ) -> ControlFlow<(), ()>; + ) -> ControlFlow<()>; /// Not overridden, but used to actually visit types and traits. fn skeleton(&mut self) -> DefIdVisitorSkeleton<'_, 'tcx, Self> { @@ -66,13 +66,13 @@ trait DefIdVisitor<'tcx> { dummy: Default::default(), } } - fn visit(&mut self, ty_fragment: impl TypeFoldable<'tcx>) -> ControlFlow<(), ()> { + fn visit(&mut self, ty_fragment: impl TypeFoldable<'tcx>) -> ControlFlow<()> { ty_fragment.visit_with(&mut self.skeleton()) } - fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<(), ()> { + fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<()> { self.skeleton().visit_trait(trait_ref) } - fn visit_predicates(&mut self, predicates: ty::GenericPredicates<'tcx>) -> ControlFlow<(), ()> { + fn visit_predicates(&mut self, predicates: ty::GenericPredicates<'tcx>) -> ControlFlow<()> { self.skeleton().visit_predicates(predicates) } } @@ -87,13 +87,13 @@ impl<'tcx, V> DefIdVisitorSkeleton<'_, 'tcx, V> where V: DefIdVisitor<'tcx> + ?Sized, { - fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<(), ()> { + fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<()> { let TraitRef { def_id, substs } = trait_ref; self.def_id_visitor.visit_def_id(def_id, "trait", &trait_ref.print_only_trait_path())?; if self.def_id_visitor.shallow() { ControlFlow::CONTINUE } else { substs.visit_with(self) } } - fn visit_predicate(&mut self, predicate: ty::Predicate<'tcx>) -> ControlFlow<(), ()> { + fn visit_predicate(&mut self, predicate: ty::Predicate<'tcx>) -> ControlFlow<()> { match predicate.skip_binders() { ty::PredicateAtom::Trait(ty::TraitPredicate { trait_ref }, _) => { self.visit_trait(trait_ref) @@ -119,7 +119,7 @@ where } } - fn visit_predicates(&mut self, predicates: ty::GenericPredicates<'tcx>) -> ControlFlow<(), ()> { + fn visit_predicates(&mut self, predicates: ty::GenericPredicates<'tcx>) -> ControlFlow<()> { let ty::GenericPredicates { parent: _, predicates } = predicates; predicates.iter().try_for_each(|&(predicate, _span)| self.visit_predicate(predicate)) } @@ -129,7 +129,7 @@ impl<'tcx, V> TypeVisitor<'tcx> for DefIdVisitorSkeleton<'_, 'tcx, V> where V: DefIdVisitor<'tcx> + ?Sized, { - fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<(), ()> { + fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<()> { let tcx = self.def_id_visitor.tcx(); // InternalSubsts are not visited here because they are visited below in `super_visit_with`. match *ty.kind() { @@ -283,7 +283,7 @@ impl<'a, 'tcx, VL: VisibilityLike> DefIdVisitor<'tcx> for FindMin<'a, 'tcx, VL> def_id: DefId, _kind: &str, _descr: &dyn fmt::Display, - ) -> ControlFlow<(), ()> { + ) -> ControlFlow<()> { self.min = VL::new_min(self, def_id); ControlFlow::CONTINUE } @@ -902,7 +902,7 @@ impl DefIdVisitor<'tcx> for ReachEverythingInTheInterfaceVisitor<'_, 'tcx> { def_id: DefId, _kind: &str, _descr: &dyn fmt::Display, - ) -> ControlFlow<(), ()> { + ) -> ControlFlow<()> { if let Some(def_id) = def_id.as_local() { if let (ty::Visibility::Public, _) | (_, Some(AccessLevel::ReachableFromImplTrait)) = (self.tcx().visibility(def_id.to_def_id()), self.access_level) @@ -1079,7 +1079,7 @@ impl<'tcx> TypePrivacyVisitor<'tcx> { fn check_expr_pat_type(&mut self, id: hir::HirId, span: Span) -> bool { self.span = span; let typeck_results = self.typeck_results(); - let result: ControlFlow<(), ()> = try { + let result: ControlFlow<()> = try { self.visit(typeck_results.node_type(id))?; self.visit(typeck_results.node_substs(id))?; if let Some(adjustments) = typeck_results.adjustments().get(id) { @@ -1297,7 +1297,7 @@ impl DefIdVisitor<'tcx> for TypePrivacyVisitor<'tcx> { def_id: DefId, kind: &str, descr: &dyn fmt::Display, - ) -> ControlFlow<(), ()> { + ) -> ControlFlow<()> { if self.check_def_id(def_id, kind, descr) { ControlFlow::BREAK } else { @@ -1797,7 +1797,7 @@ impl DefIdVisitor<'tcx> for SearchInterfaceForPrivateItemsVisitor<'tcx> { def_id: DefId, kind: &str, descr: &dyn fmt::Display, - ) -> ControlFlow<(), ()> { + ) -> ControlFlow<()> { if self.check_def_id(def_id, kind, descr) { ControlFlow::BREAK } else { |
