Skip to content

Commit ffa470b

Browse files
committed
---
yaml --- r: 272213 b: refs/heads/auto c: e3a7a66 h: refs/heads/master i: 272211: 1a9bf1d
1 parent 0592caf commit ffa470b

File tree

20 files changed

+56
-56
lines changed

20 files changed

+56
-56
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: 2fa867a2031bd580cd763fa9dcd8d7d4ba9e2bfc
11+
refs/heads/auto: e3a7a66f1a842ec6eb03416ae5dfc082a119da8c
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/dep_graph/edges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl DepGraphEdges {
122122
{
123123
match self.current_node() {
124124
Some(open_node) => self.add_edge_from_open_node(open_node, op),
125-
None => panic!("no current node, cannot add edge into dependency graph")
125+
None => bug!("no current node, cannot add edge into dependency graph")
126126
}
127127
}
128128

branches/auto/src/librustc/dep_graph/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl DepGraphThreadData {
148148

149149
// Outline this too.
150150
fn invalid_message(&self, string: &str) {
151-
panic!("{}; see src/librustc/dep_graph/README.md for more information", string)
151+
bug!("{}; see src/librustc/dep_graph/README.md for more information", string)
152152
}
153153
}
154154

branches/auto/src/librustc/front/map/blocks.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,21 @@ impl<'a> FnLikeNode<'a> {
231231
span: i.span,
232232
attrs: &i.attrs,
233233
}),
234-
_ => panic!("item FnLikeNode that is not fn-like"),
234+
_ => bug!("item FnLikeNode that is not fn-like"),
235235
},
236236
map::NodeTraitItem(ti) => match ti.node {
237237
ast::MethodTraitItem(ref sig, Some(ref body)) => {
238238
method(ti.id, ti.name, sig, None, body, ti.span, &ti.attrs)
239239
}
240-
_ => panic!("trait method FnLikeNode that is not fn-like"),
240+
_ => bug!("trait method FnLikeNode that is not fn-like"),
241241
},
242242
map::NodeImplItem(ii) => {
243243
match ii.node {
244244
ast::ImplItemKind::Method(ref sig, ref body) => {
245245
method(ii.id, ii.name, sig, Some(ii.vis), body, ii.span, &ii.attrs)
246246
}
247247
_ => {
248-
panic!("impl method FnLikeNode that is not fn-like")
248+
bug!("impl method FnLikeNode that is not fn-like")
249249
}
250250
}
251251
}
@@ -256,9 +256,9 @@ impl<'a> FnLikeNode<'a> {
256256
e.id,
257257
e.span,
258258
e.attrs.as_attr_slice())),
259-
_ => panic!("expr FnLikeNode that is not fn-like"),
259+
_ => bug!("expr FnLikeNode that is not fn-like"),
260260
},
261-
_ => panic!("other FnLikeNode that is not fn-like"),
261+
_ => bug!("other FnLikeNode that is not fn-like"),
262262
}
263263
}
264264
}

branches/auto/src/librustc/front/map/mod.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ impl<'ast> Map<'ast> {
335335
return self.opt_local_def_id(id)
336336
.map(|def_id| DepNode::Hir(def_id))
337337
.unwrap_or_else(|| {
338-
panic!("Walking parents from `{}` \
339-
led to `NotPresent` at `{}`",
340-
id0, id)
338+
bug!("Walking parents from `{}` \
339+
led to `NotPresent` at `{}`",
340+
id0, id)
341341
}),
342342
}
343343
}
@@ -363,8 +363,8 @@ impl<'ast> Map<'ast> {
363363

364364
pub fn local_def_id(&self, node: NodeId) -> DefId {
365365
self.opt_local_def_id(node).unwrap_or_else(|| {
366-
panic!("local_def_id: no entry for `{}`, which has a map of `{:?}`",
367-
node, self.find_entry(node))
366+
bug!("local_def_id: no entry for `{}`, which has a map of `{:?}`",
367+
node, self.find_entry(node))
368368
})
369369
}
370370

@@ -402,7 +402,7 @@ impl<'ast> Map<'ast> {
402402
pub fn get(&self, id: NodeId) -> Node<'ast> {
403403
match self.find(id) {
404404
Some(node) => node, // read recorded by `find`
405-
None => panic!("couldn't find node id {} in the AST map", id)
405+
None => bug!("couldn't find node id {} in the AST map", id)
406406
}
407407
}
408408

@@ -576,22 +576,22 @@ impl<'ast> Map<'ast> {
576576
self.read(id); // reveals some of the content of a node
577577
abi
578578
}
579-
None => panic!("expected foreign mod or inlined parent, found {}",
579+
None => bug!("expected foreign mod or inlined parent, found {}",
580580
self.node_to_string(parent))
581581
}
582582
}
583583

584584
pub fn expect_item(&self, id: NodeId) -> &'ast Item {
585585
match self.find(id) { // read recorded by `find`
586586
Some(NodeItem(item)) => item,
587-
_ => panic!("expected item, found {}", self.node_to_string(id))
587+
_ => bug!("expected item, found {}", self.node_to_string(id))
588588
}
589589
}
590590

591591
pub fn expect_trait_item(&self, id: NodeId) -> &'ast TraitItem {
592592
match self.find(id) {
593593
Some(NodeTraitItem(item)) => item,
594-
_ => panic!("expected trait item, found {}", self.node_to_string(id))
594+
_ => bug!("expected trait item, found {}", self.node_to_string(id))
595595
}
596596
}
597597

@@ -600,38 +600,38 @@ impl<'ast> Map<'ast> {
600600
Some(NodeItem(i)) => {
601601
match i.node {
602602
ItemStruct(ref struct_def, _) => struct_def,
603-
_ => panic!("struct ID bound to non-struct")
603+
_ => bug!("struct ID bound to non-struct")
604604
}
605605
}
606606
Some(NodeVariant(variant)) => {
607607
if variant.node.data.is_struct() {
608608
&variant.node.data
609609
} else {
610-
panic!("struct ID bound to enum variant that isn't struct-like")
610+
bug!("struct ID bound to enum variant that isn't struct-like")
611611
}
612612
}
613-
_ => panic!(format!("expected struct, found {}", self.node_to_string(id))),
613+
_ => bug!("expected struct, found {}", self.node_to_string(id)),
614614
}
615615
}
616616

617617
pub fn expect_variant(&self, id: NodeId) -> &'ast Variant {
618618
match self.find(id) {
619619
Some(NodeVariant(variant)) => variant,
620-
_ => panic!(format!("expected variant, found {}", self.node_to_string(id))),
620+
_ => bug!("expected variant, found {}", self.node_to_string(id)),
621621
}
622622
}
623623

624624
pub fn expect_foreign_item(&self, id: NodeId) -> &'ast ForeignItem {
625625
match self.find(id) {
626626
Some(NodeForeignItem(item)) => item,
627-
_ => panic!("expected foreign item, found {}", self.node_to_string(id))
627+
_ => bug!("expected foreign item, found {}", self.node_to_string(id))
628628
}
629629
}
630630

631631
pub fn expect_expr(&self, id: NodeId) -> &'ast Expr {
632632
match self.find(id) { // read recorded by find
633633
Some(NodeExpr(expr)) => expr,
634-
_ => panic!("expected expr, found {}", self.node_to_string(id))
634+
_ => bug!("expected expr, found {}", self.node_to_string(id))
635635
}
636636
}
637637

@@ -656,7 +656,7 @@ impl<'ast> Map<'ast> {
656656
NodeLocal(&Pat { node: PatKind::Ident(_,l,_), .. }) => {
657657
PathName(l.node.name)
658658
},
659-
_ => panic!("no path elem for {:?}", node)
659+
_ => bug!("no path elem for {:?}", node)
660660
}
661661
}
662662

@@ -773,7 +773,7 @@ impl<'ast> Map<'ast> {
773773
pub fn span(&self, id: NodeId) -> Span {
774774
self.read(id); // reveals span from node
775775
self.opt_span(id)
776-
.unwrap_or_else(|| panic!("AstMap.span: could not find span for id {:?}", id))
776+
.unwrap_or_else(|| bug!("AstMap.span: could not find span for id {:?}", id))
777777
}
778778

779779
pub fn span_if_local(&self, id: DefId) -> Option<Span> {
@@ -1019,12 +1019,12 @@ impl<'a> NodePrinter for pprust::State<'a> {
10191019
NodePat(a) => self.print_pat(&a),
10201020
NodeBlock(a) => self.print_block(&a),
10211021
NodeLifetime(a) => self.print_lifetime(&a),
1022-
NodeTyParam(_) => panic!("cannot print TyParam"),
1022+
NodeTyParam(_) => bug!("cannot print TyParam"),
10231023
// these cases do not carry enough information in the
10241024
// ast_map to reconstruct their full structure for pretty
10251025
// printing.
1026-
NodeLocal(_) => panic!("cannot print isolated Local"),
1027-
NodeStructCtor(_) => panic!("cannot print isolated StructCtor"),
1026+
NodeLocal(_) => bug!("cannot print isolated Local"),
1027+
NodeStructCtor(_) => bug!("cannot print isolated StructCtor"),
10281028
}
10291029
}
10301030
}

branches/auto/src/librustc/infer/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
404404
bound_failures.push((origin.clone(), kind.clone(), region));
405405
}
406406
ProcessedErrors(..) => {
407-
panic!("should not encounter a `ProcessedErrors` yet: {:?}", error)
407+
bug!("should not encounter a `ProcessedErrors` yet: {:?}", error)
408408
}
409409
}
410410
}

branches/auto/src/librustc/infer/region_inference/graphviz.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ impl<'a, 'tcx> dot::Labeller<'a> for ConstraintGraph<'a, 'tcx> {
182182
fn node_id(&self, n: &Node) -> dot::Id {
183183
let node_id = match self.node_ids.get(n) {
184184
Some(node_id) => node_id,
185-
None => panic!("no node_id found for node: {:?}", n),
185+
None => bug!("no node_id found for node: {:?}", n),
186186
};
187187
let name = || format!("node_{}", node_id);
188188
match dot::Id::new(name()) {
189189
Ok(id) => id,
190190
Err(_) => {
191-
panic!("failed to create graphviz node identified by {}", name());
191+
bug!("failed to create graphviz node identified by {}", name());
192192
}
193193
}
194194
}

branches/auto/src/librustc/infer/region_inference/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
309309
while undo_log.len() > snapshot.length + 1 {
310310
match undo_log.pop().unwrap() {
311311
OpenSnapshot => {
312-
panic!("Failure to observe stack discipline");
312+
bug!("Failure to observe stack discipline");
313313
}
314314
CommitedSnapshot => {}
315315
AddVar(vid) => {

branches/auto/src/librustc/infer/type_variable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ impl<'tcx> TypeVariableTable<'tcx> {
159159

160160
let (relations, default) = match old_value {
161161
Bounded { relations, default } => (relations, default),
162-
Known(_) => panic!("Asked to instantiate variable that is \
163-
already instantiated")
162+
Known(_) => bug!("Asked to instantiate variable that is \
163+
already instantiated")
164164
};
165165

166166
for &(dir, vid) in &relations {
@@ -318,7 +318,7 @@ impl<'tcx> sv::SnapshotVecDelegate for Delegate<'tcx> {
318318

319319
fn relations<'a>(v: &'a mut TypeVariableData) -> &'a mut Vec<Relation> {
320320
match v.value {
321-
Known(_) => panic!("var_sub_var: variable is known"),
321+
Known(_) => bug!("var_sub_var: variable is known"),
322322
Bounded { ref mut relations, .. } => relations
323323
}
324324
}

branches/auto/src/librustc/lint/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl LintStore {
232232
pub fn register_renamed(&mut self, old_name: &str, new_name: &str) {
233233
let target = match self.by_name.get(new_name) {
234234
Some(&Id(lint_id)) => lint_id.clone(),
235-
_ => panic!("invalid lint renaming of {} to {}", old_name, new_name)
235+
_ => bug!("invalid lint renaming of {} to {}", old_name, new_name)
236236
};
237237
self.by_name.insert(old_name.to_string(), Renamed(new_name.to_string(), target));
238238
}
@@ -430,7 +430,7 @@ pub fn raw_struct_lint<'a>(sess: &'a Session,
430430
format!("{} [-{} {}]", msg,
431431
match level {
432432
Warn => 'W', Deny => 'D', Forbid => 'F',
433-
Allow => panic!()
433+
Allow => bug!()
434434
}, name.replace("_", "-"))
435435
},
436436
Node(src) => {

branches/auto/src/librustc/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
309309
{
310310
let mut say = |s: &str| {
311311
match (sp, sess) {
312-
(_, None) => panic!("{}", s),
312+
(_, None) => bug!("{}", s),
313313
(Some(sp), Some(sess)) => sess.span_err(sp, s),
314314
(None, Some(sess)) => sess.err(s),
315315
}

branches/auto/src/librustc/middle/def.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl PathResolution {
7171
/// Get the definition, if fully resolved, otherwise panic.
7272
pub fn full_def(&self) -> Def {
7373
if self.depth != 0 {
74-
panic!("path not fully resolved: {:?}", self);
74+
bug!("path not fully resolved: {:?}", self);
7575
}
7676
self.base_def
7777
}
@@ -116,7 +116,7 @@ impl Def {
116116
Def::TyParam(..) | Def::Struct(..) | Def::Trait(..) |
117117
Def::Method(..) | Def::Const(..) | Def::AssociatedConst(..) |
118118
Def::PrimTy(..) | Def::Label(..) | Def::SelfTy(..) | Def::Err => {
119-
panic!("attempted .var_id() on invalid {:?}", self)
119+
bug!("attempted .var_id() on invalid {:?}", self)
120120
}
121121
}
122122
}
@@ -135,7 +135,7 @@ impl Def {
135135
Def::PrimTy(..) |
136136
Def::SelfTy(..) |
137137
Def::Err => {
138-
panic!("attempted .def_id() on invalid def: {:?}", self)
138+
bug!("attempted .def_id() on invalid def: {:?}", self)
139139
}
140140
}
141141
}

branches/auto/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
611611
}))
612612
}
613613

614-
Def::Err => panic!("Def::Err in memory categorization")
614+
Def::Err => bug!("Def::Err in memory categorization")
615615
}
616616
}
617617

branches/auto/src/librustc/middle/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl RegionMaps {
343343
pub fn lookup_code_extent(&self, e: CodeExtentData) -> CodeExtent {
344344
match self.code_extent_interner.borrow().get(&e) {
345345
Some(&d) => d,
346-
None => panic!("unknown code extent {:?}", e)
346+
None => bug!("unknown code extent {:?}", e)
347347
}
348348
}
349349
pub fn node_extent(&self, n: ast::NodeId) -> CodeExtent {
@@ -470,7 +470,7 @@ impl RegionMaps {
470470
pub fn var_scope(&self, var_id: ast::NodeId) -> CodeExtent {
471471
match self.var_map.borrow().get(&var_id) {
472472
Some(&r) => r,
473-
None => { panic!("no enclosing scope for id {:?}", var_id); }
473+
None => { bug!("no enclosing scope for id {:?}", var_id); }
474474
}
475475
}
476476

branches/auto/src/librustc/session/filesearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ pub fn get_or_default_sysroot() -> PathBuf {
155155
// gcc chokes on verbatim paths which fs::canonicalize generates
156156
// so we try to avoid those kinds of paths.
157157
Ok(canon) => Some(rustcfs::fix_windows_verbatim_for_gcc(&canon)),
158-
Err(e) => panic!("failed to get realpath: {}", e),
158+
Err(e) => bug!("failed to get realpath: {}", e),
159159
}
160160
})
161161
}
162162

163163
match canonicalize(env::current_exe().ok()) {
164164
Some(mut p) => { p.pop(); p.pop(); p }
165-
None => panic!("can't determine value for sysroot")
165+
None => bug!("can't determine value for sysroot")
166166
}
167167
}
168168

branches/auto/src/librustc/traits/specialize/specialization_graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ impl Graph {
145145
/// Insert cached metadata mapping from a child impl back to its parent.
146146
pub fn record_impl_from_cstore(&mut self, parent: DefId, child: DefId) {
147147
if self.parent.insert(child, parent).is_some() {
148-
panic!("When recording an impl from the crate store, information about its parent \
149-
was already present.");
148+
bug!("When recording an impl from the crate store, information about its parent \
149+
was already present.");
150150
}
151151

152152
self.children.entry(parent).or_insert(vec![]).push(child);

branches/auto/src/librustc/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ impl<'tcx, 'container> AdtDefData<'tcx, 'container> {
16471647
match def {
16481648
Def::Variant(_, vid) => self.variant_with_id(vid),
16491649
Def::Struct(..) | Def::TyAlias(..) => self.struct_variant(),
1650-
_ => panic!("unexpected def {:?} in variant_of_def", def)
1650+
_ => bug!("unexpected def {:?} in variant_of_def", def)
16511651
}
16521652
}
16531653

@@ -1857,7 +1857,7 @@ fn lookup_locally_or_in_crate_store<M, F>(descr: &str,
18571857
{
18581858
map.memoize(def_id, || {
18591859
if def_id.is_local() {
1860-
panic!("No def'n found for {:?} in tcx.{}", def_id, descr);
1860+
bug!("No def'n found for {:?} in tcx.{}", def_id, descr);
18611861
}
18621862
load_external()
18631863
})

0 commit comments

Comments
 (0)