diff options
| author | Taylor Yu <tlyu@mit.edu> | 2021-05-31 19:58:15 -0500 |
|---|---|---|
| committer | Taylor Yu <tlyu@mit.edu> | 2021-06-18 14:16:23 -0500 |
| commit | ce982a35e18e08b81a1524435f390b291f6e32b8 (patch) | |
| tree | 1435413955233129081095b5b1791c2b2e9a3ff6 | |
| parent | e062e5d34ee80e0d5da403e8c5609f29e6a7dbcb (diff) | |
| download | rust-ce982a35e18e08b81a1524435f390b291f6e32b8.tar.gz rust-ce982a35e18e08b81a1524435f390b291f6e32b8.zip | |
debug for suggest_unsized_bound_if_applicable
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 19c3385dd4c..f522e272ecf 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -1763,7 +1763,10 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> { ) => (pred, item_def_id, span), _ => return, }; - + debug!( + "suggest_unsized_bound_if_applicable: pred={:?} item_def_id={:?} span={:?}", + pred, item_def_id, span + ); let node = match ( self.tcx.hir().get_if_local(item_def_id), 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, 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 { if param.span != span || param.bounds.iter().any(|bound| { @@ -1784,6 +1792,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> { { continue; } + debug!("suggest_unsized_bound_if_applicable: param={:?}", param); match node { hir::Node::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 !self.nested { + debug!("FindTypeParam::visit_ty: ty={:?}", ty); self.invalid_spans.push(ty.span); } } |
