From e1df7ddba0f819b8fb4ce8f3cb9ddf9ad4d6e037 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 27 Dec 2020 02:51:51 -0800 Subject: Eliminate Vec stride symbol in favor of size_of --- src/cxx.cc | 7 +------ src/symbols/rust_vec.rs | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/cxx.cc b/src/cxx.cc index b1715832..e5853b94 100644 --- a/src/cxx.cc +++ b/src/cxx.cc @@ -450,8 +450,7 @@ static_assert(sizeof(std::string) <= kMaxExpectedWordsInString * sizeof(void *), void cxxbridge1$rust_vec$##RUST_TYPE##$reserve_total( \ rust::Vec *ptr, std::size_t cap) noexcept; \ void cxxbridge1$rust_vec$##RUST_TYPE##$set_len(rust::Vec *ptr, \ - std::size_t len) noexcept; \ - std::size_t cxxbridge1$rust_vec$##RUST_TYPE##$stride() noexcept; + std::size_t len) noexcept; #define RUST_VEC_OPS(RUST_TYPE, CXX_TYPE) \ template <> \ @@ -481,10 +480,6 @@ static_assert(sizeof(std::string) <= kMaxExpectedWordsInString * sizeof(void *), template <> \ void Vec::set_len(std::size_t len) noexcept { \ cxxbridge1$rust_vec$##RUST_TYPE##$set_len(this, len); \ - } \ - template <> \ - std::size_t Vec::stride() noexcept { \ - return cxxbridge1$rust_vec$##RUST_TYPE##$stride(); \ } #define SHARED_PTR_OPS(RUST_TYPE, CXX_TYPE) \ diff --git a/src/symbols/rust_vec.rs b/src/symbols/rust_vec.rs index 6aa0b763..60b9cfa5 100644 --- a/src/symbols/rust_vec.rs +++ b/src/symbols/rust_vec.rs @@ -53,12 +53,6 @@ macro_rules! rust_vec_shims { (*this).repr.set_len(len); } } - attr! { - #[export_name = concat!("cxxbridge1$rust_vec$", $segment, "$stride")] - unsafe extern "C" fn __stride() -> usize { - mem::size_of::<$ty>() - } - } }; }; } -- cgit v1.2.3