Skip to content

Commit 0b6f982

Browse files
committed
---
yaml --- r: 228838 b: refs/heads/try c: f91a20b h: refs/heads/master v: v3
1 parent 9b550d4 commit 0b6f982

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
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: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 52fd69c9332b1cddd1a778cf96ff432cfcad5beb
4+
refs/heads/try: f91a20bbfb7594c22b26f4216d7eba72c33f6ff8
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_trans/save/dump_csv.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,15 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
671671
}
672672

673673
let path_data = self.save_ctxt.get_path_data(id, path);
674+
let path_data = match path_data {
675+
Some(pd) => pd,
676+
None => {
677+
self.tcx.sess.span_bug(path.span,
678+
&format!("Unexpected def kind while looking \
679+
up path in `{}`",
680+
self.span.snippet(path.span)))
681+
}
682+
};
674683
match path_data {
675684
Data::VariableRefData(ref vrd) => {
676685
self.fmt.ref_str(ref_kind.unwrap_or(recorder::VarRef),

branches/try/src/librustc_trans/save/mod.rs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
508508
}))
509509
}
510510
ast::ExprPath(_, ref path) => {
511-
Some(self.get_path_data(expr.id, path))
511+
self.get_path_data(expr.id, path)
512512
}
513513
_ => {
514514
// FIXME
@@ -520,7 +520,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
520520
pub fn get_path_data(&self,
521521
id: NodeId,
522522
path: &ast::Path)
523-
-> Data {
523+
-> Option<Data> {
524524
let def_map = self.tcx.def_map.borrow();
525525
if !def_map.contains_key(&id) {
526526
self.tcx.sess.span_bug(path.span,
@@ -535,22 +535,22 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
535535
def::DefConst(..) |
536536
def::DefAssociatedConst(..) |
537537
def::DefVariant(..) => {
538-
Data::VariableRefData(VariableRefData {
538+
Some(Data::VariableRefData(VariableRefData {
539539
name: self.span_utils.snippet(sub_span.unwrap()),
540540
span: sub_span.unwrap(),
541541
scope: self.enclosing_scope(id),
542542
ref_id: def.def_id(),
543-
})
543+
}))
544544
}
545545
def::DefStruct(def_id) |
546546
def::DefTy(def_id, _) |
547547
def::DefTrait(def_id) |
548548
def::DefTyParam(_, _, def_id, _) => {
549-
Data::TypeRefData(TypeRefData {
549+
Some(Data::TypeRefData(TypeRefData {
550550
span: sub_span.unwrap(),
551551
ref_id: def_id,
552552
scope: self.enclosing_scope(id),
553-
})
553+
}))
554554
}
555555
def::DefMethod(decl_id, provenence) => {
556556
let sub_span = self.span_utils.sub_span_for_meth_name(path.span);
@@ -581,32 +581,28 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
581581
} else {
582582
None
583583
};
584-
Data::MethodCallData(MethodCallData {
584+
Some(Data::MethodCallData(MethodCallData {
585585
span: sub_span.unwrap(),
586586
scope: self.enclosing_scope(id),
587587
ref_id: def_id,
588588
decl_id: Some(decl_id),
589-
})
589+
}))
590590
},
591591
def::DefFn(def_id, _) => {
592-
Data::FunctionCallData(FunctionCallData {
592+
Some(Data::FunctionCallData(FunctionCallData {
593593
ref_id: def_id,
594594
span: sub_span.unwrap(),
595595
scope: self.enclosing_scope(id),
596-
})
596+
}))
597597
}
598598
def::DefMod(def_id) => {
599-
Data::ModRefData(ModRefData {
599+
Some(Data::ModRefData(ModRefData {
600600
ref_id: def_id,
601601
span: sub_span.unwrap(),
602602
scope: self.enclosing_scope(id),
603-
})
603+
}))
604604
}
605-
_ => self.tcx.sess.span_bug(path.span,
606-
&format!("Unexpected def kind while looking \
607-
up path in `{}`: `{:?}`",
608-
self.span_utils.snippet(path.span),
609-
def)),
605+
_ => None,
610606
}
611607
}
612608

0 commit comments

Comments
 (0)