Skip to content

Commit

Permalink
Make suggestions from @jackh726; run fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Poitras committed Dec 14, 2021
1 parent ae21dd0 commit a586e7d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ fn check_method_receiver<'fcx, 'tcx>(
}
}

fn e0307<'fcx, 'tcx> (fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
fn e0307<'tcx>(fcx: &FnCtxt<'_, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
struct_span_err!(
fcx.tcx.sess.diagnostic(),
span,
Expand Down Expand Up @@ -1696,8 +1696,8 @@ pub struct CheckTypeWellFormedVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
}

impl CheckTypeWellFormedVisitor<'_> {
pub fn new(tcx: TyCtxt<'_>) -> CheckTypeWellFormedVisitor<'_> {
impl<'tcx> CheckTypeWellFormedVisitor<'tcx> {
pub fn new(tcx: TyCtxt<'tcx>) -> CheckTypeWellFormedVisitor<'tcx> {
CheckTypeWellFormedVisitor { tcx }
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check_unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
unused_crates_lint(tcx);
}

impl <'v, 'tcx> ItemLikeVisitor<'v> for CheckVisitor<'tcx> {
impl<'tcx> ItemLikeVisitor<'_> for CheckVisitor<'tcx> {
fn visit_item(&mut self, item: &hir::Item<'_>) {
if item.vis.node.is_pub() || item.span.is_dummy() {
return;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
}
}

fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
fn visit_implementation_of_coerce_unsized<'tcx>(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) {
debug!("visit_implementation_of_coerce_unsized: impl_did={:?}", impl_did);

// Just compute this for the side-effects, in particular reporting
Expand All @@ -118,7 +118,7 @@ fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'_>, impl_did: LocalDefId)
tcx.at(span).coerce_unsized_info(impl_did);
}

fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
fn visit_implementation_of_dispatch_from_dyn<'tcx>(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) {
debug!("visit_implementation_of_dispatch_from_dyn: impl_did={:?}", impl_did);

let impl_hir_id = tcx.hir().local_def_id_to_hir_id(impl_did);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/coherence/inherent_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct InherentCollect<'tcx> {
impls_map: CrateInherentImpls,
}

impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentCollect<'tcx> {
impl<'tcx> ItemLikeVisitor<'_> for InherentCollect<'tcx> {
fn visit_item(&mut self, item: &hir::Item<'_>) {
let (ty, assoc_items) = match item.kind {
hir::ItemKind::Impl(hir::Impl { of_trait: None, ref self_ty, items, .. }) => {
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
}
}

impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
fn visit_item(&mut self, item: &'v hir::Item<'v>) {
impl<'tcx> ItemLikeVisitor<'_> for InherentOverlapChecker<'tcx> {
fn visit_item(&mut self, item: &hir::Item<'_>) {
match item.kind {
hir::ItemKind::Enum(..)
| hir::ItemKind::Struct(..)
Expand Down Expand Up @@ -300,9 +300,9 @@ impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
}
}

fn visit_trait_item(&mut self, _trait_item: &hir::TraitItem<'v>) {}
fn visit_trait_item(&mut self, _trait_item: &hir::TraitItem<'_>) {}

fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'v>) {}
fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'_>) {}

fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'v>) {}
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {}
}
8 changes: 4 additions & 4 deletions compiler/rustc_typeck/src/coherence/unsafety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ struct UnsafetyChecker<'tcx> {
}

impl<'tcx> UnsafetyChecker<'tcx> {
fn check_unsafety_coherence<'v>(
fn check_unsafety_coherence(
&mut self,
item: &'v hir::Item<'v>,
item: &hir::Item<'_>,
impl_generics: Option<&hir::Generics<'_>>,
unsafety: hir::Unsafety,
polarity: hir::ImplPolarity,
Expand Down Expand Up @@ -83,8 +83,8 @@ impl<'tcx> UnsafetyChecker<'tcx> {
}
}

impl<'v, 'tcx> ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> {
fn visit_item(&mut self, item: &'v hir::Item<'v>) {
impl<'tcx> ItemLikeVisitor<'_> for UnsafetyChecker<'tcx> {
fn visit_item(&mut self, item: &hir::Item<'_>) {
if let hir::ItemKind::Impl(ref impl_) = item.kind {
self.check_unsafety_coherence(
item,
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_typeck/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ crate fn placeholder_type_error<'tcx>(
err.emit();
}

fn reject_placeholder_type_signatures_in_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) {
fn reject_placeholder_type_signatures_in_item<'tcx>(
tcx: TyCtxt<'tcx>,
item: &'tcx hir::Item<'tcx>,
) {
let (generics, suggest) = match &item.kind {
hir::ItemKind::Union(_, generics)
| hir::ItemKind::Enum(_, generics)
Expand Down

0 comments on commit a586e7d

Please sign in to comment.