Skip to content

Commit 30ea23b

Browse files
committed
---
yaml --- r: 236279 b: refs/heads/master c: f0666b4 h: refs/heads/master i: 236277: 5077456 236275: dd171a9 236271: 1438607 v: v3
1 parent 86c46aa commit 30ea23b

File tree

6 files changed

+35
-89
lines changed

6 files changed

+35
-89
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: 3b42b60bf675214d668b92b4791d58b63b143f40
2+
refs/heads/master: f0666b45dd9adef751340e86badbef4daedb2dc2
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
44
refs/heads/try: ea3892f76a2180dd4ce724f1dafd9186959702d9
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/mk/grammar.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ check-lexer: $(BG) $(BG)RustLexer.class check-build-lexer-verifier
5858
$(Q)$(SG)check.sh $(S) "$(BG)" \
5959
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
6060
else
61-
$(info cfg: grun not available, skipping lexer test...)
61+
$(info cfg: lexer tooling not available, skipping lexer test...)
6262
check-lexer:
6363

6464
endif
6565
else
66-
$(info cfg: antlr4 not available, skipping lexer test...)
66+
$(info cfg: lexer tooling not available, skipping lexer test...)
6767
check-lexer:
6868

6969
endif
7070
else
71-
$(info cfg: javac not available, skipping lexer test...)
71+
$(info cfg: lexer tooling not available, skipping lexer test...)
7272
check-lexer:
7373

7474
endif

trunk/src/librustc/middle/liveness.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,9 +1399,8 @@ fn check_arm(this: &mut Liveness, arm: &hir::Arm) {
13991399

14001400
fn check_expr(this: &mut Liveness, expr: &Expr) {
14011401
match expr.node {
1402-
hir::ExprAssign(ref l, ref r) => {
1402+
hir::ExprAssign(ref l, _) => {
14031403
this.check_lvalue(&**l);
1404-
this.visit_expr(&**r);
14051404

14061405
visit::walk_expr(this, expr);
14071406
}

trunk/src/libstd/sys/common/unwind/mod.rs

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,6 @@ pub mod imp;
9292
#[path = "gcc.rs"] #[doc(hidden)]
9393
pub mod imp;
9494

95-
pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: u32);
96-
97-
// Variables used for invoking callbacks when a thread starts to unwind.
98-
//
99-
// For more information, see below.
100-
const MAX_CALLBACKS: usize = 16;
101-
static CALLBACKS: [atomic::AtomicUsize; MAX_CALLBACKS] =
102-
[atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
103-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
104-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
105-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
106-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
107-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
108-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0),
109-
atomic::AtomicUsize::new(0), atomic::AtomicUsize::new(0)];
110-
static CALLBACK_CNT: atomic::AtomicUsize = atomic::AtomicUsize::new(0);
111-
11295
thread_local! { static PANICKING: Cell<bool> = Cell::new(false) }
11396

11497
/// Invoke a closure, capturing the cause of panic if one occurs.
@@ -246,45 +229,11 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, u32)) -> !
246229
#[inline(never)] #[cold] // this is the slow path, please never inline this
247230
fn begin_unwind_inner(msg: Box<Any + Send>,
248231
file_line: &(&'static str, u32)) -> ! {
249-
// Make sure the default failure handler is registered before we look at the
250-
// callbacks. We also use a raw sys-based mutex here instead of a
251-
// `std::sync` one as accessing TLS can cause weird recursive problems (and
252-
// we don't need poison checking).
253-
unsafe {
254-
static LOCK: Mutex = Mutex::new();
255-
static mut INIT: bool = false;
256-
LOCK.lock();
257-
if !INIT {
258-
register(panicking::on_panic);
259-
INIT = true;
260-
}
261-
LOCK.unlock();
262-
}
232+
let (file, line) = *file_line;
263233

264-
// First, invoke call the user-defined callbacks triggered on thread panic.
265-
//
266-
// By the time that we see a callback has been registered (by reading
267-
// MAX_CALLBACKS), the actual callback itself may have not been stored yet,
268-
// so we just chalk it up to a race condition and move on to the next
269-
// callback. Additionally, CALLBACK_CNT may briefly be higher than
270-
// MAX_CALLBACKS, so we're sure to clamp it as necessary.
271-
let callbacks = {
272-
let amt = CALLBACK_CNT.load(Ordering::SeqCst);
273-
&CALLBACKS[..cmp::min(amt, MAX_CALLBACKS)]
274-
};
275-
for cb in callbacks {
276-
match cb.load(Ordering::SeqCst) {
277-
0 => {}
278-
n => {
279-
let f: Callback = unsafe { mem::transmute(n) };
280-
let (file, line) = *file_line;
281-
f(&*msg, file, line);
282-
}
283-
}
284-
};
234+
// First, invoke the default panic handler.
235+
panicking::on_panic(&*msg, file, line);
285236

286-
// Now that we've run all the necessary unwind callbacks, we actually
287-
// perform the unwinding.
288237
if panicking() {
289238
// If a thread panics while it's already unwinding then we
290239
// have limited options. Currently our preference is to
@@ -295,34 +244,7 @@ fn begin_unwind_inner(msg: Box<Any + Send>,
295244
unsafe { intrinsics::abort() }
296245
}
297246
PANICKING.with(|s| s.set(true));
298-
rust_panic(msg);
299-
}
300247

301-
/// Register a callback to be invoked when a thread unwinds.
302-
///
303-
/// This is an unsafe and experimental API which allows for an arbitrary
304-
/// callback to be invoked when a thread panics. This callback is invoked on both
305-
/// the initial unwinding and a double unwinding if one occurs. Additionally,
306-
/// the local `Thread` will be in place for the duration of the callback, and
307-
/// the callback must ensure that it remains in place once the callback returns.
308-
///
309-
/// Only a limited number of callbacks can be registered, and this function
310-
/// returns whether the callback was successfully registered or not. It is not
311-
/// currently possible to unregister a callback once it has been registered.
312-
pub unsafe fn register(f: Callback) -> bool {
313-
match CALLBACK_CNT.fetch_add(1, Ordering::SeqCst) {
314-
// The invocation code has knowledge of this window where the count has
315-
// been incremented, but the callback has not been stored. We're
316-
// guaranteed that the slot we're storing into is 0.
317-
n if n < MAX_CALLBACKS => {
318-
let prev = CALLBACKS[n].swap(mem::transmute(f), Ordering::SeqCst);
319-
rtassert!(prev == 0);
320-
true
321-
}
322-
// If we accidentally bumped the count too high, pull it back.
323-
_ => {
324-
CALLBACK_CNT.store(MAX_CALLBACKS, Ordering::SeqCst);
325-
false
326-
}
327-
}
248+
// Finally, perform the unwinding.
249+
rust_panic(msg);
328250
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![deny(unused_variables)]
12+
13+
fn f(_: i32) {}
14+
15+
fn main() {
16+
let mut v = 0;
17+
f(v);
18+
v = match 0 { a => 0 }; //~ ERROR: unused variable: `a`
19+
f(v);
20+
}

trunk/src/test/run-make/tools.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ ifeq ($(UNAME),Bitrig)
8585
else
8686
ifeq ($(UNAME),OpenBSD)
8787
EXTRACFLAGS := -lm -lpthread
88+
# extend search lib for found estdc++ if build using gcc from
89+
# ports under OpenBSD. This is needed for:
90+
# - run-make/execution-engine
91+
# - run-make/issue-19371
92+
RUSTC := $(RUSTC) -L/usr/local/lib
8893
else
8994
EXTRACFLAGS := -lm -lrt -ldl -lpthread
9095
EXTRACXXFLAGS := -lstdc++

0 commit comments

Comments
 (0)