Skip to content

Commit

Permalink
Unrolled build for rust-lang#131778
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#131778 - practicalrs:fix_needless_lifetimes, r=jieyouxu

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
rust-timer authored Oct 16, 2024
2 parents 7342830 + a10a449 commit b2b85b2
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 b2b85b2

Please sign in to comment.