diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-31 22:22:30 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-31 22:22:30 +0800 |
commit | a3704de1c22d9fcfb4c5744995e43d91b9913c47 (patch) | |
tree | 6846d5fabf54b30116d1c3313d97b0fe767fd86e /src | |
parent | a0435a53a38f59c2d69d7bea6a4628e0e195c850 (diff) | |
download | mrust-a3704de1c22d9fcfb4c5744995e43d91b9913c47.tar.gz |
HIR Typecheck - (minor) Debug output tweaks
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/helpers.cpp | 1 | ||||
-rw-r--r-- | src/hir_typeck/outer.cpp | 2 | ||||
-rw-r--r-- | src/hir_typeck/static.cpp | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index f3d29a46..a4cdccda 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -1583,6 +1583,7 @@ void TraitResolution::expand_associated_types__UfcsKnown(const Span& sp, ::HIR:: // TODO: If the type is a generic or an opaque associated, we can't know. // - If the trait contains any of the above, it's unknowable // - Otherwise, it's an error + DEBUG("Assuming that " << input << " is an opaque name"); e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); DEBUG("Couldn't resolve associated type for " << input << " (and won't ever be able to)"); } diff --git a/src/hir_typeck/outer.cpp b/src/hir_typeck/outer.cpp index cb27ffe5..1ce83e57 100644 --- a/src/hir_typeck/outer.cpp +++ b/src/hir_typeck/outer.cpp @@ -244,6 +244,7 @@ namespace { (UfcsKnown, if( pe.type->m_data.is_Path() && pe.type->m_data.as_Path().binding.is_Opaque() ) { // - Opaque type, opaque result + DEBUG("Inner type opaque, assuming " << ty << " also opaque"); e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); } else if( pe.type->m_data.is_Generic() ) { @@ -265,6 +266,7 @@ namespace { // If the type is still specialisable, and there's geerics in the type. if( best_impl.type_is_specializable(pe.item.c_str()) && pe.type->contains_generics() ) { // Mark it as opaque (because monomorphisation could change things) + DEBUG("Still-specialisable impl for " << ty << " also opaque"); e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); } else { diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp index 85b27ee1..a3bd3b27 100644 --- a/src/hir_typeck/static.cpp +++ b/src/hir_typeck/static.cpp @@ -344,8 +344,8 @@ void StaticTraitResolve::expand_associated_types(const Span& sp, ::HIR::TypeRef& }); if( rv ) { if( assume_opaque ) { - DEBUG("Assuming that " << input << " is an opaque name"); input.m_data.as_Path().binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); + DEBUG("Assuming that " << input << " is an opaque name"); } this->expand_associated_types(sp, input); return; @@ -424,7 +424,7 @@ void StaticTraitResolve::expand_associated_types(const Span& sp, ::HIR::TypeRef& // - If the trait contains any of the above, it's unknowable // - Otherwise, it's an error e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); - DEBUG("Couldn't resolve associated type for " << input << " (and won't ever be able to)"); + DEBUG("Couldn't resolve associated type for " << input << " (and won't ever be able to, assuming opaque)"); //} //else { // DEBUG("Couldn't resolve associated type for " << input << " (will try again later)"); |