Skip to content

Commit 3d3f37e

Browse files
committed
---
yaml --- r: 77257 b: refs/heads/snap-stage3 c: 947513c h: refs/heads/master i: 77255: eb07de1 v: v3
1 parent 71a1c04 commit 3d3f37e

File tree

135 files changed

+1232
-1049
lines changed

Some content is hidden

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

135 files changed

+1232
-1049
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: f1132496dddbdd88f321a7919eec3d65136b3f75
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: df84925b45ca32c40430a114449066aebc58508d
4+
refs/heads/snap-stage3: 947513c4f489f1302a97c966c79761e6e953cbcc
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
282282
}
283283
284284
// write debugger script
285-
let script_str = cmds.append("\nquit\n");
285+
let script_str = [~"set charset UTF-8",
286+
cmds,
287+
~"quit\n"].connect("\n");
286288
debug!("script_str = %s", script_str);
287289
dump_output_file(config, testfile, script_str, "debugger.script");
288290

branches/snap-stage3/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)

branches/snap-stage3/src/libextra/sync.rs

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ impl<Q:Send> Sem<Q> {
135135
do task::unkillable {
136136
do (|| {
137137
self.acquire();
138-
do task::rekillable { blk() }
138+
unsafe {
139+
do task::rekillable { blk() }
140+
}
139141
}).finally {
140142
self.release();
141143
}
@@ -232,8 +234,10 @@ impl<'self> Condvar<'self> {
232234
// signaller already sent -- I mean 'unconditionally' in contrast
233235
// with acquire().)
234236
do (|| {
235-
do task::rekillable {
236-
let _ = WaitEnd.take_unwrap().recv();
237+
unsafe {
238+
do task::rekillable {
239+
let _ = WaitEnd.take_unwrap().recv();
240+
}
237241
}
238242
}).finally {
239243
// Reacquire the condvar. Note this is back in the unkillable
@@ -512,12 +516,14 @@ impl RWLock {
512516
* 'write' from other tasks will run concurrently with this one.
513517
*/
514518
pub fn write<U>(&self, blk: &fn() -> U) -> U {
515-
do task::unkillable {
516-
(&self.order_lock).acquire();
517-
do (&self.access_lock).access {
518-
(&self.order_lock).release();
519-
do task::rekillable {
520-
blk()
519+
unsafe {
520+
do task::unkillable {
521+
(&self.order_lock).acquire();
522+
do (&self.access_lock).access {
523+
(&self.order_lock).release();
524+
do task::rekillable {
525+
blk()
526+
}
521527
}
522528
}
523529
}
@@ -556,14 +562,16 @@ impl RWLock {
556562
// which can't happen until T2 finishes the downgrade-read entirely.
557563
// The astute reader will also note that making waking writers use the
558564
// order_lock is better for not starving readers.
559-
do task::unkillable {
560-
(&self.order_lock).acquire();
561-
do (&self.access_lock).access_cond |cond| {
562-
(&self.order_lock).release();
563-
do task::rekillable {
564-
let opt_lock = Just(&self.order_lock);
565-
blk(&Condvar { sem: cond.sem, order: opt_lock,
566-
token: NonCopyable::new() })
565+
unsafe {
566+
do task::unkillable {
567+
(&self.order_lock).acquire();
568+
do (&self.access_lock).access_cond |cond| {
569+
(&self.order_lock).release();
570+
do task::rekillable {
571+
let opt_lock = Just(&self.order_lock);
572+
blk(&Condvar { sem: cond.sem, order: opt_lock,
573+
token: NonCopyable::new() })
574+
}
567575
}
568576
}
569577
}
@@ -598,8 +606,10 @@ impl RWLock {
598606
(&self.access_lock).acquire();
599607
(&self.order_lock).release();
600608
do (|| {
601-
do task::rekillable {
602-
blk(RWLockWriteMode { lock: self, token: NonCopyable::new() })
609+
unsafe {
610+
do task::rekillable {
611+
blk(RWLockWriteMode { lock: self, token: NonCopyable::new() })
612+
}
603613
}
604614
}).finally {
605615
let writer_or_last_reader;

0 commit comments

Comments
 (0)