Skip to content

Commit d5b9634

Browse files
authored
Fix new Rust 1.83.0 lints (#569)
# Objective Rust 1.83.0 was just released, and CI is complaining because of new lints, mainly for ellided lifetimes. ## Solution Fix lints!
1 parent f951ed3 commit d5b9634

File tree

8 files changed

+15
-16
lines changed

8 files changed

+15
-16
lines changed

src/collision/collider/backend.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ use mass_properties::OnChangeColliderMassProperties;
5757
/// it should now work with the rest of the engine just like normal [`Collider`]s!
5858
///
5959
/// **Note**: [Spatial queries](spatial_query) are not supported for custom colliders yet.
60-
6160
pub struct ColliderBackendPlugin<C: ScalableCollider> {
6261
schedule: Interned<dyn ScheduleLabel>,
6362
_phantom: PhantomData<C>,

src/collision/collider/world_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct ColliderQuery<C: AnyCollider> {
2525
pub shape: &'static C,
2626
}
2727

28-
impl<'w, C: AnyCollider> ColliderQueryItem<'w, C> {
28+
impl<C: AnyCollider> ColliderQueryItem<'_, C> {
2929
/// Returns the current position of the body. This is a sum of the [`Position`] and
3030
/// [`AccumulatedTranslation`] components.
3131
pub fn current_position(&self) -> Vector {

src/collision/narrow_phase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ pub struct NarrowPhase<'w, 's, C: AnyCollider> {
385385
contact_tolerance: Local<'s, Scalar>,
386386
}
387387

388-
impl<'w, 's, C: AnyCollider> NarrowPhase<'w, 's, C> {
388+
impl<C: AnyCollider> NarrowPhase<'_, '_, C> {
389389
/// Updates the narrow phase by computing [`Contacts`] based on [`BroadCollisionPairs`]
390390
/// and adding them to [`Collisions`].
391391
fn update(&mut self, broad_collision_pairs: &[(Entity, Entity)], delta_secs: Scalar) {

src/debug_render/gizmos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub trait PhysicsGizmoExt {
8585
);
8686
}
8787

88-
impl<'w, 's> PhysicsGizmoExt for Gizmos<'w, 's, PhysicsGizmos> {
88+
impl PhysicsGizmoExt for Gizmos<'_, '_, PhysicsGizmos> {
8989
/// Draws a line from `a` to `b`.
9090
fn draw_line(&mut self, a: Vector, b: Vector, color: Color) {
9191
#[cfg(feature = "2d")]

src/dynamics/rigid_body/mass_properties/world_query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct MassPropertiesQuery {
1717
pub center_of_mass: &'static mut CenterOfMass,
1818
}
1919

20-
impl<'w> MassPropertiesQueryItem<'w> {
20+
impl MassPropertiesQueryItem<'_> {
2121
/// Computes the angular inertia shifted by the given offset, taking into account mass.
2222
#[cfg(feature = "2d")]
2323
#[inline]
@@ -49,7 +49,7 @@ impl<'w> MassPropertiesQueryItem<'w> {
4949
}
5050
}
5151

52-
impl<'w> AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
52+
impl AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'_> {
5353
fn add_assign(&mut self, rhs: ColliderMassProperties) {
5454
let mass1 = self.mass.value();
5555
let mass2 = rhs.mass;
@@ -75,7 +75,7 @@ impl<'w> AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
7575
}
7676
}
7777

78-
impl<'w> SubAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
78+
impl SubAssign<ColliderMassProperties> for MassPropertiesQueryItem<'_> {
7979
fn sub_assign(&mut self, rhs: ColliderMassProperties) {
8080
if self.mass.inverse() + rhs.mass.recip_or_zero() <= 0.0 {
8181
return;

src/dynamics/rigid_body/world_query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct RigidBodyQuery {
3434
pub is_sensor: Has<Sensor>,
3535
}
3636

37-
impl<'w> RigidBodyQueryItem<'w> {
37+
impl RigidBodyQueryItem<'_> {
3838
/// Computes the velocity at the given `point` relative to the center of the body.
3939
pub fn velocity_at_point(&self, point: Vector) -> Vector {
4040
#[cfg(feature = "2d")]
@@ -114,7 +114,7 @@ impl<'w> RigidBodyQueryItem<'w> {
114114
}
115115
}
116116

117-
impl<'w> RigidBodyQueryReadOnlyItem<'w> {
117+
impl RigidBodyQueryReadOnlyItem<'_> {
118118
/// Computes the velocity at the given `point` relative to the center of mass.
119119
pub fn velocity_at_point(&self, point: Vector) -> Vector {
120120
#[cfg(feature = "2d")]

src/spatial_query/pipeline.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ impl SpatialQueryPipeline {
5252
pub(crate) fn as_composite_shape<'a>(
5353
&'a self,
5454
query_filter: &'a SpatialQueryFilter,
55-
) -> QueryPipelineAsCompositeShape {
55+
) -> QueryPipelineAsCompositeShape<'a> {
5656
QueryPipelineAsCompositeShape {
5757
pipeline: self,
5858
colliders: &self.colliders,
5959
query_filter,
6060
}
6161
}
6262

63-
pub(crate) fn as_composite_shape_with_predicate<'a>(
63+
pub(crate) fn as_composite_shape_with_predicate<'a: 'b, 'b>(
6464
&'a self,
6565
query_filter: &'a SpatialQueryFilter,
6666
predicate: &'a dyn Fn(Entity) -> bool,
67-
) -> QueryPipelineAsCompositeShapeWithPredicate {
67+
) -> QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
6868
QueryPipelineAsCompositeShapeWithPredicate {
6969
pipeline: self,
7070
colliders: &self.colliders,
@@ -124,7 +124,7 @@ impl SpatialQueryPipeline {
124124
&'a HashMap<Entity, (Isometry<Scalar>, Collider, CollisionLayers)>,
125125
);
126126

127-
impl<'a> parry::partitioning::QbvhDataGenerator<u32> for DataGenerator<'a> {
127+
impl parry::partitioning::QbvhDataGenerator<u32> for DataGenerator<'_> {
128128
fn size_hint(&self) -> usize {
129129
self.0.len()
130130
}
@@ -812,7 +812,7 @@ pub(crate) struct QueryPipelineAsCompositeShape<'a> {
812812
query_filter: &'a SpatialQueryFilter,
813813
}
814814

815-
impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
815+
impl TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'_> {
816816
type PartShape = dyn Shape;
817817
type PartNormalConstraints = dyn NormalConstraints;
818818
type PartId = u32;
@@ -858,7 +858,7 @@ pub(crate) struct QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
858858
predicate: &'b dyn Fn(Entity) -> bool,
859859
}
860860

861-
impl<'a, 'b> TypedSimdCompositeShape for QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
861+
impl TypedSimdCompositeShape for QueryPipelineAsCompositeShapeWithPredicate<'_, '_> {
862862
type PartShape = dyn Shape;
863863
type PartNormalConstraints = dyn NormalConstraints;
864864
type PartId = u32;

src/spatial_query/system_param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct SpatialQuery<'w, 's> {
7777
pub query_pipeline: ResMut<'w, SpatialQueryPipeline>,
7878
}
7979

80-
impl<'w, 's> SpatialQuery<'w, 's> {
80+
impl SpatialQuery<'_, '_> {
8181
/// Updates the colliders in the pipeline. This is done automatically once per physics frame in
8282
/// [`PhysicsStepSet::SpatialQuery`], but if you modify colliders or their positions before that, you can
8383
/// call this to make sure the data is up to date when performing spatial queries using [`SpatialQuery`].

0 commit comments

Comments
 (0)