summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el
index c22cad8..3585f1d 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -80,7 +80,8 @@ Like `looking-back' but for fixed strings rather than regexps (so that it's not
(defun rust-looking-back-macro ()
"Non-nil if looking back at an ident followed by a !"
- (save-excursion (backward-char) (and (= ?! (char-after)) (rust-looking-back-ident))))
+ (if (> (- (point) (point-min)) 1)
+ (save-excursion (backward-char) (and (= ?! (char-after)) (rust-looking-back-ident)))))
;; Syntax definitions and helpers
(defvar rust-mode-syntax-table
@@ -1604,7 +1605,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
(when rust-format-on-save
(unless (executable-find rust-rustfmt-bin)
(error "Could not locate executable \"%s\"" rust-rustfmt-bin))))
-
+
(defvar rustc-compilation-regexps
(let ((file "\\([^\n]+\\)")
(start-line "\\([0-9]+\\)")