debug for suggest_unsized_bound_if_applicable
This commit is contained in:
parent
e062e5d34e
commit
ce982a35e1
1 changed files with 11 additions and 1 deletions
|
@ -1763,7 +1763,10 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
) => (pred, item_def_id, span),
|
) => (pred, item_def_id, span),
|
||||||
_ => return,
|
_ => return,
|
||||||
};
|
};
|
||||||
|
debug!(
|
||||||
|
"suggest_unsized_bound_if_applicable: pred={:?} item_def_id={:?} span={:?}",
|
||||||
|
pred, item_def_id, span
|
||||||
|
);
|
||||||
let node = match (
|
let node = match (
|
||||||
self.tcx.hir().get_if_local(item_def_id),
|
self.tcx.hir().get_if_local(item_def_id),
|
||||||
Some(pred.def_id()) == self.tcx.lang_items().sized_trait(),
|
Some(pred.def_id()) == self.tcx.lang_items().sized_trait(),
|
||||||
|
@ -1775,6 +1778,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
Some(generics) => generics,
|
Some(generics) => generics,
|
||||||
None => return,
|
None => return,
|
||||||
};
|
};
|
||||||
|
debug!("suggest_unsized_bound_if_applicable: generics.params={:?}", generics.params);
|
||||||
|
debug!(
|
||||||
|
"suggest_unsized_bound_if_applicable: generics.where_clause={:?}",
|
||||||
|
generics.where_clause
|
||||||
|
);
|
||||||
for param in generics.params {
|
for param in generics.params {
|
||||||
if param.span != span
|
if param.span != span
|
||||||
|| param.bounds.iter().any(|bound| {
|
|| param.bounds.iter().any(|bound| {
|
||||||
|
@ -1784,6 +1792,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
debug!("suggest_unsized_bound_if_applicable: param={:?}", param);
|
||||||
match node {
|
match node {
|
||||||
hir::Node::Item(
|
hir::Node::Item(
|
||||||
item
|
item
|
||||||
|
@ -1895,6 +1904,7 @@ impl<'v> Visitor<'v> for FindTypeParam {
|
||||||
if path.segments.len() == 1 && path.segments[0].ident.name == self.param =>
|
if path.segments.len() == 1 && path.segments[0].ident.name == self.param =>
|
||||||
{
|
{
|
||||||
if !self.nested {
|
if !self.nested {
|
||||||
|
debug!("FindTypeParam::visit_ty: ty={:?}", ty);
|
||||||
self.invalid_spans.push(ty.span);
|
self.invalid_spans.push(ty.span);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue