diff options
author | David Tolnay <dtolnay@gmail.com> | 2023-08-29 15:32:43 -0700 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2023-08-29 15:39:22 -0700 |
commit | 2ff5e37af4b8dcd6a2b743736b4f7b8d2e3f8088 (patch) | |
tree | 22260bc5ded02ead0efec8ce6632384dfd8598c0 /gen | |
parent | 4213e928ffcae9d458fb9ac651edaa7fd25c285d (diff) | |
download | cxx-2ff5e37af4b8dcd6a2b743736b4f7b8d2e3f8088.tar.gz |
Remove unique_ptr from name of std::vector<>::new symbol
Diffstat (limited to 'gen')
-rw-r--r-- | gen/src/write.rs | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/gen/src/write.rs b/gen/src/write.rs index 616f90be..8eef0a76 100644 --- a/gen/src/write.rs +++ b/gen/src/write.rs @@ -1907,6 +1907,15 @@ fn write_cxx_vector(out: &mut OutFile, key: NamedImplKey) { begin_function_definition(out); writeln!( out, + "::std::vector<{}> *cxxbridge1$std$vector${}$new() noexcept {{", + inner, instance, + ); + writeln!(out, " return new ::std::vector<{}>();", inner); + writeln!(out, "}}"); + + begin_function_definition(out); + writeln!( + out, "::std::size_t cxxbridge1$std$vector${}$size(::std::vector<{}> const &s) noexcept {{", instance, inner, ); @@ -1944,20 +1953,6 @@ fn write_cxx_vector(out: &mut OutFile, key: NamedImplKey) { writeln!(out, "}}"); } - let ty = UniquePtr::CxxVector(element); - out.include.memory = true; - write_unique_ptr_common(out, ty); - - let inner = ty.to_typename(out.types); - let instance = ty.to_mangled(out.types); - - begin_function_definition(out); - writeln!( - out, - "{} *cxxbridge1$unique_ptr${}$new() noexcept {{", - inner, instance, - ); - writeln!(out, " return new {}();", inner); - writeln!(out, "}}"); + write_unique_ptr_common(out, UniquePtr::CxxVector(element)); } |