rust: fix build on older clang A rustic stock Ubuntu 16.04 clang refused to build the map.insert call in rust_target_generator.cc. Fix by avoiding an explicit std::pair constructor call, and a suspicious std::move on another map's key. Call map.emplace instead, with an explicit StringPiece-to-std::string conversion. Change-Id: Icb3ce534fa509dc7aba6cb5cef93912eb94cbca7 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/5180 Reviewed-by: Julie Hockett <juliehockett@google.com> Reviewed-by: Brett Wilson <brettw@google.com> Commit-Queue: Brett Wilson <brettw@google.com>
diff --git a/tools/gn/rust_target_generator.cc b/tools/gn/rust_target_generator.cc index 1dad154..53d78cc 100644 --- a/tools/gn/rust_target_generator.cc +++ b/tools/gn/rust_target_generator.cc
@@ -189,8 +189,8 @@ return false; // Insert into the aliased_deps map. - target_->rust_values().aliased_deps().insert(std::pair<Label, std::string>( - std::move(dep_label), std::move(pair.first))); + target_->rust_values().aliased_deps().emplace( + std::move(dep_label), pair.first.as_string()); } return true;