Fix dogfood
This commit is contained in:
parent
65ff2df7e7
commit
1ba8ed96cf
3 changed files with 4 additions and 7 deletions
|
@ -241,7 +241,7 @@ impl<'v, 't> RefVisitor<'v, 't> {
|
|||
|
||||
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) |
|
||||
|
|
|
@ -77,7 +77,7 @@ impl LateLintPass for TypePass {
|
|||
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,
|
||||
|
|
|
@ -159,9 +159,6 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
|
|||
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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue