Skip to content

Commit

Permalink
Rollup merge of #131778 - practicalrs:fix_needless_lifetimes, r=jieyouxu
Browse files Browse the repository at this point in the history
Fix needless_lifetimes in stable_mir

Hi,

This PR fixes the following clippy warning

```
warning: the following explicit lifetimes could be elided: 'a
   --> compiler/stable_mir/src/mir/visit.rs:490:6
    |
490 | impl<'a> PlaceRef<'a> {
    |      ^^           ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
490 - impl<'a> PlaceRef<'a> {
490 + impl PlaceRef<'_> {
    |
```

Best regards,
Michal
  • Loading branch information
Urgau authored Oct 16, 2024
2 parents 3a8ff7a + a10a449 commit 7d1ff20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/stable_mir/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub struct PlaceRef<'a> {
pub projection: &'a [ProjectionElem],
}

impl<'a> PlaceRef<'a> {
impl PlaceRef<'_> {
/// Get the type of this place.
pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
self.projection.iter().fold(Ok(locals[self.local].ty), |place_ty, elem| elem.ty(place_ty?))
Expand Down

0 comments on commit 7d1ff20

Please sign in to comment.