summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authormrBliss <dewinant@gmail.com>2016-10-19 14:26:51 +0200
committermrBliss <dewinant@gmail.com>2016-10-19 14:29:33 +0200
commitcc59c8387fde46b673a1784c60ff5117ed82eef0 (patch)
tree9943bcca920afbb30a71805190b8c6020484c091 /rust-mode.el
parent1587839ba493b5ab98fb8415338172a9a22f224b (diff)
downloadrust-mode-cc59c8387fde46b673a1784c60ff5117ed82eef0.tar.gz
Recognize imenu items starting with "unsafe"
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 2c97433..b5f62cb 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
@@ -556,6 +557,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))