summaryrefslogtreecommitdiff
path: root/src/hir_conv/markings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hir_conv/markings.cpp')
-rw-r--r--src/hir_conv/markings.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hir_conv/markings.cpp b/src/hir_conv/markings.cpp
index ca5f7ca7..ed49be52 100644
--- a/src/hir_conv/markings.cpp
+++ b/src/hir_conv/markings.cpp
@@ -21,6 +21,7 @@ class Visitor:
const ::HIR::SimplePath& m_lang_Unsize;
const ::HIR::SimplePath& m_lang_CoerceUnsized;
const ::HIR::SimplePath& m_lang_Deref;
+ const ::HIR::SimplePath& m_lang_Drop;
const ::HIR::SimplePath& m_lang_PhantomData;
public:
Visitor(const ::HIR::Crate& crate):
@@ -28,6 +29,7 @@ public:
m_lang_Unsize( crate.get_lang_item_path_opt("unsize") ),
m_lang_CoerceUnsized( crate.get_lang_item_path_opt("coerce_unsized") ),
m_lang_Deref( crate.get_lang_item_path_opt("deref") ),
+ m_lang_Drop( crate.get_lang_item_path_opt("drop") ),
m_lang_PhantomData( crate.get_lang_item_path_opt("phantom_data") )
{
}
@@ -105,6 +107,11 @@ public:
DEBUG("Type " << impl.m_type << " can Unsize");
ERROR(sp, E0000, "Unsize shouldn't be manually implemented");
}
+ else if( trait_path == m_lang_Drop )
+ {
+ // TODO: Check that there's only one impl, and that it covers the same set as the type.
+ markings.has_drop_impl = true;
+ }
else if( trait_path == m_lang_CoerceUnsized ) {
if( markings_ptr->coerce_unsized_index != ~0u )
ERROR(sp, E0000, "CoerceUnsized can only be implemented once per struct");