summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-08-14 00:25:29 -0600
committerGitHub <noreply@github.com>2017-08-14 00:25:29 -0600
commite48a650c44c06c1dd4e4ed0672c50c5446124203 (patch)
tree1bc115a46a9b3f767174bd7236c698379b19e588 /rust-mode.el
parentb10ad4177786a139623984c4855eb9de3864c697 (diff)
parent90f70acec333887f925ed1b4b1b46f68d5442f41 (diff)
downloadrust-mode-e48a650c44c06c1dd4e4ed0672c50c5446124203.tar.gz
Merge pull request #225 from Aankhen/add-var-colours
Use `font-lock-variable-name-face' for `let' bindings
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 3b2a856..1c0921b 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -681,6 +681,9 @@ match data if found. Returns nil if not within a Rust string."
;; Field names like `foo:`, highlight excluding the :
(,(concat (rust-re-grab rust-re-ident) ":[^:]") 1 font-lock-variable-name-face)
+ ;; Type-inferred binding
+ (,(concat "\\_<\\(?:let\\|ref\\)\\s-+\\(?:mut\\s-+\\)?" (rust-re-grab rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
+
;; Type names like `Foo::`, highlight excluding the ::
(,(rust-path-font-lock-matcher rust-re-uc-ident) 1 font-lock-type-face)