diff options
| author | John Hodge <tpg@mutabah.net> | 2018-12-30 07:34:53 +0800 | 
|---|---|---|
| committer | John Hodge <tpg@mutabah.net> | 2018-12-30 07:34:53 +0800 | 
| commit | e0353e87cda89f33c665e05963d6fd7893972063 (patch) | |
| tree | 4878b16c462686d69113a597885926a3242530e3 | |
| parent | aa3e514294a257fb5821533dfbfd02467cf0c9d0 (diff) | |
| download | mrust-e0353e87cda89f33c665e05963d6fd7893972063.tar.gz | |
Typecheck - Don't drop ManuallyDrop
| -rw-r--r-- | src/hir_typeck/static.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp index d40ee811..c9e2bae9 100644 --- a/src/hir_typeck/static.cpp +++ b/src/hir_typeck/static.cpp @@ -1928,6 +1928,12 @@ bool StaticTraitResolve::type_needs_drop_glue(const Span& sp, const ::HIR::TypeR          if( e.binding.is_Opaque() )              return true; +        // In 1.29, "manually_drop" is a struct with special behaviour (instead of being a union) +        if( TARGETVER_1_29 && e.path.m_data.as_Generic().m_path == m_crate.get_lang_item_path_opt("manually_drop") ) +        { +            return false; +        } +          auto pp = ::HIR::PathParams();          bool has_direct_drop = this->find_impl(sp, m_lang_Drop, &pp, ty, [&](auto , bool){ return true; }, true);          if( has_direct_drop ) | 
