be nice and don't slice
These are already slices, no need to slice them again
This commit is contained in:
parent
2d14db321b
commit
e17cd0c019
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
@ -2671,7 +2671,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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue