Skip to content

Commit 09dbd88

Browse files
committed
---
yaml --- r: 78788 b: refs/heads/try c: 521fb04 h: refs/heads/master v: v3
1 parent 9619bcc commit 09dbd88

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 25ed29a0edb3d48fef843a0b818ee68faf2252da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 6a649e6b8b3e42bb8fa8fa806d783ecd9b543784
5+
refs/heads/try: 521fb049be4642919d690a01ef8617a9508d3909
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/emacs/rust-mode.el

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,19 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
225225

226226
(provide 'rust-mode)
227227

228+
;; Issue #6887: Rather than inheriting the 'gnu compilation error
229+
;; regexp (which is broken on a few edge cases), add our own 'rust
230+
;; compilation error regexp and use it instead.
231+
(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))))
236+
"Specifications for matching errors in rustc invocations.
237+
See `compilation-error-regexp-alist for help on their format.")
238+
239+
(add-to-list 'compilation-error-regexp-alist-alist
240+
(cons 'rustc rustc-compilation-regexps))
241+
(add-to-list 'compilation-error-regexp-alist 'rustc)
242+
228243
;;; rust-mode.el ends here

branches/try/src/libextra/getopts.rs

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ pub mod groups {
689689
}
690690
}
691691

692-
// FIXME: #5516 should be graphemes not codepoints
692+
// FIXME: #5516
693693
// here we just need to indent the start of the description
694-
let rowlen = row.char_len();
694+
let rowlen = row.len();
695695
if rowlen < 24 {
696696
do (24 - rowlen).times {
697697
row.push_char(' ')
@@ -707,14 +707,14 @@ pub mod groups {
707707
desc_normalized_whitespace.push_char(' ');
708708
}
709709

710-
// FIXME: #5516 should be graphemes not codepoints
710+
// FIXME: #5516
711711
let mut desc_rows = ~[];
712712
do each_split_within(desc_normalized_whitespace, 54) |substr| {
713713
desc_rows.push(substr.to_owned());
714714
true
715715
};
716716

717-
// FIXME: #5516 should be graphemes not codepoints
717+
// FIXME: #5516
718718
// wrapped description
719719
row.push_str(desc_rows.connect(desc_sep));
720720

@@ -798,7 +798,7 @@ pub mod groups {
798798
cont
799799
};
800800

801-
ss.char_offset_iter().advance(|x| machine(x));
801+
ss.iter().enumerate().advance(|x| machine(x));
802802

803803
// Let the automaton 'run out' by supplying trailing whitespace
804804
while cont && match state { B | C => true, A => false } {
@@ -1580,31 +1580,4 @@ Options:
15801580
debug!("generated: <<%s>>", usage);
15811581
assert!(usage == expected)
15821582
}
1583-
1584-
#[test]
1585-
fn test_groups_usage_description_multibyte_handling() {
1586-
let optgroups = ~[
1587-
groups::optflag("k", "k\u2013w\u2013",
1588-
"The word kiwi is normally spelled with two i's"),
1589-
groups::optflag("a", "apple",
1590-
"This \u201Cdescription\u201D has some characters that could \
1591-
confuse the line wrapping; an apple costs 0.51€ in some parts of Europe."),
1592-
];
1593-
1594-
let expected =
1595-
~"Usage: fruits
1596-
1597-
Options:
1598-
-k --k–w– The word kiwi is normally spelled with two i's
1599-
-a --apple This “description” has some characters that could
1600-
confuse the line wrapping; an apple costs 0.51in
1601-
some parts of Europe.
1602-
";
1603-
1604-
let usage = groups::usage("Usage: fruits", optgroups);
1605-
1606-
debug!("expected: <<%s>>", expected);
1607-
debug!("generated: <<%s>>", usage);
1608-
assert!(usage == expected)
1609-
}
16101583
}

0 commit comments

Comments
 (0)