Rollup merge of #138315 - matthiaskrgr:nextback, r=fmease
use next_back() instead of last() on DoubleEndedIterator
This commit is contained in:
commit
03a79a77ac
2 changed files with 2 additions and 2 deletions
|
@ -1520,7 +1520,7 @@ fn generics_args_err_extend<'a>(
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
if args.len() > 1
|
if args.len() > 1
|
||||||
&& let Some(span) = args.into_iter().last()
|
&& let Some(span) = args.into_iter().next_back()
|
||||||
{
|
{
|
||||||
err.note(
|
err.note(
|
||||||
"generic arguments are not allowed on both an enum and its variant's path \
|
"generic arguments are not allowed on both an enum and its variant's path \
|
||||||
|
|
|
@ -2107,7 +2107,7 @@ impl<'a> Parser<'a> {
|
||||||
ast::GenericBound::Trait(poly) => Some(poly),
|
ast::GenericBound::Trait(poly) => Some(poly),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.last()
|
.next_back()
|
||||||
{
|
{
|
||||||
err.span_suggestion_verbose(
|
err.span_suggestion_verbose(
|
||||||
poly.span.shrink_to_hi(),
|
poly.span.shrink_to_hi(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue