Skip to content

Commit 7b9591a

Browse files
committed
---
yaml --- r: 77646 b: refs/heads/master c: fe7092d h: refs/heads/master v: v3
1 parent 279024a commit 7b9591a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 521fb049be4642919d690a01ef8617a9508d3909
2+
refs/heads/master: fe7092dafb83e7d541aa06095342252dc02c2d5d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a

trunk/src/etc/emacs/rust-mode.el

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,23 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
229229
;; regexp (which is broken on a few edge cases), add our own 'rust
230230
;; compilation error regexp and use it instead.
231231
(defvar rustc-compilation-regexps
232-
(let ((re (concat "^\\([^ \n]+\\):\\([0-9]+\\):\\([0-9]+\\): "
233-
"\\([0-9]+\\):\\([0-9]+\\) "
234-
"\\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
235-
(cons re '(1 (2 . 4) (3 . 5) (6))))
232+
(let ((file "\\([^ \n]+\\)")
233+
(start-line "\\([0-9]+\\)")
234+
(start-col "\\([0-9]+\\)")
235+
(end-line "\\([0-9]+\\)")
236+
(end-col "\\([0-9]+\\)")
237+
(error-or-warning "\\(?:[Ee]rror\\|\\([Ww]arning\\)\\)"))
238+
(let ((re (concat "^" file ":" start-line ":" start-col
239+
": " end-line ":" end-col
240+
" \\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
241+
(cons re '(1 (2 . 4) (3 . 5) (6)))))
236242
"Specifications for matching errors in rustc invocations.
237243
See `compilation-error-regexp-alist for help on their format.")
238244

239-
(add-to-list 'compilation-error-regexp-alist-alist
240-
(cons 'rustc rustc-compilation-regexps))
241-
(add-to-list 'compilation-error-regexp-alist 'rustc)
245+
(eval-after-load 'compile
246+
'(progn
247+
(add-to-list 'compilation-error-regexp-alist-alist
248+
(cons 'rustc rustc-compilation-regexps))
249+
(add-to-list 'compilation-error-regexp-alist 'rustc)))
242250

243251
;;; rust-mode.el ends here

0 commit comments

Comments
 (0)