Skip to content

Commit

Permalink
Rollup merge of #108103 - matthiaskrgr:lice, r=compiler-errors
Browse files Browse the repository at this point in the history
be nice and don't slice

These are already slices, no need to slice them again
  • Loading branch information
Dylan-DPC committed Feb 16, 2023
2 parents 7bde7b7 + e17cd0c commit bb1e984
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
) = &qself.kind {
// If the path segment already has type params, we want to overwrite
// them.
match &path.segments[..] {
match &path.segments {
// `segment` is the previous to last element on the path,
// which would normally be the `enum` itself, while the last
// `_` `PathSegment` corresponds to the variant.
Expand Down Expand Up @@ -2670,7 +2670,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// `Self` in trait or type alias.
assert_eq!(opt_self_ty, None);
self.prohibit_generics(path.segments.iter(), |err| {
if let [hir::PathSegment { args: Some(args), ident, .. }] = &path.segments[..] {
if let [hir::PathSegment { args: Some(args), ident, .. }] = &path.segments {
err.span_suggestion_verbose(
ident.span.shrink_to_hi().to(args.span_ext),
"the `Self` type doesn't accept type parameters",
Expand Down

0 comments on commit bb1e984

Please sign in to comment.