Skip to content

Commit 558db64

Browse files
committed
---
yaml --- r: 144447 b: refs/heads/try2 c: 35f975b h: refs/heads/master i: 144445: 476b3b7 144443: 28020a0 144439: 7a26ec7 144431: 30ec71d 144415: be0ed04 144383: aeefe7c v: v3
1 parent 3ef1401 commit 558db64

File tree

80 files changed

+2187
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2187
-668
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 73540551e5051c524b5533a5ab3eb991dda4eaac
8+
refs/heads/try2: 35f975b83881106e0fde729b8c1361c9cf6d2778
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,6 +2553,7 @@ tutorials on individual topics.
25532553
* [Macros][macros]
25542554
* [The foreign function interface][ffi]
25552555
* [Containers and iterators](tutorial-container.html)
2556+
* [Error-handling and Conditions](tutorial-conditions.html)
25562557

25572558
There is further documentation on the [wiki].
25582559

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,27 @@ 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 ((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)))))
242+
"Specifications for matching errors in rustc invocations.
243+
See `compilation-error-regexp-alist for help on their format.")
244+
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)))
250+
228251
;;; rust-mode.el ends here
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env python
2+
# xfail-license
3+
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
"""
13+
This script takes a list of keywords and generates a testcase, that checks
14+
if using the keyword as identifier fails, for every keyword. The generate
15+
test files are set read-only.
16+
Test for https://github.com/mozilla/rust/issues/2275
17+
18+
sample usage: src/etc/generate-keyword-tests.py as break
19+
"""
20+
21+
import sys
22+
import os
23+
import datetime
24+
import stat
25+
26+
27+
template = """// Copyright %d The Rust Project Developers. See the COPYRIGHT
28+
// file at the top-level directory of this distribution and at
29+
// http://rust-lang.org/COPYRIGHT.
30+
//
31+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
32+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
33+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
34+
// option. This file may not be copied, modified, or distributed
35+
// except according to those terms.
36+
37+
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
38+
39+
fn main() {
40+
let %s = "foo"; //~ error: ident
41+
}
42+
"""
43+
44+
test_dir = os.path.abspath(
45+
os.path.join(os.path.dirname(__file__), '../test/compile-fail')
46+
)
47+
48+
for kw in sys.argv[1:]:
49+
test_file = os.path.join(test_dir, 'keyword-%s-as-identifier.rs' % kw)
50+
51+
# set write permission if file exists, so it can be changed
52+
if os.path.exists(test_file):
53+
os.chmod(test_file, stat.S_IWUSR)
54+
55+
with open(test_file, 'wt') as f:
56+
f.write(template % (datetime.datetime.now().year, kw, kw))
57+
58+
# mark file read-only
59+
os.chmod(test_file, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)

0 commit comments

Comments
 (0)