Rust upgrade to rustc 1.22.0-nightly (14039a42a 2017-09-22)

This commit is contained in:
Manish Goregaokar 2017-09-23 13:30:29 -07:00
parent c3df3bc681
commit e3c4ec74d7
2 changed files with 10 additions and 10 deletions

View File

@ -113,7 +113,7 @@ fn check_fn_inner<'a, 'tcx>(
.parameters
.lifetimes;
for bound in bounds {
if bound.name != "'static" && !bound.is_elided() {
if bound.name.name() != "'static" && !bound.is_elided() {
return;
}
bounds_lts.push(bound);
@ -225,7 +225,7 @@ fn allowed_lts_from(named_lts: &[LifetimeDef]) -> HashSet<RefLt> {
let mut allowed_lts = HashSet::new();
for lt in named_lts {
if lt.bounds.is_empty() {
allowed_lts.insert(RefLt::Named(lt.lifetime.name));
allowed_lts.insert(RefLt::Named(lt.lifetime.name.name()));
}
}
allowed_lts.insert(RefLt::Unnamed);
@ -235,8 +235,8 @@ fn allowed_lts_from(named_lts: &[LifetimeDef]) -> HashSet<RefLt> {
fn lts_from_bounds<'a, T: Iterator<Item = &'a Lifetime>>(mut vec: Vec<RefLt>, bounds_lts: T) -> Vec<RefLt> {
for lt in bounds_lts {
if lt.name != "'static" {
vec.push(RefLt::Named(lt.name));
if lt.name.name() != "'static" {
vec.push(RefLt::Named(lt.name.name()));
}
}
@ -266,12 +266,12 @@ impl<'v, 't> RefVisitor<'v, 't> {
fn record(&mut self, lifetime: &Option<Lifetime>) {
if let Some(ref lt) = *lifetime {
if lt.name == "'static" {
if lt.name.name() == "'static" {
self.lts.push(RefLt::Static);
} else if lt.is_elided() {
self.lts.push(RefLt::Unnamed);
} else {
self.lts.push(RefLt::Named(lt.name));
self.lts.push(RefLt::Named(lt.name.name()));
}
} else {
self.lts.push(RefLt::Unnamed);
@ -396,7 +396,7 @@ struct LifetimeChecker {
impl<'tcx> Visitor<'tcx> for LifetimeChecker {
// for lifetimes as parameters of generics
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
self.map.remove(&lifetime.name);
self.map.remove(&lifetime.name.name());
}
fn visit_lifetime_def(&mut self, _: &'tcx LifetimeDef) {
@ -415,7 +415,7 @@ fn report_extra_lifetimes<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, func: &'tcx
let hs = generics
.lifetimes
.iter()
.map(|lt| (lt.lifetime.name, lt.lifetime.span))
.map(|lt| (lt.lifetime.name.name(), lt.lifetime.span))
.collect();
let mut checker = LifetimeChecker { map: hs };
@ -434,7 +434,7 @@ struct BodyLifetimeChecker {
impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
// for lifetimes as parameters of generics
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
if lifetime.name != keywords::Invalid.name() && lifetime.name != "'static" {
if lifetime.name.name() != keywords::Invalid.name() && lifetime.name.name() != "'static" {
self.lifetimes_used_in_body = true;
}
}

View File

@ -223,7 +223,7 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
let ltopt = if lt.is_elided() {
"".to_owned()
} else {
format!("{} ", lt.name.as_str())
format!("{} ", lt.name.name().as_str())
};
let mutopt = if *mutbl == Mutability::MutMutable {
"mut "