use rustc::ty::subst::{InternalSubsts, SubstsRef};
use rustc::util::nodemap::{ItemLocalSet, HirIdSet};
use rustc::hir;
+use syntax::symbol::sym;
use syntax_pos::{Span, DUMMY_SP};
use log::debug;
use Promotability::*;
if v.in_static {
for attr in &v.tcx.get_attrs(did)[..] {
- if attr.check_name("thread_local") {
+ if attr.check_name(sym::thread_local) {
debug!("Reference to Static(id={:?}) is unpromotable \
due to a #[thread_local] attribute", did);
return NotPromotable;
}
Res::Def(DefKind::Const, did) |
- Res::Def(DefKind::AssociatedConst, did) => {
+ Res::Def(DefKind::AssocConst, did) => {
let promotable = if v.tcx.trait_of_item(did).is_some() {
// Don't peek inside trait associated constants.
NotPromotable
NotPromotable
}
- hir::ExprKind::If(ref lhs, ref rhs, ref option_expr) => {
- let _ = v.check_expr(lhs);
- let _ = v.check_expr(rhs);
- if let Some(ref expr) = option_expr {
- let _ = v.check_expr(&expr);
- }
- NotPromotable
- }
-
// Loops (not very meaningful in constants).
hir::ExprKind::While(ref expr, ref box_block, ref _option_label) => {
let _ = v.check_expr(expr);