Skip to content

Commit e3fd545

Browse files
committed
---
yaml --- r: 272218 b: refs/heads/auto c: 676f6c3 h: refs/heads/master
1 parent 5c202ab commit e3fd545

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 0305537652821c86cfb073901d1ecd93378e3382
11+
refs/heads/auto: 676f6c31163a290f55110311f634d4ea2a00b026
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc_passes/const_fn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ impl<'a, 'v> Visitor<'v> for CheckBlock<'a> {
4444
visit::walk_expr(self, e);
4545
}
4646
}
47-
fn visit_item(&mut self, _i: &'v ast::Item) { panic!("should be handled in CheckConstFn") }
47+
fn visit_item(&mut self, _i: &'v ast::Item) { bug!("should be handled in CheckConstFn") }
4848
fn visit_fn(&mut self,
4949
_fk: FnKind<'v>,
5050
_fd: &'v ast::FnDecl,
5151
_b: &'v ast::Block,
5252
_s: Span,
53-
_fn_id: ast::NodeId) { panic!("should be handled in CheckConstFn") }
53+
_fn_id: ast::NodeId) { bug!("should be handled in CheckConstFn") }
5454
}
5555

5656
fn check_block(sess: &Session, b: &ast::Block, kind: &'static str) {
@@ -67,7 +67,7 @@ fn check_block(sess: &Session, b: &ast::Block, kind: &'static str) {
6767
}
6868
ast::StmtKind::Expr(ref expr, _) => expr.span,
6969
ast::StmtKind::Semi(ref semi, _) => semi.span,
70-
ast::StmtKind::Mac(..) => unreachable!(),
70+
ast::StmtKind::Mac(..) => bug!(),
7171
};
7272
span_err!(sess, span, E0016,
7373
"blocks in {}s are limited to items and tail expressions", kind);

branches/auto/src/librustc_passes/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
229229
Mode::Const => "constant",
230230
Mode::ConstFn => "constant function",
231231
Mode::StaticMut | Mode::Static => "static",
232-
Mode::Var => unreachable!(),
232+
Mode::Var => bug!(),
233233
}
234234
}
235235

@@ -400,7 +400,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
400400
// The count is checked elsewhere (typeck).
401401
let count = match node_ty.sty {
402402
ty::TyArray(_, n) => n,
403-
_ => unreachable!()
403+
_ => bug!()
404404
};
405405
// [element; 0] is always zero-sized.
406406
if count == 0 {
@@ -570,7 +570,7 @@ fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>,
570570
hir::ExprCast(ref from, _) => {
571571
debug!("Checking const cast(id={})", from.id);
572572
match v.tcx.cast_kinds.borrow().get(&from.id) {
573-
None => v.tcx.sess.span_bug(e.span, "no kind for cast"),
573+
None => span_bug!(e.span, "no kind for cast"),
574574
Some(&CastKind::PtrAddrCast) | Some(&CastKind::FnPtrAddrCast) => {
575575
v.add_qualif(ConstQualif::NOT_CONST);
576576
if v.mode != Mode::Var {

branches/auto/src/librustc_passes/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#![feature(rustc_private)]
2929

3030
extern crate core;
31-
extern crate rustc;
31+
#[macro_use] extern crate rustc;
3232
extern crate rustc_front;
3333
extern crate rustc_const_eval;
3434

branches/auto/src/librustc_passes/static_recursion.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ impl<'a, 'ast: 'a> Visitor<'ast> for CheckItemRecursionVisitor<'a, 'ast> {
218218
// borrow fall out of scope, so that we can reborrow farther down.
219219
maybe_expr = (*get_expr).clone();
220220
} else {
221-
self.sess.span_bug(variant.span,
222-
"`check_static_recursion` attempted to visit \
223-
variant with unknown discriminant")
221+
span_bug!(variant.span,
222+
"`check_static_recursion` attempted to visit \
223+
variant with unknown discriminant")
224224
}
225225
// If `maybe_expr` is `None`, that's because no discriminant is
226226
// specified that affects this variant. Thus, no risk of recursion.
@@ -254,10 +254,10 @@ impl<'a, 'ast: 'a> Visitor<'ast> for CheckItemRecursionVisitor<'a, 'ast> {
254254
self.visit_impl_item(item),
255255
ast_map::NodeForeignItem(_) => {},
256256
_ => {
257-
self.sess.span_bug(
257+
span_bug!(
258258
e.span,
259-
&format!("expected item, found {}",
260-
self.ast_map.node_to_string(node_id)));
259+
"expected item, found {}",
260+
self.ast_map.node_to_string(node_id));
261261
}
262262
}
263263
}
@@ -277,9 +277,9 @@ impl<'a, 'ast: 'a> Visitor<'ast> for CheckItemRecursionVisitor<'a, 'ast> {
277277
let variant = self.ast_map.expect_variant(variant_id);
278278
self.visit_variant(variant, generics, enum_id);
279279
} else {
280-
self.sess.span_bug(e.span,
281-
"`check_static_recursion` found \
282-
non-enum in Def::Variant");
280+
span_bug!(e.span,
281+
"`check_static_recursion` found \
282+
non-enum in Def::Variant");
283283
}
284284
}
285285
}

0 commit comments

Comments
 (0)