Skip to content

Commit aa40a1c

Browse files
committed
change creepy case to call span_bug instead of doing something clearly wrong
1 parent 9ff4f57 commit aa40a1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc/middle/const_eval.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ fn lookup_variant_by_id<'a>(tcx: &'a ty::ctxt,
9191
let expr_id = match csearch::maybe_get_item_ast(tcx, enum_def,
9292
Box::new(|a, b, c, d| astencode::decode_inlined_item(a, b, c, d))) {
9393
csearch::FoundAst::Found(&InlinedItem::Item(ref item)) => match item.node {
94-
hir::ItemEnum(hir::EnumDef { ref variants }, _) => {
95-
// NOTE this doesn't do the right thing, it compares inlined
96-
// NodeId's to the original variant_def's NodeId, but they
97-
// come from different crates, so they will likely never match.
98-
variant_expr(&variants[..], variant_def.node).map(|e| e.id)
94+
hir::ItemEnum(hir::EnumDef { .. }, _) => {
95+
tcx.sess.span_bug(
96+
item.span,
97+
&format!("cross-crate enum discr constant with enum {:?} variant {:?}",
98+
enum_def, variant_def));
9999
}
100100
_ => None
101101
},

0 commit comments

Comments
 (0)