about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-02-16 11:40:22 +0530
committerGitHub <noreply@github.com>2023-02-16 11:40:22 +0530
commitbb1e9846b26663e5a504d1293a6c14b1aef9b487 (patch)
tree3146addecac0b72e329c895ed0b4f7f9391d03c5
parent7bde7b73f1cc0540dd579fa052b913598f33ed93 (diff)
parente17cd0c01961e58e551958f5878b88141dc5aefb (diff)
downloadrust-bb1e9846b26663e5a504d1293a6c14b1aef9b487.tar.gz
rust-bb1e9846b26663e5a504d1293a6c14b1aef9b487.zip
Rollup merge of #108103 - matthiaskrgr:lice, r=compiler-errors
be nice and don't slice

These are already slices, no need to slice them again
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs
index 0a243b47b5c..46dc4141e66 100644
--- a/compiler/rustc_hir_analysis/src/astconv/mod.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs
@@ -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.
@@ -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",