Fix dogfood

This commit is contained in:
mcarton
2016-12-02 22:33:16 +01:00
parent 65ff2df7e7
commit 1ba8ed96cf
3 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ fn into_vec(self) -> Vec<RefLt> {
fn collect_anonymous_lifetimes(&mut self, qpath: &QPath, ty: &Ty) {
let last_path_segment = &last_path_segment(qpath).parameters;
if let &AngleBracketedParameters(ref params) = last_path_segment {
if let AngleBracketedParameters(ref params) = *last_path_segment {
if params.lifetimes.is_empty() {
match self.cx.tcx.tables().qpath_def(qpath, ty.id) {
Def::TyAlias(def_id) |
+1 -1
View File
@@ -77,7 +77,7 @@ fn check_ty(&mut self, cx: &LateContext, ast_ty: &Ty) {
if let TyPath(ref qpath) = ast_ty.node {
let def = cx.tcx.tables().qpath_def(qpath, ast_ty.id);
if let Some(def_id) = opt_def_id(def) {
if def_id == cx.tcx.lang_items.owned_box().unwrap() {
if Some(def_id) == cx.tcx.lang_items.owned_box() {
let last = last_path_segment(qpath);
if_let_chain! {[
let PathParameters::AngleBracketedParameters(ref ag) = last.parameters,
+2 -5
View File
@@ -159,9 +159,6 @@ fn push(&mut self, text: &str) {
let mut apb = AbsolutePathBuffer { names: vec![] };
cx.tcx.push_item_path(&mut apb, def_id);
if path == paths::VEC_FROM_ELEM {
println!("{:#?} == {:#?}", apb.names, path);
}
apb.names.len() == path.len() &&
apb.names.iter().zip(path.iter()).all(|(a, &b)| &**a == b)
@@ -214,7 +211,7 @@ pub fn last_path_segment(path: &QPath) -> &PathSegment {
QPath::Resolved(_, ref path) => path.segments
.last()
.expect("A path must have at least one segment"),
QPath::TypeRelative(_, ref seg) => &seg,
QPath::TypeRelative(_, ref seg) => seg,
}
}
@@ -222,7 +219,7 @@ pub fn single_segment_path(path: &QPath) -> Option<&PathSegment> {
match *path {
QPath::Resolved(_, ref path) if path.segments.len() == 1 => Some(&path.segments[0]),
QPath::Resolved(..) => None,
QPath::TypeRelative(_, ref seg) => Some(&seg),
QPath::TypeRelative(_, ref seg) => Some(seg),
}
}