about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-16 20:15:56 +0200
committerGitHub <noreply@github.com>2024-10-16 20:15:56 +0200
commit50e93bc0802a104f4544777be55e3bb1148eb1e1 (patch)
tree8de2f7767060b900348c7c8e17106132f08f7fdd /compiler
parentac6353ed430fbf2e7b2faab58021782f591a0ded (diff)
parenta10a44956e4efddf4fdf0f7a8b10796b9ae965ea (diff)
downloadrust-50e93bc0802a104f4544777be55e3bb1148eb1e1.tar.gz
rust-50e93bc0802a104f4544777be55e3bb1148eb1e1.zip
Rollup merge of #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
Diffstat (limited to 'compiler')
-rw-r--r--compiler/stable_mir/src/mir/visit.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/stable_mir/src/mir/visit.rs b/compiler/stable_mir/src/mir/visit.rs
index 08fcfa01a06..d73e79c4893 100644
--- a/compiler/stable_mir/src/mir/visit.rs
+++ b/compiler/stable_mir/src/mir/visit.rs
@@ -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?))