summaryrefslogtreecommitdiff
path: root/src/trans/enumerate.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-12-29 19:32:45 +0800
committerJohn Hodge <tpg@mutabah.net>2018-12-29 19:32:45 +0800
commit3c81276f5f8e6ba385dbe01d7aee9405a2bac350 (patch)
treeb4333b2e251b8023231bbb40d59f92864c5bf57b /src/trans/enumerate.cpp
parent7c5411ea0aedeabb879efe5654ed0e28039a4b78 (diff)
downloadmrust-3c81276f5f8e6ba385dbe01d7aee9405a2bac350.tar.gz
Typecheck/Trans - Handle magic clone impls for 1.29
Diffstat (limited to 'src/trans/enumerate.cpp')
-rw-r--r--src/trans/enumerate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/trans/enumerate.cpp b/src/trans/enumerate.cpp
index ce3eb53a..a94e302c 100644
--- a/src/trans/enumerate.cpp
+++ b/src/trans/enumerate.cpp
@@ -1376,7 +1376,11 @@ void Trans_Enumerate_FillFrom_Path(EnumState& state, const ::HIR::Path& path, co
// Must have been a dynamic dispatch request, just leave as-is
}
// - <fn(...) as Fn*>::call*
- else if( path_mono.m_data.is_UfcsKnown() && path_mono.m_data.as_UfcsKnown().type->m_data.is_Function() )
+ else if( path_mono.m_data.is_UfcsKnown() && path_mono.m_data.as_UfcsKnown().type->m_data.is_Function() && (
+ path_mono.m_data.as_UfcsKnown().trait.m_path == state.crate.get_lang_item_path_opt("fn")
+ || path_mono.m_data.as_UfcsKnown().trait.m_path == state.crate.get_lang_item_path_opt("fn_mut")
+ || path_mono.m_data.as_UfcsKnown().trait.m_path == state.crate.get_lang_item_path_opt("fn_once")
+ ) )
{
// Must have been a dynamic dispatch request, just leave as-is
}