use rustc::ty::subst::{Subst, Substs};
use rustc::ty::{self, Instance, Ty, TyCtxt};
use rustc::{bug, span_bug};
+use rustc_data_structures::sync::Lrc;
use std::cmp::Ordering::{self, Equal};
use std::cmp::PartialOrd;
use std::convert::TryInto;
use std::hash::{Hash, Hasher};
-use std::rc::Rc;
use syntax::ast::{FloatTy, LitKind};
use syntax::ptr::P;
/// a String "abc"
Str(String),
/// a Binary String b"abc"
- Binary(Rc<Vec<u8>>),
+ Binary(Lrc<Vec<u8>>),
/// a single char 'a'
Char(char),
/// an integer's bit representation
match *lit {
LitKind::Str(ref is, _) => Constant::Str(is.to_string()),
LitKind::Byte(b) => Constant::Int(u128::from(b)),
- LitKind::ByteStr(ref s) => Constant::Binary(Rc::clone(s)),
+ LitKind::ByteStr(ref s) => Constant::Binary(Lrc::clone(s)),
LitKind::Char(c) => Constant::Char(c),
LitKind::Int(n, _) => Constant::Int(n),
LitKind::Float(ref is, _) | LitKind::FloatUnsuffixed(ref is) => match ty.sty {
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use syntax::source_map::Span;
-use syntax::symbol::LocalInternedString;
+use syntax::symbol::{InternedString, LocalInternedString};
/// **What it does:** Detects enumeration variants that are prefixed or suffixed
/// by the same characters.
}
pub struct EnumVariantNames {
- modules: Vec<(LocalInternedString, String)>,
+ modules: Vec<(InternedString, String)>,
threshold: u64,
}
};
check_variant(cx, self.threshold, def, &item_name, item_name_chars, item.span, lint);
}
- self.modules.push((item_name, item_camel));
+ self.modules.push((item_name.as_interned_str(), item_camel));
}
}
subst::Kind,
Binder, Ty, TyCtxt,
};
+use rustc_data_structures::sync::Lrc;
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart};
use std::borrow::Cow;
use std::env;
use std::mem;
-use std::rc::Rc;
use std::str::FromStr;
use syntax::ast::{self, LitKind};
use syntax::attr;
None => return None,
};
- for item in mem::replace(&mut items, Rc::new(vec![])).iter() {
+ for item in mem::replace(&mut items, Lrc::new(vec![])).iter() {
if item.ident.name == *segment {
if path_it.peek().is_none() {
return Some(item.def);