File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3061,6 +3061,20 @@ extern \"rust-intrinsic\" fn five() {
3061
3061
" four"
3062
3062
" five" ))))
3063
3063
3064
+ (ert-deftest rust-test-imenu-impl-with-lifetime ()
3065
+ (test-imenu
3066
+ "
3067
+ impl<'a> One<'a> {
3068
+ fn one() {}
3069
+ }
3070
+
3071
+ impl Two<'a> {
3072
+ fn two() {}
3073
+ }
3074
+ "
3075
+ '((" Impl" " One" " Two" )
3076
+ (" Fn" " one" " two" ))))
3077
+
3064
3078
(when (executable-find rust-cargo-bin)
3065
3079
(ert-deftest rust-test-project-located ()
3066
3080
(lexical-let* ((test-dir (expand-file-name " test-project" default-directory))
Original file line number Diff line number Diff line change 39
39
(defconst rust-re-vis " pub" )
40
40
(defconst rust-re-unsafe " unsafe" )
41
41
(defconst rust-re-extern " extern" )
42
+ (defconst rust-re-generic
43
+ (concat " <[[:space:]]*'" rust-re-ident " [[:space:]]*>" ))
42
44
(defconst rust-re-union
43
45
(rx-to-string
44
46
`(seq
@@ -561,7 +563,9 @@ buffer."
561
563
(defun rust-re-grab (inner ) (concat " \\ (" inner " \\ )" ))
562
564
(defun rust-re-shy (inner ) (concat " \\ (?:" inner " \\ )" ))
563
565
(defun rust-re-item-def (itype )
564
- (concat (rust-re-word itype) " [[:space:]]+" (rust-re-grab rust-re-ident)))
566
+ (concat (rust-re-word itype)
567
+ (rust-re-shy rust-re-generic) " ?"
568
+ " [[:space:]]+" (rust-re-grab rust-re-ident)))
565
569
(defun rust-re-item-def-imenu (itype )
566
570
(concat " ^[[:space:]]*"
567
571
(rust-re-shy (concat (rust-re-word rust-re-vis) " [[:space:]]+" )) " ?"
You can’t perform that action at this time.
0 commit comments