diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-08-01 21:48:35 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-08-05 16:37:02 +0200 |
commit | 4d9a4c08a6056cb4d03f7d6250799ec52101090a (patch) | |
tree | eb900fc4442015a6643d96829e8247c2247f2a7e /gcc | |
parent | f52be4bf85a5190ce7a2e456d40cbc94aa63ca89 (diff) | |
download | gcc-4d9a4c08a6056cb4d03f7d6250799ec52101090a.zip gcc-4d9a4c08a6056cb4d03f7d6250799ec52101090a.tar.gz gcc-4d9a4c08a6056cb4d03f7d6250799ec52101090a.tar.bz2 |
gccrs: improve debug logging for unify site
gcc/rust/ChangeLog:
* typecheck/rust-type-util.cc (unify_site_and): improve debug
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-type-util.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/rust/typecheck/rust-type-util.cc b/gcc/rust/typecheck/rust-type-util.cc index 0f14e0a..2d66166 100644 --- a/gcc/rust/typecheck/rust-type-util.cc +++ b/gcc/rust/typecheck/rust-type-util.cc @@ -24,6 +24,7 @@ #include "rust-hir-type-check.h" #include "rust-hir-type-check-type.h" #include "rust-casts.h" +#include "rust-mapping-common.h" #include "rust-unify.h" #include "rust-coercion.h" #include "rust-hir-type-bounds.h" @@ -186,10 +187,12 @@ unify_site_and (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs, TyTy::BaseType *expected = lhs.get_ty (); TyTy::BaseType *expr = rhs.get_ty (); - rust_debug ( - "unify_site_and commit %s infer %s id={%u} expected={%s} expr={%s}", - commit_if_ok ? "true" : "false", implicit_infer_vars ? "true" : "false", id, - expected->debug_str ().c_str (), expr->debug_str ().c_str ()); + rust_debug_loc ( + unify_locus, + "begin unify_site_and commit %s infer %s id={%u} expected={%s} expr={%s}", + commit_if_ok ? "true" : "false", implicit_infer_vars ? "true" : "false", + id == UNKNOWN_HIRID ? 0 : id, expected->debug_str ().c_str (), + expr->debug_str ().c_str ()); std::vector<UnifyRules::CommitSite> commits; std::vector<UnifyRules::InferenceSite> infers; @@ -197,6 +200,15 @@ unify_site_and (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs, = UnifyRules::Resolve (lhs, rhs, unify_locus, false /*commit inline*/, emit_errors, implicit_infer_vars, commits, infers); bool ok = result->get_kind () != TyTy::TypeKind::ERROR; + + rust_debug_loc (unify_locus, + "unify_site_and done ok=%s commit %s infer %s id={%u} " + "expected={%s} expr={%s}", + ok ? "true" : "false", commit_if_ok ? "true" : "false", + implicit_infer_vars ? "true" : "false", + id == UNKNOWN_HIRID ? 0 : id, expected->debug_str ().c_str (), + expr->debug_str ().c_str ()); + if (ok && commit_if_ok) { for (auto &c : commits) |