summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hir_typeck/helpers.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp
index 2ebdb44d..ebcf0d97 100644
--- a/src/hir_typeck/helpers.cpp
+++ b/src/hir_typeck/helpers.cpp
@@ -1089,6 +1089,14 @@ bool TraitResolution::find_trait_impls(const Span& sp,
const auto& type = this->m_ivars.get_type(ty);
TRACE_FUNCTION_F("trait = " << trait << params << ", type = " << type);
+ if( const auto* te = type.m_data.opt_Infer() )
+ {
+ if( !te->is_lit() ) {
+ // NOTE: Can't hope to find an impl if we know nothing about the type.
+ return false;
+ }
+ }
+
const auto& lang_Sized = this->m_crate.get_lang_item_path(sp, "sized");
const auto& lang_Copy = this->m_crate.get_lang_item_path(sp, "copy");
const auto& lang_Unsize = this->m_crate.get_lang_item_path(sp, "unsize");