summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
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 1c0921b..ed5b5ed 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -812,6 +812,9 @@ match data if found. Returns nil if not within a Rust string."
;; it to be an expression.
((and (equal token 'open-brace) (rust-looking-back-macro)) t)
+ ;; In a brace context a "]" introduces an expression.
+ ((and (eq token 'open-brace) (rust-looking-back-str "]")))
+
;; An identifier is right after an ending paren, bracket, angle bracket
;; or curly brace. It's a type if the last sexp was a type.
((and (equal token 'ident) (equal 5 (rust-syntax-class-before-point)))