Update C++ formatting to clang-format 11

This commit is contained in:
David Tolnay 2021-03-22 15:00:15 -07:00
parent 5d12f1d4c5
commit de01edf706
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
5 changed files with 14 additions and 14 deletions

View File

@ -88,7 +88,7 @@ public:
json(const json &) = default;
json(json &&) = default;
template <typename... T>
json(T &&... value) : value(std::forward<T>(value)...) {}
json(T &&...value) : value(std::forward<T>(value)...) {}
bool isNull() const;
bool isNumber() const;

View File

@ -46,7 +46,7 @@ public:
void push_back(const T &value);
void push_back(T &&value);
template <typename... Args>
void emplace_back(Args &&... args);
void emplace_back(Args &&...args);
class iterator;
iterator begin() noexcept;

View File

@ -316,7 +316,7 @@ public:
void push_back(const T &value);
void push_back(T &&value);
template <typename... Args>
void emplace_back(Args &&... args);
void emplace_back(Args &&...args);
using iterator = typename Slice<T>::iterator;
iterator begin() noexcept;
@ -766,7 +766,7 @@ T &Box<T>::operator*() noexcept {
template <typename T>
template <typename... Fields>
Box<T> Box<T>::in_place(Fields &&... fields) {
Box<T> Box<T>::in_place(Fields &&...fields) {
allocation alloc;
auto ptr = alloc.ptr;
::new (ptr) T{std::forward<Fields>(fields)...};
@ -920,7 +920,7 @@ void Vec<T>::push_back(T &&value) {
template <typename T>
template <typename... Args>
void Vec<T>::emplace_back(Args &&... args) {
void Vec<T>::emplace_back(Args &&...args) {
auto size = this->size();
this->reserve_total(size + 1);
::new (reinterpret_cast<T *>(reinterpret_cast<char *>(this->data()) +

View File

@ -66,7 +66,7 @@ void panic [[noreturn]] (const char *msg) {
#endif
}
template void panic<std::out_of_range>[[noreturn]] (const char *msg);
template void panic<std::out_of_range> [[noreturn]] (const char *msg);
String::String() noexcept { cxxbridge1$string$new(this); }

View File

@ -779,14 +779,14 @@ extern "C" const char *cxx_run_test() noexcept {
bool (rust::String::*cmp)(const rust::String &) const;
bool first_first, first_second, sec_second, second_sec;
for (auto test : {
std::tuple<decltype(cmp), bool, bool, bool, bool>
{&rust::String::operator==, true, false, false, false},
{&rust::String::operator!=, false, true, true, true},
{&rust::String::operator<, false, true, true, false},
{&rust::String::operator<=, true, true, true, false},
{&rust::String::operator>, false, false, false, true},
{&rust::String::operator>=, true, false, false, true},
}) {
std::tuple<decltype(cmp), bool, bool, bool, bool>{
&rust::String::operator==, true, false, false, false},
{&rust::String::operator!=, false, true, true, true},
{&rust::String::operator<, false, true, true, false},
{&rust::String::operator<=, true, true, true, false},
{&rust::String::operator>, false, false, false, true},
{&rust::String::operator>=, true, false, false, true},
}) {
std::tie(cmp, first_first, first_second, sec_second, second_sec) = test;
ASSERT((first.*cmp)(first) == first_first);
ASSERT((first.*cmp)(second) == first_second);