@@ -1574,31 +1574,24 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1574
1574
(defun rust--before-save-hook ()
1575
1575
(when rust-format-on-save (rust-format-buffer)))
1576
1576
1577
- ; ; Issue #6887: Rather than inheriting the 'gnu compilation error
1578
- ; ; regexp (which is broken on a few edge cases), add our own 'rust
1579
- ; ; compilation error regexp and use it instead.
1580
1577
(defvar rustc-compilation-regexps
1581
1578
(let ((file " \\ ([^\n ]+\\ )" )
1582
1579
(start-line " \\ ([0-9]+\\ )" )
1583
- (start-col " \\ ([0-9]+\\ )" )
1584
- (end-line " \\ ([0-9]+\\ )" )
1585
- (end-col " \\ ([0-9]+\\ )" )
1586
- (msg-type " \\ (?:[Ee]rror\\ |\\ ([Ww]arning\\ )\\ |\\ ([Nn]ote\\ |[Hh]elp\\ )\\ )" ))
1587
- (let ((re (concat " ^" file " :" start-line " :" start-col
1588
- " : " end-line " :" end-col
1589
- " " msg-type " :" )))
1590
- (cons re '(1 (2 . 4 ) (3 . 5 ) (6 . 7 )))))
1580
+ (start-col " \\ ([0-9]+\\ )" ))
1581
+ (let ((re (concat " ^ *--> " file " :" start-line " :" start-col ; --> 1:2:3
1582
+ )))
1583
+ (cons re '(1 2 3 ))))
1591
1584
" Specifications for matching errors in rustc invocations.
1592
1585
See `compilation-error-regexp-alist' for help on their format." )
1593
1586
1594
- (defvar rustc-new -compilation-regexps
1587
+ (defvar rustc-colon -compilation-regexps
1595
1588
(let ((file " \\ ([^\n ]+\\ )" )
1596
1589
(start-line " \\ ([0-9]+\\ )" )
1597
1590
(start-col " \\ ([0-9]+\\ )" ))
1598
- (let ((re (concat " ^ *--> " file " :" start-line " :" start-col ; --> 1:2:3
1591
+ (let ((re (concat " ^ *::: " file " :" start-line " :" start-col ; ::: foo/bar.rs
1599
1592
)))
1600
1593
(cons re '(1 2 3 ))))
1601
- " Specifications for matching errors in rustc invocations (new style) .
1594
+ " Specifications for matching `:::` hints in rustc invocations.
1602
1595
See `compilation-error-regexp-alist' for help on their format." )
1603
1596
1604
1597
; ; Match test run failures and panics during compilation as
@@ -1630,16 +1623,16 @@ See `compilation-error-regexp-alist' for help on their format.")
1630
1623
1631
1624
(eval-after-load 'compile
1632
1625
'(progn
1633
- (add-to-list 'compilation-error-regexp-alist-alist
1634
- (cons 'rustc-new rustc-new-compilation-regexps))
1635
- (add-to-list 'compilation-error-regexp-alist 'rustc-new )
1636
- (add-hook 'next-error-hook 'rustc-scroll-down-after-next-error )
1637
1626
(add-to-list 'compilation-error-regexp-alist-alist
1638
1627
(cons 'rustc rustc-compilation-regexps))
1639
1628
(add-to-list 'compilation-error-regexp-alist 'rustc )
1629
+ (add-to-list 'compilation-error-regexp-alist-alist
1630
+ (cons 'rustc-colon rustc-colon-compilation-regexps))
1631
+ (add-to-list 'compilation-error-regexp-alist 'rustc-colon )
1640
1632
(add-to-list 'compilation-error-regexp-alist-alist
1641
1633
(cons 'cargo cargo-compilation-regexps))
1642
- (add-to-list 'compilation-error-regexp-alist 'cargo )))
1634
+ (add-to-list 'compilation-error-regexp-alist 'cargo )
1635
+ (add-hook 'next-error-hook 'rustc-scroll-down-after-next-error )))
1643
1636
1644
1637
; ;; Functions to submit (parts of) buffers to the rust playpen, for
1645
1638
; ;; sharing.
0 commit comments