diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el index 175592d792bb..f5a3fb92cb95 100644 --- a/src/etc/emacs/rust-mode.el +++ b/src/etc/emacs/rust-mode.el @@ -213,7 +213,7 @@ (,(regexp-opt rust-special-types 'words) . font-lock-type-face) ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` - (,(rust-re-grab (concat "#\\!?[" rust-re-ident "[^]]*\\]")) + (,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]")) 1 font-lock-preprocessor-face) ;; Syntax extension invocations like `foo!`, highlight including the !