Try to fix a build regression before it happens

This commit is contained in:
Nick Cameron 2018-04-09 21:07:49 +12:00
parent f14671131e
commit e784712f09

View File

@ -309,19 +309,24 @@ impl UseTree {
}
}
let mut done = false;
if aliased_self {
match self.path.last() {
match self.path.last_mut() {
Some(UseSegment::Ident(_, ref mut old_rename)) => {
assert!(old_rename.is_none());
if let UseSegment::Slf(Some(rename)) = last {
if let UseSegment::Slf(Some(rename)) = last.clone() {
*old_rename = Some(rename);
return self;
done = true;
}
}
_ => unreachable!(),
}
}
if done {
return self;
}
// Normalise foo::{bar} -> foo::bar
if let UseSegment::List(ref list) = last {
if list.len() == 1 {