Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
use next_back() instead of last() on DoubleEndedIterator
  • Loading branch information
matthiaskrgr committed Mar 10, 2025
commit dcf6137b5cb16c5ed569fd0a17517cbaed48e604
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ fn generics_args_err_extend<'a>(
})
.collect();
if args.len() > 1
&& let Some(span) = args.into_iter().last()
&& let Some(span) = args.into_iter().next_back()
{
err.note(
"generic arguments are not allowed on both an enum and its variant's path \
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ impl<'a> Parser<'a> {
ast::GenericBound::Trait(poly) => Some(poly),
_ => None,
})
.last()
.next_back()
{
err.span_suggestion_verbose(
poly.span.shrink_to_hi(),
Expand Down