diff options
author | John Hodge <tpg@mutabah.net> | 2018-12-22 21:07:47 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-12-22 21:07:47 +0800 |
commit | e842fbbc375907b13b69d0f53de6dc3149804c13 (patch) | |
tree | 9deb82dabf9289d077316c6f9aa237cfaaa6fa4a | |
parent | 48c0451b76c6f91ee467d8cac0e0c7fd475c8b46 (diff) | |
download | mrust-e842fbbc375907b13b69d0f53de6dc3149804c13.tar.gz |
Lang items for 1.29 (allocator traits removed, need to do magic)
-rw-r--r-- | src/expand/lang_item.cpp | 5 | ||||
-rw-r--r-- | src/hir/from_ast.cpp | 39 |
2 files changed, 25 insertions, 19 deletions
diff --git a/src/expand/lang_item.cpp b/src/expand/lang_item.cpp index f59d81c3..55bde52f 100644 --- a/src/expand/lang_item.cpp +++ b/src/expand/lang_item.cpp @@ -215,7 +215,10 @@ public: // collections else if( name == "str" ) {} else if( name == "slice" ) {} - else if( TARGETVER_1_29 && name == "slice_u8" ) {} + else if( TARGETVER_1_29 && name == "slice_u8" ) {} // libcore now, `impl [u8]` + else if( TARGETVER_1_29 && name == "slice_alloc" ) {} // liballoc's impls on [T] + else if( TARGETVER_1_29 && name == "slice_u8_alloc" ) {} // liballoc's impls on [u8] + else if( TARGETVER_1_29 && name == "str_alloc" ) {} // liballoc's impls on str // std - interestingly else if( name == "f32" ) {} else if( name == "f64" ) {} diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index 40c872fa..1079e981 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -1932,25 +1932,28 @@ public: } }; // Check for existing defintions of lang items before adding magic ones - if( rv.m_lang_items.count("boxed_trait") == 0 ) + if( TARGETVER_1_19 ) { - rv.m_lang_items.insert(::std::make_pair( ::std::string("boxed_trait"), H::resolve_path(rv, false, {"ops", "Boxed"}) )); - } - if( rv.m_lang_items.count("placer_trait") == 0 ) - { - rv.m_lang_items.insert(::std::make_pair( ::std::string("placer_trait"), H::resolve_path(rv, false, {"ops", "Placer"}) )); - } - if( rv.m_lang_items.count("place_trait") == 0 ) - { - rv.m_lang_items.insert(::std::make_pair( ::std::string("place_trait"), H::resolve_path(rv, false, {"ops", "Place"}) )); - } - if( rv.m_lang_items.count("box_place_trait") == 0 ) - { - rv.m_lang_items.insert(::std::make_pair( ::std::string("box_place_trait"), H::resolve_path(rv, false, {"ops", "BoxPlace"}) )); - } - if( rv.m_lang_items.count("in_place_trait") == 0 ) - { - rv.m_lang_items.insert(::std::make_pair( ::std::string("in_place_trait"), H::resolve_path(rv, false, {"ops", "InPlace"}) )); + if( rv.m_lang_items.count("boxed_trait") == 0 ) + { + rv.m_lang_items.insert(::std::make_pair( ::std::string("boxed_trait"), H::resolve_path(rv, false, {"ops", "Boxed"}) )); + } + if( rv.m_lang_items.count("placer_trait") == 0 ) + { + rv.m_lang_items.insert(::std::make_pair( ::std::string("placer_trait"), H::resolve_path(rv, false, {"ops", "Placer"}) )); + } + if( rv.m_lang_items.count("place_trait") == 0 ) + { + rv.m_lang_items.insert(::std::make_pair( ::std::string("place_trait"), H::resolve_path(rv, false, {"ops", "Place"}) )); + } + if( rv.m_lang_items.count("box_place_trait") == 0 ) + { + rv.m_lang_items.insert(::std::make_pair( ::std::string("box_place_trait"), H::resolve_path(rv, false, {"ops", "BoxPlace"}) )); + } + if( rv.m_lang_items.count("in_place_trait") == 0 ) + { + rv.m_lang_items.insert(::std::make_pair( ::std::string("in_place_trait"), H::resolve_path(rv, false, {"ops", "InPlace"}) )); + } } } |