Auto merge of #3786 - rust-lang:rustup, r=Manishearth
Rustup to rustc master (32471f7ea
2019-02-19)
None
This commit is contained in:
commit
d61b25419b
@ -113,7 +113,7 @@ fn check_fn_inner<'a, 'tcx>(
|
|||||||
let mut bounds_lts = Vec::new();
|
let mut bounds_lts = Vec::new();
|
||||||
let types = generics.params.iter().filter(|param| match param.kind {
|
let types = generics.params.iter().filter(|param| match param.kind {
|
||||||
GenericParamKind::Type { .. } => true,
|
GenericParamKind::Type { .. } => true,
|
||||||
GenericParamKind::Lifetime { .. } => false,
|
_ => false,
|
||||||
});
|
});
|
||||||
for typ in types {
|
for typ in types {
|
||||||
for bound in &typ.bounds {
|
for bound in &typ.bounds {
|
||||||
@ -133,7 +133,7 @@ fn check_fn_inner<'a, 'tcx>(
|
|||||||
if let Some(ref params) = *params {
|
if let Some(ref params) = *params {
|
||||||
let lifetimes = params.args.iter().filter_map(|arg| match arg {
|
let lifetimes = params.args.iter().filter_map(|arg| match arg {
|
||||||
GenericArg::Lifetime(lt) => Some(lt),
|
GenericArg::Lifetime(lt) => Some(lt),
|
||||||
GenericArg::Type(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
for bound in lifetimes {
|
for bound in lifetimes {
|
||||||
if bound.name != LifetimeName::Static && !bound.is_elided() {
|
if bound.name != LifetimeName::Static && !bound.is_elided() {
|
||||||
@ -316,7 +316,7 @@ fn collect_anonymous_lifetimes(&mut self, qpath: &QPath, ty: &Ty) {
|
|||||||
if !last_path_segment.parenthesized
|
if !last_path_segment.parenthesized
|
||||||
&& !last_path_segment.args.iter().any(|arg| match arg {
|
&& !last_path_segment.args.iter().any(|arg| match arg {
|
||||||
GenericArg::Lifetime(_) => true,
|
GenericArg::Lifetime(_) => true,
|
||||||
GenericArg::Type(_) => false,
|
_ => false,
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
let hir_id = self.cx.tcx.hir().node_to_hir_id(ty.id);
|
let hir_id = self.cx.tcx.hir().node_to_hir_id(ty.id);
|
||||||
|
@ -234,7 +234,7 @@ fn check_fn(
|
|||||||
.and_then(|ps| ps.args.as_ref())
|
.and_then(|ps| ps.args.as_ref())
|
||||||
.map(|params| params.args.iter().find_map(|arg| match arg {
|
.map(|params| params.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
}).unwrap());
|
}).unwrap());
|
||||||
then {
|
then {
|
||||||
let slice_ty = format!("&[{}]", snippet(cx, elem_ty.span, "_"));
|
let slice_ty = format!("&[{}]", snippet(cx, elem_ty.span, "_"));
|
||||||
|
@ -235,7 +235,7 @@ fn check_fn(cx: &LateContext<'_, '_>, decl: &FnDecl, fn_id: NodeId, opt_body_id:
|
|||||||
if !params.parenthesized;
|
if !params.parenthesized;
|
||||||
if let Some(inner) = params.args.iter().find_map(|arg| match arg {
|
if let Some(inner) = params.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
then {
|
then {
|
||||||
let replacement = snippet_opt(cx, inner.span);
|
let replacement = snippet_opt(cx, inner.span);
|
||||||
|
@ -498,7 +498,7 @@ fn get_type_snippet(cx: &LateContext<'_, '_>, path: &QPath, to_ref_ty: Ty<'_>) -
|
|||||||
if !params.parenthesized;
|
if !params.parenthesized;
|
||||||
if let Some(to_ty) = params.args.iter().filter_map(|arg| match arg {
|
if let Some(to_ty) = params.args.iter().filter_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
}).nth(1);
|
}).nth(1);
|
||||||
if let TyKind::Rptr(_, ref to_ty) = to_ty.node;
|
if let TyKind::Rptr(_, ref to_ty) = to_ty.node;
|
||||||
then {
|
then {
|
||||||
|
@ -223,7 +223,7 @@ fn match_type_parameter(cx: &LateContext<'_, '_>, qpath: &QPath, path: &[&str])
|
|||||||
if !params.parenthesized;
|
if !params.parenthesized;
|
||||||
if let Some(ty) = params.args.iter().find_map(|arg| match arg {
|
if let Some(ty) = params.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
if let TyKind::Path(ref qpath) = ty.node;
|
if let TyKind::Path(ref qpath) = ty.node;
|
||||||
if let Some(did) = opt_def_id(cx.tables.qpath_def(qpath, cx.tcx.hir().node_to_hir_id(ty.id)));
|
if let Some(did) = opt_def_id(cx.tables.qpath_def(qpath, cx.tcx.hir().node_to_hir_id(ty.id)));
|
||||||
@ -267,7 +267,7 @@ fn check_ty(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool) {
|
|||||||
if let Some(ref last) = last_path_segment(qpath).args;
|
if let Some(ref last) = last_path_segment(qpath).args;
|
||||||
if let Some(ty) = last.args.iter().find_map(|arg| match arg {
|
if let Some(ty) = last.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
// ty is now _ at this point
|
// ty is now _ at this point
|
||||||
if let TyKind::Path(ref ty_qpath) = ty.node;
|
if let TyKind::Path(ref ty_qpath) = ty.node;
|
||||||
@ -278,7 +278,7 @@ fn check_ty(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool) {
|
|||||||
if let Some(ref last) = last_path_segment(ty_qpath).args;
|
if let Some(ref last) = last_path_segment(ty_qpath).args;
|
||||||
if let Some(boxed_ty) = last.args.iter().find_map(|arg| match arg {
|
if let Some(boxed_ty) = last.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
then {
|
then {
|
||||||
let ty_ty = hir_ty_to_ty(cx.tcx, boxed_ty);
|
let ty_ty = hir_ty_to_ty(cx.tcx, boxed_ty);
|
||||||
@ -327,7 +327,7 @@ enum if you need to distinguish all 3 cases",
|
|||||||
.map_or_else(|| [].iter(), |params| params.args.iter())
|
.map_or_else(|| [].iter(), |params| params.args.iter())
|
||||||
.filter_map(|arg| match arg {
|
.filter_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
}) {
|
}) {
|
||||||
check_ty(cx, ty, is_local);
|
check_ty(cx, ty, is_local);
|
||||||
@ -340,7 +340,7 @@ enum if you need to distinguish all 3 cases",
|
|||||||
.map_or_else(|| [].iter(), |params| params.args.iter())
|
.map_or_else(|| [].iter(), |params| params.args.iter())
|
||||||
.filter_map(|arg| match arg {
|
.filter_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
}) {
|
}) {
|
||||||
check_ty(cx, ty, is_local);
|
check_ty(cx, ty, is_local);
|
||||||
@ -351,7 +351,7 @@ enum if you need to distinguish all 3 cases",
|
|||||||
if let Some(ref params) = seg.args {
|
if let Some(ref params) = seg.args {
|
||||||
for ty in params.args.iter().filter_map(|arg| match arg {
|
for ty in params.args.iter().filter_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
}) {
|
}) {
|
||||||
check_ty(cx, ty, is_local);
|
check_ty(cx, ty, is_local);
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@ fn check_ty_rptr(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool, lt:
|
|||||||
if !params.parenthesized;
|
if !params.parenthesized;
|
||||||
if let Some(inner) = params.args.iter().find_map(|arg| match arg {
|
if let Some(inner) = params.args.iter().find_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
then {
|
then {
|
||||||
if is_any_trait(inner) {
|
if is_any_trait(inner) {
|
||||||
@ -2138,7 +2138,7 @@ fn new<'a>(cx: &LateContext<'a, 'tcx>, hir_ty: &hir::Ty) -> Option<Self> {
|
|||||||
.iter()
|
.iter()
|
||||||
.filter_map(|arg| match arg {
|
.filter_map(|arg| match arg {
|
||||||
GenericArg::Type(ty) => Some(ty),
|
GenericArg::Type(ty) => Some(ty),
|
||||||
GenericArg::Lifetime(_) => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let params_len = params.len();
|
let params_len = params.len();
|
||||||
|
@ -181,7 +181,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
|
|||||||
let should_check = if let Some(ref params) = *parameters {
|
let should_check = if let Some(ref params) = *parameters {
|
||||||
!params.parenthesized && !params.args.iter().any(|arg| match arg {
|
!params.parenthesized && !params.args.iter().any(|arg| match arg {
|
||||||
GenericArg::Lifetime(_) => true,
|
GenericArg::Lifetime(_) => true,
|
||||||
GenericArg::Type(_) => false,
|
_ => false,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
|
Loading…
Reference in New Issue
Block a user