diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-09-03 20:36:53 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-10-01 10:28:28 -0400 |
| commit | aa40a1cad0f359bfc799545e70bb5c7c9e72ba93 (patch) | |
| tree | 796e80f4139f938514dd830b7b0eb1d8e2bfc811 | |
| parent | 9ff4f57cd0ee0537b9135a97547daf1131f0bc17 (diff) | |
| download | rust-aa40a1cad0f359bfc799545e70bb5c7c9e72ba93.tar.gz rust-aa40a1cad0f359bfc799545e70bb5c7c9e72ba93.zip | |
change creepy case to call span_bug instead of doing something clearly wrong
| -rw-r--r-- | src/librustc/middle/const_eval.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 4894a78f1ac..bde81090aa0 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -91,11 +91,11 @@ fn lookup_variant_by_id<'a>(tcx: &'a ty::ctxt, let expr_id = match csearch::maybe_get_item_ast(tcx, enum_def, Box::new(|a, b, c, d| astencode::decode_inlined_item(a, b, c, d))) { csearch::FoundAst::Found(&InlinedItem::Item(ref item)) => match item.node { - hir::ItemEnum(hir::EnumDef { ref variants }, _) => { - // NOTE this doesn't do the right thing, it compares inlined - // NodeId's to the original variant_def's NodeId, but they - // come from different crates, so they will likely never match. - variant_expr(&variants[..], variant_def.node).map(|e| e.id) + hir::ItemEnum(hir::EnumDef { .. }, _) => { + tcx.sess.span_bug( + item.span, + &format!("cross-crate enum discr constant with enum {:?} variant {:?}", + enum_def, variant_def)); } _ => None }, |
