Skip to content

Commit a586e7d

Browse files
Make suggestions from @jackh726; run fmt
1 parent ae21dd0 commit a586e7d

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

Diff for: compiler/rustc_typeck/src/check/wfcheck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ fn check_method_receiver<'fcx, 'tcx>(
14501450
}
14511451
}
14521452

1453-
fn e0307<'fcx, 'tcx> (fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
1453+
fn e0307<'tcx>(fcx: &FnCtxt<'_, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
14541454
struct_span_err!(
14551455
fcx.tcx.sess.diagnostic(),
14561456
span,
@@ -1696,8 +1696,8 @@ pub struct CheckTypeWellFormedVisitor<'tcx> {
16961696
tcx: TyCtxt<'tcx>,
16971697
}
16981698

1699-
impl CheckTypeWellFormedVisitor<'_> {
1700-
pub fn new(tcx: TyCtxt<'_>) -> CheckTypeWellFormedVisitor<'_> {
1699+
impl<'tcx> CheckTypeWellFormedVisitor<'tcx> {
1700+
pub fn new(tcx: TyCtxt<'tcx>) -> CheckTypeWellFormedVisitor<'tcx> {
17011701
CheckTypeWellFormedVisitor { tcx }
17021702
}
17031703
}

Diff for: compiler/rustc_typeck/src/check_unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
2121
unused_crates_lint(tcx);
2222
}
2323

24-
impl <'v, 'tcx> ItemLikeVisitor<'v> for CheckVisitor<'tcx> {
24+
impl<'tcx> ItemLikeVisitor<'_> for CheckVisitor<'tcx> {
2525
fn visit_item(&mut self, item: &hir::Item<'_>) {
2626
if item.vis.node.is_pub() || item.span.is_dummy() {
2727
return;

Diff for: compiler/rustc_typeck/src/coherence/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
108108
}
109109
}
110110

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

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

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

124124
let impl_hir_id = tcx.hir().local_def_id_to_hir_id(impl_did);

Diff for: compiler/rustc_typeck/src/coherence/inherent_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct InherentCollect<'tcx> {
3838
impls_map: CrateInherentImpls,
3939
}
4040

41-
impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentCollect<'tcx> {
41+
impl<'tcx> ItemLikeVisitor<'_> for InherentCollect<'tcx> {
4242
fn visit_item(&mut self, item: &hir::Item<'_>) {
4343
let (ty, assoc_items) = match item.kind {
4444
hir::ItemKind::Impl(hir::Impl { of_trait: None, ref self_ty, items, .. }) => {

Diff for: compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
115115
}
116116
}
117117

118-
impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
119-
fn visit_item(&mut self, item: &'v hir::Item<'v>) {
118+
impl<'tcx> ItemLikeVisitor<'_> for InherentOverlapChecker<'tcx> {
119+
fn visit_item(&mut self, item: &hir::Item<'_>) {
120120
match item.kind {
121121
hir::ItemKind::Enum(..)
122122
| hir::ItemKind::Struct(..)
@@ -300,9 +300,9 @@ impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
300300
}
301301
}
302302

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

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

307-
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'v>) {}
307+
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {}
308308
}

Diff for: compiler/rustc_typeck/src/coherence/unsafety.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ struct UnsafetyChecker<'tcx> {
1717
}
1818

1919
impl<'tcx> UnsafetyChecker<'tcx> {
20-
fn check_unsafety_coherence<'v>(
20+
fn check_unsafety_coherence(
2121
&mut self,
22-
item: &'v hir::Item<'v>,
22+
item: &hir::Item<'_>,
2323
impl_generics: Option<&hir::Generics<'_>>,
2424
unsafety: hir::Unsafety,
2525
polarity: hir::ImplPolarity,
@@ -83,8 +83,8 @@ impl<'tcx> UnsafetyChecker<'tcx> {
8383
}
8484
}
8585

86-
impl<'v, 'tcx> ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> {
87-
fn visit_item(&mut self, item: &'v hir::Item<'v>) {
86+
impl<'tcx> ItemLikeVisitor<'_> for UnsafetyChecker<'tcx> {
87+
fn visit_item(&mut self, item: &hir::Item<'_>) {
8888
if let hir::ItemKind::Impl(ref impl_) = item.kind {
8989
self.check_unsafety_coherence(
9090
item,

Diff for: compiler/rustc_typeck/src/collect.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ crate fn placeholder_type_error<'tcx>(
223223
err.emit();
224224
}
225225

226-
fn reject_placeholder_type_signatures_in_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) {
226+
fn reject_placeholder_type_signatures_in_item<'tcx>(
227+
tcx: TyCtxt<'tcx>,
228+
item: &'tcx hir::Item<'tcx>,
229+
) {
227230
let (generics, suggest) = match &item.kind {
228231
hir::ItemKind::Union(_, generics)
229232
| hir::ItemKind::Enum(_, generics)

0 commit comments

Comments
 (0)