mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
Fix dogfood
This commit is contained in:
@@ -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) |
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user