Skip to content

Commit 60bbf54

Browse files
committed
Fix clippy::needless_lifetime
1 parent cf4c801 commit 60bbf54

File tree

9 files changed

+62
-85
lines changed

9 files changed

+62
-85
lines changed

chalk-integration/src/interner.rs

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -241,23 +241,23 @@ impl Interner for ChalkIr {
241241
Arc::new(TyData { kind, flags })
242242
}
243243

244-
fn ty_data<'a>(self, ty: &'a Arc<TyData<ChalkIr>>) -> &'a TyData<Self> {
244+
fn ty_data(self, ty: &Arc<TyData<ChalkIr>>) -> &TyData<Self> {
245245
ty
246246
}
247247

248248
fn intern_lifetime(self, lifetime: LifetimeData<ChalkIr>) -> LifetimeData<ChalkIr> {
249249
lifetime
250250
}
251251

252-
fn lifetime_data<'a>(self, lifetime: &'a LifetimeData<ChalkIr>) -> &'a LifetimeData<ChalkIr> {
252+
fn lifetime_data(self, lifetime: &LifetimeData<ChalkIr>) -> &LifetimeData<ChalkIr> {
253253
lifetime
254254
}
255255

256256
fn intern_const(self, constant: ConstData<ChalkIr>) -> Arc<ConstData<ChalkIr>> {
257257
Arc::new(constant)
258258
}
259259

260-
fn const_data<'a>(self, constant: &'a Arc<ConstData<ChalkIr>>) -> &'a ConstData<ChalkIr> {
260+
fn const_data(self, constant: &Arc<ConstData<ChalkIr>>) -> &ConstData<ChalkIr> {
261261
constant
262262
}
263263

@@ -269,18 +269,15 @@ impl Interner for ChalkIr {
269269
generic_arg
270270
}
271271

272-
fn generic_arg_data<'a>(
273-
self,
274-
generic_arg: &'a GenericArgData<ChalkIr>,
275-
) -> &'a GenericArgData<ChalkIr> {
272+
fn generic_arg_data(self, generic_arg: &GenericArgData<ChalkIr>) -> &GenericArgData<ChalkIr> {
276273
generic_arg
277274
}
278275

279276
fn intern_goal(self, goal: GoalData<ChalkIr>) -> Arc<GoalData<ChalkIr>> {
280277
Arc::new(goal)
281278
}
282279

283-
fn goal_data<'a>(self, goal: &'a Arc<GoalData<ChalkIr>>) -> &'a GoalData<ChalkIr> {
280+
fn goal_data(self, goal: &Arc<GoalData<ChalkIr>>) -> &GoalData<ChalkIr> {
284281
goal
285282
}
286283

@@ -291,7 +288,7 @@ impl Interner for ChalkIr {
291288
data.into_iter().collect()
292289
}
293290

294-
fn goals_data<'a>(self, goals: &'a Vec<Goal<ChalkIr>>) -> &'a [Goal<ChalkIr>] {
291+
fn goals_data(self, goals: &Vec<Goal<ChalkIr>>) -> &[Goal<ChalkIr>] {
295292
goals
296293
}
297294

@@ -302,21 +299,15 @@ impl Interner for ChalkIr {
302299
data.into_iter().collect()
303300
}
304301

305-
fn substitution_data<'a>(
306-
self,
307-
substitution: &'a Vec<GenericArg<ChalkIr>>,
308-
) -> &'a [GenericArg<ChalkIr>] {
302+
fn substitution_data(self, substitution: &Vec<GenericArg<ChalkIr>>) -> &[GenericArg<ChalkIr>] {
309303
substitution
310304
}
311305

312306
fn intern_program_clause(self, data: ProgramClauseData<Self>) -> ProgramClauseData<Self> {
313307
data
314308
}
315309

316-
fn program_clause_data<'a>(
317-
self,
318-
clause: &'a ProgramClauseData<Self>,
319-
) -> &'a ProgramClauseData<Self> {
310+
fn program_clause_data(self, clause: &ProgramClauseData<Self>) -> &ProgramClauseData<Self> {
320311
clause
321312
}
322313

@@ -327,10 +318,7 @@ impl Interner for ChalkIr {
327318
data.into_iter().collect()
328319
}
329320

330-
fn program_clauses_data<'a>(
331-
self,
332-
clauses: &'a Vec<ProgramClause<Self>>,
333-
) -> &'a [ProgramClause<Self>] {
321+
fn program_clauses_data(self, clauses: &Vec<ProgramClause<Self>>) -> &[ProgramClause<Self>] {
334322
clauses
335323
}
336324

@@ -341,10 +329,10 @@ impl Interner for ChalkIr {
341329
data.into_iter().collect()
342330
}
343331

344-
fn quantified_where_clauses_data<'a>(
332+
fn quantified_where_clauses_data(
345333
self,
346-
clauses: &'a Self::InternedQuantifiedWhereClauses,
347-
) -> &'a [QuantifiedWhereClause<Self>] {
334+
clauses: &Self::InternedQuantifiedWhereClauses,
335+
) -> &[QuantifiedWhereClause<Self>] {
348336
clauses
349337
}
350338
fn intern_generic_arg_kinds<E>(
@@ -354,10 +342,10 @@ impl Interner for ChalkIr {
354342
data.into_iter().collect()
355343
}
356344

357-
fn variable_kinds_data<'a>(
345+
fn variable_kinds_data(
358346
self,
359-
variable_kinds: &'a Self::InternedVariableKinds,
360-
) -> &'a [VariableKind<ChalkIr>] {
347+
variable_kinds: &Self::InternedVariableKinds,
348+
) -> &[VariableKind<ChalkIr>] {
361349
variable_kinds
362350
}
363351

@@ -368,10 +356,10 @@ impl Interner for ChalkIr {
368356
data.into_iter().collect()
369357
}
370358

371-
fn canonical_var_kinds_data<'a>(
359+
fn canonical_var_kinds_data(
372360
self,
373-
canonical_var_kinds: &'a Self::InternedCanonicalVarKinds,
374-
) -> &'a [CanonicalVarKind<ChalkIr>] {
361+
canonical_var_kinds: &Self::InternedCanonicalVarKinds,
362+
) -> &[CanonicalVarKind<ChalkIr>] {
375363
canonical_var_kinds
376364
}
377365

@@ -382,10 +370,10 @@ impl Interner for ChalkIr {
382370
data.into_iter().collect()
383371
}
384372

385-
fn constraints_data<'a>(
373+
fn constraints_data(
386374
self,
387-
constraints: &'a Self::InternedConstraints,
388-
) -> &'a [InEnvironment<Constraint<Self>>] {
375+
constraints: &Self::InternedConstraints,
376+
) -> &[InEnvironment<Constraint<Self>>] {
389377
constraints
390378
}
391379

@@ -396,7 +384,7 @@ impl Interner for ChalkIr {
396384
data.into_iter().collect()
397385
}
398386

399-
fn variances_data<'a>(self, variances: &'a Self::InternedVariances) -> &'a [Variance] {
387+
fn variances_data(self, variances: &Self::InternedVariances) -> &[Variance] {
400388
variances
401389
}
402390
}

chalk-ir/src/debug.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<I: Interner> VariableKinds<I> {
320320
}
321321

322322
/// Helper method for debugging variable kinds.
323-
pub fn inner_debug<'a>(&'a self, interner: I) -> VariableKindsInnerDebug<'a, I> {
323+
pub fn inner_debug(&self, interner: I) -> VariableKindsInnerDebug<'_, I> {
324324
VariableKindsInnerDebug {
325325
variable_kinds: self,
326326
interner,
@@ -420,7 +420,7 @@ impl<'a, I: Interner> Debug for GoalsDebug<'a, I> {
420420

421421
impl<I: Interner> Goals<I> {
422422
/// Show debug output for `Goals`.
423-
pub fn debug<'a>(&'a self, interner: I) -> GoalsDebug<'a, I> {
423+
pub fn debug(&self, interner: I) -> GoalsDebug<'_, I> {
424424
GoalsDebug {
425425
goals: self,
426426
interner,
@@ -476,7 +476,7 @@ impl<'a, I: Interner> Debug for ProgramClauseImplicationDebug<'a, I> {
476476

477477
impl<I: Interner> ProgramClauseImplication<I> {
478478
/// Show debug output for the program clause implication.
479-
pub fn debug<'a>(&'a self, interner: I) -> ProgramClauseImplicationDebug<'a, I> {
479+
pub fn debug(&self, interner: I) -> ProgramClauseImplicationDebug<'_, I> {
480480
ProgramClauseImplicationDebug {
481481
pci: self,
482482
interner,
@@ -556,7 +556,7 @@ impl<'a, I: Interner> Debug for TyKindDebug<'a, I> {
556556

557557
impl<I: Interner> TyKind<I> {
558558
/// Show debug output for the application type.
559-
pub fn debug<'a>(&'a self, interner: I) -> TyKindDebug<'a, I> {
559+
pub fn debug(&self, interner: I) -> TyKindDebug<'_, I> {
560560
TyKindDebug { ty: self, interner }
561561
}
562562
}
@@ -595,7 +595,7 @@ impl<'a, I: Interner> Debug for SubstitutionDebug<'a, I> {
595595

596596
impl<I: Interner> Substitution<I> {
597597
/// Show debug output for the substitution.
598-
pub fn debug<'a>(&'a self, interner: I) -> SubstitutionDebug<'a, I> {
598+
pub fn debug(&self, interner: I) -> SubstitutionDebug<'_, I> {
599599
SubstitutionDebug {
600600
substitution: self,
601601
interner,
@@ -715,7 +715,7 @@ impl<'a, I: Interner> Debug for ProjectionTyDebug<'a, I> {
715715

716716
impl<I: Interner> ProjectionTy<I> {
717717
/// Show debug output for the projection type.
718-
pub fn debug<'a>(&'a self, interner: I) -> ProjectionTyDebug<'a, I> {
718+
pub fn debug(&self, interner: I) -> ProjectionTyDebug<'_, I> {
719719
ProjectionTyDebug {
720720
projection_ty: self,
721721
interner,
@@ -746,7 +746,7 @@ impl<'a, I: Interner> Debug for OpaqueTyDebug<'a, I> {
746746

747747
impl<I: Interner> OpaqueTy<I> {
748748
/// Show debug output for the opaque type.
749-
pub fn debug<'a>(&'a self, interner: I) -> OpaqueTyDebug<'a, I> {
749+
pub fn debug(&self, interner: I) -> OpaqueTyDebug<'_, I> {
750750
OpaqueTyDebug {
751751
opaque_ty: self,
752752
interner,
@@ -880,7 +880,7 @@ impl<I: Interner> Debug for CanonicalVarKinds<I> {
880880

881881
impl<T: HasInterner + Display> Canonical<T> {
882882
/// Display the canonicalized item.
883-
pub fn display<'a>(&'a self, interner: T::Interner) -> CanonicalDisplay<'a, T> {
883+
pub fn display(&self, interner: T::Interner) -> CanonicalDisplay<'_, T> {
884884
CanonicalDisplay {
885885
canonical: self,
886886
interner,

chalk-ir/src/interner.rs

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
473473
fn intern_ty(self, kind: TyKind<Self>) -> Self::InternedType;
474474

475475
/// Lookup the `TyKind` from an interned type.
476-
fn ty_data<'a>(self, ty: &'a Self::InternedType) -> &'a TyData<Self>;
476+
fn ty_data(self, ty: &Self::InternedType) -> &TyData<Self>;
477477

478478
/// Create an "interned" lifetime from `lifetime`. This is not
479479
/// normally invoked directly; instead, you invoke
@@ -482,7 +482,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
482482
fn intern_lifetime(self, lifetime: LifetimeData<Self>) -> Self::InternedLifetime;
483483

484484
/// Lookup the `LifetimeData` that was interned to create a `InternedLifetime`.
485-
fn lifetime_data<'a>(self, lifetime: &'a Self::InternedLifetime) -> &'a LifetimeData<Self>;
485+
fn lifetime_data(self, lifetime: &Self::InternedLifetime) -> &LifetimeData<Self>;
486486

487487
/// Create an "interned" const from `const`. This is not
488488
/// normally invoked directly; instead, you invoke
@@ -491,7 +491,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
491491
fn intern_const(self, constant: ConstData<Self>) -> Self::InternedConst;
492492

493493
/// Lookup the `ConstData` that was interned to create a `InternedConst`.
494-
fn const_data<'a>(self, constant: &'a Self::InternedConst) -> &'a ConstData<Self>;
494+
fn const_data(self, constant: &Self::InternedConst) -> &ConstData<Self>;
495495

496496
/// Determine whether two concrete const values are equal.
497497
fn const_eq(
@@ -508,10 +508,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
508508
fn intern_generic_arg(self, data: GenericArgData<Self>) -> Self::InternedGenericArg;
509509

510510
/// Lookup the `LifetimeData` that was interned to create a `InternedLifetime`.
511-
fn generic_arg_data<'a>(
512-
self,
513-
lifetime: &'a Self::InternedGenericArg,
514-
) -> &'a GenericArgData<Self>;
511+
fn generic_arg_data(self, lifetime: &Self::InternedGenericArg) -> &GenericArgData<Self>;
515512

516513
/// Create an "interned" goal from `data`. This is not
517514
/// normally invoked directly; instead, you invoke
@@ -520,7 +517,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
520517
fn intern_goal(self, data: GoalData<Self>) -> Self::InternedGoal;
521518

522519
/// Lookup the `GoalData` that was interned to create a `InternedGoal`.
523-
fn goal_data<'a>(self, goal: &'a Self::InternedGoal) -> &'a GoalData<Self>;
520+
fn goal_data(self, goal: &Self::InternedGoal) -> &GoalData<Self>;
524521

525522
/// Create an "interned" goals from `data`. This is not
526523
/// normally invoked directly; instead, you invoke
@@ -532,7 +529,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
532529
) -> Result<Self::InternedGoals, E>;
533530

534531
/// Lookup the `GoalsData` that was interned to create a `InternedGoals`.
535-
fn goals_data<'a>(self, goals: &'a Self::InternedGoals) -> &'a [Goal<Self>];
532+
fn goals_data(self, goals: &Self::InternedGoals) -> &[Goal<Self>];
536533

537534
/// Create an "interned" substitution from `data`. This is not
538535
/// normally invoked directly; instead, you invoke
@@ -544,10 +541,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
544541
) -> Result<Self::InternedSubstitution, E>;
545542

546543
/// Lookup the `SubstitutionData` that was interned to create a `InternedSubstitution`.
547-
fn substitution_data<'a>(
548-
self,
549-
substitution: &'a Self::InternedSubstitution,
550-
) -> &'a [GenericArg<Self>];
544+
fn substitution_data(self, substitution: &Self::InternedSubstitution) -> &[GenericArg<Self>];
551545

552546
/// Create an "interned" program clause from `data`. This is not
553547
/// normally invoked directly; instead, you invoke
@@ -556,10 +550,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
556550
fn intern_program_clause(self, data: ProgramClauseData<Self>) -> Self::InternedProgramClause;
557551

558552
/// Lookup the `ProgramClauseData` that was interned to create a `ProgramClause`.
559-
fn program_clause_data<'a>(
560-
self,
561-
clause: &'a Self::InternedProgramClause,
562-
) -> &'a ProgramClauseData<Self>;
553+
fn program_clause_data(self, clause: &Self::InternedProgramClause) -> &ProgramClauseData<Self>;
563554

564555
/// Create an "interned" program clauses from `data`. This is not
565556
/// normally invoked directly; instead, you invoke
@@ -571,10 +562,8 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
571562
) -> Result<Self::InternedProgramClauses, E>;
572563

573564
/// Lookup the `ProgramClauseData` that was interned to create a `ProgramClause`.
574-
fn program_clauses_data<'a>(
575-
self,
576-
clauses: &'a Self::InternedProgramClauses,
577-
) -> &'a [ProgramClause<Self>];
565+
fn program_clauses_data(self, clauses: &Self::InternedProgramClauses)
566+
-> &[ProgramClause<Self>];
578567

579568
/// Create an "interned" quantified where clauses from `data`. This is not
580569
/// normally invoked directly; instead, you invoke
@@ -587,10 +576,10 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
587576

588577
/// Lookup the slice of `QuantifiedWhereClause` that was interned to
589578
/// create a `QuantifiedWhereClauses`.
590-
fn quantified_where_clauses_data<'a>(
579+
fn quantified_where_clauses_data(
591580
self,
592-
clauses: &'a Self::InternedQuantifiedWhereClauses,
593-
) -> &'a [QuantifiedWhereClause<Self>];
581+
clauses: &Self::InternedQuantifiedWhereClauses,
582+
) -> &[QuantifiedWhereClause<Self>];
594583

595584
/// Create an "interned" parameter kinds from `data`. This is not
596585
/// normally invoked directly; instead, you invoke
@@ -603,10 +592,10 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
603592

604593
/// Lookup the slice of `VariableKinds` that was interned to
605594
/// create a `VariableKinds`.
606-
fn variable_kinds_data<'a>(
595+
fn variable_kinds_data(
607596
self,
608-
variable_kinds: &'a Self::InternedVariableKinds,
609-
) -> &'a [VariableKind<Self>];
597+
variable_kinds: &Self::InternedVariableKinds,
598+
) -> &[VariableKind<Self>];
610599

611600
/// Create "interned" variable kinds with universe index from `data`. This is not
612601
/// normally invoked directly; instead, you invoke
@@ -619,10 +608,10 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
619608

620609
/// Lookup the slice of `CanonicalVariableKind` that was interned to
621610
/// create a `CanonicalVariableKinds`.
622-
fn canonical_var_kinds_data<'a>(
611+
fn canonical_var_kinds_data(
623612
self,
624-
canonical_var_kinds: &'a Self::InternedCanonicalVarKinds,
625-
) -> &'a [CanonicalVarKind<Self>];
613+
canonical_var_kinds: &Self::InternedCanonicalVarKinds,
614+
) -> &[CanonicalVarKind<Self>];
626615

627616
/// Create "interned" constraints from `data`. This is not
628617
/// normally invoked dirctly; instead, you invoke
@@ -635,10 +624,10 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
635624

636625
/// Lookup the slice of `Constraint` that was interned to
637626
/// create a `Constraints`.
638-
fn constraints_data<'a>(
627+
fn constraints_data(
639628
self,
640-
constraints: &'a Self::InternedConstraints,
641-
) -> &'a [InEnvironment<Constraint<Self>>];
629+
constraints: &Self::InternedConstraints,
630+
) -> &[InEnvironment<Constraint<Self>>];
642631

643632
/// Create "interned" variances from `data`. This is not
644633
/// normally invoked directly; instead, you invoke
@@ -651,7 +640,7 @@ pub trait Interner: Debug + Copy + Eq + Hash + Sized {
651640

652641
/// Lookup the slice of `Variance` that was interned to
653642
/// create a `Variances`.
654-
fn variances_data<'a>(self, variances: &'a Self::InternedVariances) -> &'a [Variance];
643+
fn variances_data(self, variances: &Self::InternedVariances) -> &[Variance];
655644
}
656645

657646
/// Implemented by types that have an associated interner (which

0 commit comments

Comments
 (0)