Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ce982a3

Browse files
committed
debug for suggest_unsized_bound_if_applicable
1 parent e062e5d commit ce982a3

File tree

1 file changed

+11
-1
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+11
-1
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,10 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
17631763
) => (pred, item_def_id, span),
17641764
_ => return,
17651765
};
1766-
1766+
debug!(
1767+
"suggest_unsized_bound_if_applicable: pred={:?} item_def_id={:?} span={:?}",
1768+
pred, item_def_id, span
1769+
);
17671770
let node = match (
17681771
self.tcx.hir().get_if_local(item_def_id),
17691772
Some(pred.def_id()) == self.tcx.lang_items().sized_trait(),
@@ -1775,6 +1778,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
17751778
Some(generics) => generics,
17761779
None => return,
17771780
};
1781+
debug!("suggest_unsized_bound_if_applicable: generics.params={:?}", generics.params);
1782+
debug!(
1783+
"suggest_unsized_bound_if_applicable: generics.where_clause={:?}",
1784+
generics.where_clause
1785+
);
17781786
for param in generics.params {
17791787
if param.span != span
17801788
|| param.bounds.iter().any(|bound| {
@@ -1784,6 +1792,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
17841792
{
17851793
continue;
17861794
}
1795+
debug!("suggest_unsized_bound_if_applicable: param={:?}", param);
17871796
match node {
17881797
hir::Node::Item(
17891798
item
@@ -1895,6 +1904,7 @@ impl<'v> Visitor<'v> for FindTypeParam {
18951904
if path.segments.len() == 1 && path.segments[0].ident.name == self.param =>
18961905
{
18971906
if !self.nested {
1907+
debug!("FindTypeParam::visit_ty: ty={:?}", ty);
18981908
self.invalid_spans.push(ty.span);
18991909
}
19001910
}

0 commit comments

Comments
 (0)