branch: elpa/rust-mode
commit 5c68cafd46c4bc20ccba08f3f91dfce808c6dffe
Merge: 8f1297a cc59c83
Author: Niko Matsakis <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #175 from mrBliss/imenu-unsafe
    
    Recognize imenu items starting with "unsafe"
---
 rust-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rust-mode.el b/rust-mode.el
index b8f26d3..1527c7a 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -32,6 +32,7 @@
 (defconst rust-re-lc-ident 
"[[:lower:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*")
 (defconst rust-re-uc-ident "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
 (defconst rust-re-vis "pub")
+(defconst rust-re-unsafe "unsafe")
 
 (defconst rust-re-non-standard-string
   (rx
@@ -569,6 +570,7 @@ buffer."
 (defun rust-re-item-def-imenu (itype)
   (concat "^[[:space:]]*"
           (rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?"
+          (rust-re-shy (concat (rust-re-word rust-re-unsafe) "[[:space:]]+")) 
"?"
           (rust-re-item-def itype)))
 
 (defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))

Reply via email to