Skip to content

Commit 7fbcb51

Browse files
committed
Fix unreachable code in libsyntax
1 parent 2eca64d commit 7fbcb51

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/libsyntax/ext/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,9 @@ impl<'a> ExtCtxt<'a> {
678678
pub fn bt_push(&mut self, ei: ExpnInfo) {
679679
self.recursion_count += 1;
680680
if self.recursion_count > self.ecfg.recursion_limit {
681-
panic!(self.span_fatal(ei.call_site,
681+
self.span_fatal(ei.call_site,
682682
&format!("recursion limit reached while expanding the macro `{}`",
683-
ei.callee.name())));
683+
ei.callee.name()));
684684
}
685685

686686
let mut call_site = ei.call_site;

src/libsyntax/ext/tt/macro_rules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
209209
best_fail_msg = (*msg).clone();
210210
},
211211
Error(err_sp, ref msg) => {
212-
panic!(cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..]))
212+
cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..])
213213
}
214214
}
215215
}
216216

217-
panic!(cx.span_fatal(best_fail_spot.substitute_dummy(sp), &best_fail_msg[..]));
217+
cx.span_fatal(best_fail_spot.substitute_dummy(sp), &best_fail_msg[..]);
218218
}
219219

220220
// Note that macro-by-example's input is also matched against a token tree:

src/test/compile-fail/unreachable-in-call.rs

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that the unboxed closure sugar can be used with an arbitrary
12-
// struct type and that it is equivalent to the same syntax using
13-
// angle brackets. This test covers only simple types and in
14-
// particular doesn't test bound regions.
15-
1611
#![allow(dead_code)]
1712
#![deny(unreachable_code)]
1813

0 commit comments

Comments
 (0)