// target uses". This _includes_ integer-constants, plus the following
// constructors:
//
-// fixed-size vectors and strings: .index(&FullRange) and ""/_
+// fixed-size vectors and strings: [] and ""/_
// vector and string slices: &[] and &""
// tuples: (,)
// enums: foo(...)
None => None,
Some(ast_map::NodeItem(it)) => match it.node {
ast::ItemEnum(ast::EnumDef { ref variants }, _) => {
- variant_expr(variants.index(&FullRange), variant_def.node)
+ variant_expr(&variants[], variant_def.node)
}
_ => None
},
// 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.index(&FullRange), variant_def.node).map(|e| e.id)
+ variant_expr(&variants[], variant_def.node).map(|e| e.id)
}
_ => None
},
pub fn eval_const_expr(tcx: &ty::ctxt, e: &Expr) -> const_val {
match eval_const_expr_partial(tcx, e) {
Ok(r) => r,
- Err(s) => tcx.sess.span_fatal(e.span, s.index(&FullRange))
+ Err(s) => tcx.sess.span_fatal(e.span, &s[])
}
}