diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-08-14 21:48:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-14 21:48:47 +0200 |
| commit | 603ee15f7cf0bc7631ba0c845528aa598422f1fa (patch) | |
| tree | aea8f0d1f54bfd4326f96eef1692aaad3742a2cd | |
| parent | 93e895bc6436a2a32bb17ed49ea68ffb4aa34e72 (diff) | |
| parent | b67cd4c6cf4abc47056b1f45957a8ab8f3e7a559 (diff) | |
| download | rust-603ee15f7cf0bc7631ba0c845528aa598422f1fa.tar.gz rust-603ee15f7cf0bc7631ba0c845528aa598422f1fa.zip | |
Rollup merge of #145401 - estebank:remove-useless-iter, r=compiler-errors
cleanup: Remove useless `[T].iter().last()`
| -rw-r--r-- | compiler/rustc_ast_passes/src/ast_validation.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/utils.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index dc2eb17589c..f62b8d1d576 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -1741,7 +1741,7 @@ fn deny_equality_constraints( .map(|segment| segment.ident.name) .zip(poly.trait_ref.path.segments.iter().map(|segment| segment.ident.name)) .all(|(a, b)| a == b) - && let Some(potential_assoc) = full_path.segments.iter().last() + && let Some(potential_assoc) = full_path.segments.last() { suggest(poly, potential_assoc, predicate); } diff --git a/compiler/rustc_macros/src/diagnostics/utils.rs b/compiler/rustc_macros/src/diagnostics/utils.rs index 060799e981d..c310b99d535 100644 --- a/compiler/rustc_macros/src/diagnostics/utils.rs +++ b/compiler/rustc_macros/src/diagnostics/utils.rs @@ -146,7 +146,7 @@ impl<'ty> FieldInnerTy<'ty> { }; let path = &ty_path.path; - let ty = path.segments.iter().last().unwrap(); + let ty = path.segments.last().unwrap(); let syn::PathArguments::AngleBracketed(bracketed) = &ty.arguments else { panic!("expected bracketed generic arguments"); }; |
