summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorFelix S Klock II <pnkfelix@pnkfx.org>2018-12-18 12:08:31 +0100
committerGitHub <noreply@github.com>2018-12-18 12:08:31 +0100
commitd3a70256fe560bcc463ed42e4259e9fce0fdfee3 (patch)
treed298fed06b6ac2aaf643f6ec8560106e926eec27 /rust-mode.el
parent12cb16964ce01f0e484b082ccc8a3430cc1c4158 (diff)
parentb44573743ed9146aea0470910ee073792ab46e66 (diff)
downloadrust-mode-d3a70256fe560bcc463ed42e4259e9fce0fdfee3.tar.gz
Merge pull request #292 from mookid/imenu-impl
imenu: handle lifetimes in impl blocks.
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 8af6610..a8af671 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -39,6 +39,8 @@
(defconst rust-re-vis "pub")
(defconst rust-re-unsafe "unsafe")
(defconst rust-re-extern "extern")
+(defconst rust-re-generic
+ (concat "<[[:space:]]*'" rust-re-ident "[[:space:]]*>"))
(defconst rust-re-union
(rx-to-string
`(seq
@@ -561,7 +563,9 @@ buffer."
(defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
(defun rust-re-shy (inner) (concat "\\(?:" inner "\\)"))
(defun rust-re-item-def (itype)
- (concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
+ (concat (rust-re-word itype)
+ (rust-re-shy rust-re-generic) "?"
+ "[[:space:]]+" (rust-re-grab rust-re-ident)))
(defun rust-re-item-def-imenu (itype)
(concat "^[[:space:]]*"
(rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?"