mozilla/sccache 1590
sccache is ccache with cloud storage
Count lines of LLVM IR per generic function
A tool for ad hoc profiling
Rewrite of breakpad dump_syms tools in Rust
This program post-processes the stack frames produced by `MozFormatCodeAddress()`.
PDF Reader in JavaScript
Clone of https://chromium.googlesource.com/angle/angle with Gecko-specific patches. Talk to vlad, jgilbert, or kamidphish for more info.
Boot to Gecko aims to create a complete, standalone operating system for the open web.
The Rust package manager
push eventnnethercote/nnethercote.github.io
commit sha c199d878acbf0c53f71735e1b3ee4fe89ed0c817
Add bio-poem, and do some tweak file structure tweaks.
push time in 2 days
issue commentron-rs/ron
Build time regression from the Compound type
This is the likely cause of an installer size increase for Firefox when Firefox updated to 0.6.2.
comment created time in 3 days
push eventnnethercote/nnethercote.github.io
commit sha 61efeb98b692e5d0ef8abe538f07cf955674a1d1
Switch back to minima theme.
push time in 4 days
push eventnnethercote/nnethercote.github.io
commit sha 999af403dd383d0a66e8bd6f62948ab76c936870
Set theme jekyll-theme-cayman
push time in 4 days
push eventnnethercote/nnethercote.github.io
commit sha 3620b59f75d338cc4218ac2a907def0245259d04
Add Jury Duty page.
commit sha 927e8223ff8a6943c487cb97411a05911bcce4ce
Ignore `diff` files.
push time in 4 days
pull request commentrust-lang/rust
Issue 72408 nested closures exponential
Can you size the benchmark so that with the fix it's fast (e.g. < 1s to compile) and without the fix it's slow but not ridiculous (e.g. 30s to compile)? We have a few benchmarks like that, for things that used to be quadratic/exponential/whatever.
comment created time in 5 days
issue commentmozilla/uniffi-rs
Technical review for generated Desktop bindings (JS and C++)
I've looked over the three parts of the review packet. Overall it looks good. The C++ proposal is straightforward. The JS proposal is still gnarly but that is unavoidable. I put some additional comments are in the Google Docs and the PR.
comment created time in 5 days
Pull request review commentmozilla/uniffi-rs
Generate Firefox Desktop front-end bindings with WebIDL
+// This file was autogenerated by some hot garbage in the `uniffi` crate.+// Trust me, you don't want to mess with it!++#ifndef mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared+#define mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared++#include <functional>++#include "nsTArray.h"+#include "prnetdb.h"++#include "mozilla/Casting.h"+#include "mozilla/CheckedInt.h"+#include "mozilla/ErrorResult.h"+#include "mozilla/Utf8.h"++#include "mozilla/dom/BindingDeclarations.h"+#include "mozilla/dom/Record.h"+#include "mozilla/dom/{{ ci.namespace()|class_name_webidl }}Binding.h"++extern "C" {++struct RustBuffer {+ int64_t mLen;+ uint8_t* mData;+};++struct RustError {+ int32_t mCode;+ char* mMessage;+};++{% for func in ci.iter_ffi_function_definitions() -%}+{%- match func.return_type() -%}+{%- when Some with (type_) %}+{{ type_|type_ffi }}+{% when None %}+void+{%- endmatch %}+{{ func.name() }}(+ {%- for arg in func.arguments() %}+ {{ arg.type_()|type_ffi }} {{ arg.name() -}}{%- if loop.last -%}{%- else -%},{%- endif -%}+ {%- endfor %}+ {%- if func.has_out_err() -%}{%- if func.arguments().len() > 0 %},{% endif %}+ RustError* out_err+ {%- endif %}+);++{% endfor -%}++} // extern "C"++namespace mozilla {+namespace dom {+// namespace {{ ci.namespace() }} {++// TODO: Rename this to something less conflict-y, and+// make sure `lift_cpp` and `lower_cpp` know about it.+namespace detail {++/// A helper class to read values out of a Rust byte buffer.+class MOZ_STACK_CLASS Reader final {+ public:+ explicit Reader(const RustBuffer& aBuffer) : mBuffer(aBuffer), mOffset(0) {}++ /// Indicates if the offset has reached the end of the buffer.+ bool HasRemaining() {+ return static_cast<int64_t>(mOffset.value()) < mBuffer.mLen;+ }++ /// Helpers to read fixed-width primitive types at the current offset.+ /// Fixed-width integers are read in big endian order.++ uint8_t ReadUInt8() {+ return ReadAt<uint8_t>(+ [this](size_t aOffset) { return mBuffer.mData[aOffset]; });+ }++ int8_t ReadInt8() { return BitwiseCast<int8_t>(ReadUInt8()); }++ uint16_t ReadUInt16() {+ return ReadAt<uint16_t>([this](size_t aOffset) {+ uint16_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint16_t));+ return PR_ntohs(value);+ });+ }++ int16_t ReadInt16() { return BitwiseCast<int16_t>(ReadUInt16()); }++ uint32_t ReadUInt32() {+ return ReadAt<uint32_t>([this](size_t aOffset) {+ uint32_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint32_t));+ return PR_ntohl(value);+ });+ }++ int32_t ReadInt32() { return BitwiseCast<int32_t>(ReadUInt32()); }++ uint64_t ReadUInt64() {+ return ReadAt<uint64_t>([this](size_t aOffset) {+ uint64_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint64_t));+ return PR_ntohll(value);+ });+ }++ int64_t ReadInt64() { return BitwiseCast<int64_t>(ReadUInt64()); }++ float ReadFloat() { return BitwiseCast<float>(ReadUInt32()); }++ double ReadDouble() { return BitwiseCast<double>(ReadUInt64()); }++ /// Reads a length-prefixed UTF-8 encoded string at the current offset. The+ /// closure takes a `Span` pointing to the raw bytes, which it can use to+ /// copy the bytes into an `nsCString` or `nsString`.+ ///+ /// Safety: The closure must copy the span's contents into a new owned string.+ /// It must not hold on to the span, as its contents will be invalidated when+ /// the backing Rust byte buffer is freed. It must not call any other methods+ /// on the reader.+ template <typename T>+ void ReadRawString(+ T& aString,+ const std::function<void(Span<const char>, T& aString)>& aClosure) {+ uint32_t length = ReadInt32();+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += length;+ AssertInBounds(newOffset);+ const char* begin =+ reinterpret_cast<const char*>(&mBuffer.mData[mOffset.value()]);+ aClosure(Span(begin, length), aString);+ mOffset = newOffset;+ }++ private:+ void AssertInBounds(const CheckedInt<size_t>& aNewOffset) const {+ MOZ_RELEASE_ASSERT(aNewOffset.isValid() &&+ static_cast<int64_t>(aNewOffset.value()) <=+ mBuffer.mLen);+ }++ template <typename T>+ T ReadAt(const std::function<T(size_t)>& aClosure) {+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(T);+ AssertInBounds(newOffset);+ T result = aClosure(mOffset.value());+ mOffset = newOffset;+ return result;+ }++ const RustBuffer& mBuffer;+ CheckedInt<size_t> mOffset;+};++class MOZ_STACK_CLASS Writer final {+ public:+ explicit Writer(size_t aCapacity) : mBuffer(aCapacity) {}++ void WriteUInt8(const uint8_t& aValue) {+ WriteAt<uint8_t>(aValue, [this](size_t aOffset, const uint8_t& aValue) {+ mBuffer[aOffset] = aValue;+ });+ }++ void WriteInt8(const int8_t& aValue) {+ WriteUInt8(BitwiseCast<uint8_t>(aValue));+ }++ // This code uses `memcpy` and other eye-twitchy patterns because it+ // originally wrote values directly into a `RustBuffer`, instead of+ // an intermediate `nsTArray`. Once #251 is fixed, we can return to+ // doing that, and remove `ToRustBuffer`.++ void WriteUInt16(const uint16_t& aValue) {+ WriteAt<uint16_t>(aValue, [this](size_t aOffset, const uint16_t& aValue) {+ uint16_t value = PR_htons(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint16_t));+ });+ }++ void WriteInt16(const int16_t& aValue) {+ WriteUInt16(BitwiseCast<uint16_t>(aValue));+ }++ void WriteUInt32(const uint32_t& aValue) {+ WriteAt<uint32_t>(aValue, [this](size_t aOffset, const uint32_t& aValue) {+ uint32_t value = PR_htonl(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint32_t));+ });+ }++ void WriteInt32(const int32_t& aValue) {+ WriteUInt32(BitwiseCast<uint32_t>(aValue));+ }++ void WriteUInt64(const uint64_t& aValue) {+ WriteAt<uint64_t>(aValue, [this](size_t aOffset, const uint64_t& aValue) {+ uint64_t value = PR_htonll(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint64_t));+ });+ }++ void WriteInt64(const int64_t& aValue) {+ WriteUInt64(BitwiseCast<uint64_t>(aValue));+ }++ void WriteFloat(const float& aValue) {+ WriteUInt32(BitwiseCast<uint32_t>(aValue));+ }++ void WriteDouble(const double& aValue) {+ WriteUInt64(BitwiseCast<uint64_t>(aValue));+ }++ /// Writes a length-prefixed UTF-8 encoded string at the current offset. The+ /// closure takes a `Span` pointing to the byte buffer, which it should fill+ /// with bytes and return the actual number of bytes written.+ ///+ /// This function is (more than a little) convoluted. It's written this way+ /// because we want to support UTF-8 and UTF-16 strings. The "size hint" is+ /// the maximum number of bytes that the closure can write. For UTF-8 strings,+ /// this is just the length. For UTF-16 strings, which must be converted to+ /// UTF-8, this can be up to three times the length. Once the closure tells us+ /// how many bytes it's actually written, we can write the length prefix, and+ /// advance the current offset.+ ///+ /// Safety: The closure must copy the string's contents into the span, and+ /// return the exact number of bytes it copied. Returning the wrong count can+ /// either truncate the string, or leave uninitialized memory in the buffer.+ /// The closure must not call any other methods on the writer.+ void WriteRawString(size_t aSizeHint,+ const std::function<size_t(Span<char>)>& aClosure) {+ // First, make sure the buffer is big enough to hold the length prefix.+ // We'll start writing our string directly after the prefix.+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(uint32_t);+ AssertInBounds(newOffset);+ char* begin =+ reinterpret_cast<char*>(&mBuffer.Elements()[newOffset.value()]);++ // Next, ensure the buffer has space for enough bytes up to the size hint.+ // We may write fewer bytes than hinted, but we need to handle the worst+ // case if needed.+ newOffset += aSizeHint;+ AssertInBounds(newOffset);++ // Call the closure to write the bytes directly into the buffer.+ size_t bytesWritten = aClosure(Span(begin, aSizeHint));++ // Great, now we know the real length! Write it at the beginning.+ uint32_t lengthPrefix = PR_htonl(bytesWritten);+ memcpy(&mBuffer.Elements()[mOffset.value()], &lengthPrefix,+ sizeof(uint32_t));++ // And figure out our actual offset.+ newOffset -= aSizeHint;+ newOffset += bytesWritten;+ AssertInBounds(newOffset);+ mOffset = newOffset;+ }++ RustBuffer ToRustBuffer() {+ auto size = static_cast<uint32_t>(mOffset.value());+ auto buffer = {{ ci.ffi_bytebuffer_alloc().name() }}(size);+ memcpy(buffer.mData, mBuffer.Elements(), size);+ return buffer;+ }++ private:+ void AssertInBounds(const CheckedInt<size_t>& aNewOffset) const {+ MOZ_RELEASE_ASSERT(aNewOffset.isValid() &&+ aNewOffset.value() <= mBuffer.Capacity());+ }++ template <typename T>+ void WriteAt(const T& aValue,+ const std::function<void(size_t, const T&)>& aClosure) {+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(T);+ AssertInBounds(newOffset);+ mBuffer.SetLength(newOffset.value());+ aClosure(mOffset.value(), aValue);+ mOffset = newOffset;+ }++ nsTArray<uint8_t> mBuffer;+ CheckedInt<size_t> mOffset;+};++/// A "trait" struct with specializations for types that can be read and+/// written into a byte buffer. This struct is specialized for all serializable+/// types.+template <typename T>+struct Serializable {+ /// Returns the size of the serialized value, in bytes. This is used to+ /// calculate the allocation size for the Rust byte buffer.+ static size_t Size(const T& aValue) = delete;++ /// Reads a value of type `T` from a byte buffer.+ static bool ReadFrom(Reader& aReader, T& aValue) = delete;++ /// Writes a value of type `T` into a byte buffer.+ static void WriteInto(Writer& aWriter, const T& aValue) = delete;+};++/// A "trait" with specializations for types that can be transferred back and+/// forth over the FFI. This is analogous to the Rust trait of the same name.+/// As above, this gives us compile-time type checking for type pairs. If+/// `ViaFfi<T, U>::Lift(U, T)` compiles, we know that a value of type `U` from+/// the FFI can be lifted into a value of type `T`.+template <typename T, typename FfiType>+struct ViaFfi {+ static bool Lift(const FfiType& aLowered, T& aLifted) = delete;+ static FfiType Lower(const T& aLifted) = delete;+};++// This macro generates boilerplate specializations for primitive numeric types+// that are passed directly over the FFI without conversion.+#define UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(Type, readFunc, writeFunc) \+ template <> \+ struct Serializable<Type> { \+ static size_t Size(const Type& aValue) { return sizeof(Type); } \+ static bool ReadFrom(Reader& aReader, Type& aValue) { \+ aValue = aReader.readFunc(); \+ return true; \+ } \+ static void WriteInto(Writer& aWriter, const Type& aValue) { \+ aWriter.writeFunc(aValue); \+ } \+ }; \+ template <> \+ struct ViaFfi<Type, Type> { \+ static bool Lift(const Type& aLowered, Type& aLifted) { \+ aLifted = aLowered; \+ return true; \+ } \+ static Type Lower(const Type& aLifted) { return aLifted; } \+ }++UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(uint8_t, ReadUInt8, WriteUInt8);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(int8_t, ReadInt8, WriteInt8);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(uint16_t, ReadUInt16, WriteUInt16);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(int16_t, ReadInt16, WriteInt16);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(uint32_t, ReadUInt32, WriteUInt32);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(int32_t, ReadInt32, WriteInt32);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(uint64_t, ReadUInt64, WriteUInt64);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(int64_t, ReadInt64, WriteInt64);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(float, ReadFloat, WriteFloat);+UNIFFI_SPECIALIZE_SERIALIZABLE_PRIMITIVE(double, ReadDouble, WriteDouble);++/// Booleans are passed as unsigned integers over the FFI, because JNA doesn't+/// handle `bool`s well.++template <>+struct Serializable<bool> {+ static size_t Size(const bool& aValue) { return 1; }+ static bool ReadFrom(Reader& aReader, bool& aValue) {+ aValue = aReader.ReadUInt8() != 0;+ return true;+ }+ static void WriteInto(Writer& aWriter, const bool& aValue) {+ aWriter.WriteUInt8(aValue ? 1 : 0);+ }+};++template <>+struct ViaFfi<bool, uint8_t> {+ static bool Lift(const uint8_t& aLowered, bool& aLifted) {+ aLifted = aLowered != 0;+ return true;+ }+ static uint8_t Lower(const bool& aLifted) { return aLifted ? 1 : 0; }+};++/// Strings are length-prefixed and UTF-8 encoded when serialized+/// into byte buffers, and are passed as null-terminated, UTF-8+/// encoded `char*` pointers over the FFI.+///+/// Gecko has two string types: `nsCString` for "narrow" strings, and `nsString`+/// for "wide" strings. `nsCString`s don't have a fixed encoding: these can be+/// ASCII, Latin-1, or UTF-8. `nsString`s are always UTF-16. JS prefers+/// `nsString` (UTF-16; also called `DOMString` in WebIDL); `nsCString`s+/// (`ByteString` in WebIDL) are pretty uncommon.+///+/// `nsCString`s can be passed to Rust directly, and copied byte-for-byte into+/// buffers. The UniFFI scaffolding code will ensure they're valid UTF-8. But+/// `nsString`s must be converted to UTF-8 first.++template <>+struct Serializable<nsACString> {+ static size_t Size(const nsACString& aValue) {+ CheckedInt<size_t> size(aValue.Length());+ size += sizeof(uint32_t); // For the length prefix.+ MOZ_RELEASE_ASSERT(size.isValid());+ return size.value();+ }++ static bool ReadFrom(Reader& aReader, nsACString& aValue) {+ aValue.Truncate();
Again: put this in a comment :)
comment created time in 5 days
Pull request review commentmozilla/uniffi-rs
Generate Firefox Desktop front-end bindings with WebIDL
+// This file was autogenerated by some hot garbage in the `uniffi` crate.+// Trust me, you don't want to mess with it!++#ifndef mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared+#define mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared++#include <functional>++#include "nsTArray.h"+#include "prnetdb.h"++#include "mozilla/Casting.h"+#include "mozilla/CheckedInt.h"+#include "mozilla/ErrorResult.h"+#include "mozilla/Utf8.h"++#include "mozilla/dom/BindingDeclarations.h"+#include "mozilla/dom/Record.h"+#include "mozilla/dom/{{ ci.namespace()|class_name_webidl }}Binding.h"++extern "C" {++struct RustBuffer {+ int64_t mLen;+ uint8_t* mData;+};++struct RustError {+ int32_t mCode;+ char* mMessage;+};++{% for func in ci.iter_ffi_function_definitions() -%}+{%- match func.return_type() -%}+{%- when Some with (type_) %}+{{ type_|type_ffi }}+{% when None %}+void+{%- endmatch %}+{{ func.name() }}(+ {%- for arg in func.arguments() %}+ {{ arg.type_()|type_ffi }} {{ arg.name() -}}{%- if loop.last -%}{%- else -%},{%- endif -%}+ {%- endfor %}+ {%- if func.has_out_err() -%}{%- if func.arguments().len() > 0 %},{% endif %}+ RustError* out_err+ {%- endif %}+);++{% endfor -%}++} // extern "C"++namespace mozilla {+namespace dom {+// namespace {{ ci.namespace() }} {++// TODO: Rename this to something less conflict-y, and+// make sure `lift_cpp` and `lower_cpp` know about it.+namespace detail {++/// A helper class to read values out of a Rust byte buffer.+class MOZ_STACK_CLASS Reader final {+ public:+ explicit Reader(const RustBuffer& aBuffer) : mBuffer(aBuffer), mOffset(0) {}++ /// Indicates if the offset has reached the end of the buffer.+ bool HasRemaining() {+ return static_cast<int64_t>(mOffset.value()) < mBuffer.mLen;+ }++ /// Helpers to read fixed-width primitive types at the current offset.+ /// Fixed-width integers are read in big endian order.++ uint8_t ReadUInt8() {+ return ReadAt<uint8_t>(+ [this](size_t aOffset) { return mBuffer.mData[aOffset]; });+ }++ int8_t ReadInt8() { return BitwiseCast<int8_t>(ReadUInt8()); }++ uint16_t ReadUInt16() {+ return ReadAt<uint16_t>([this](size_t aOffset) {+ uint16_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint16_t));+ return PR_ntohs(value);+ });+ }++ int16_t ReadInt16() { return BitwiseCast<int16_t>(ReadUInt16()); }++ uint32_t ReadUInt32() {+ return ReadAt<uint32_t>([this](size_t aOffset) {+ uint32_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint32_t));+ return PR_ntohl(value);+ });+ }++ int32_t ReadInt32() { return BitwiseCast<int32_t>(ReadUInt32()); }++ uint64_t ReadUInt64() {+ return ReadAt<uint64_t>([this](size_t aOffset) {+ uint64_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint64_t));+ return PR_ntohll(value);+ });+ }++ int64_t ReadInt64() { return BitwiseCast<int64_t>(ReadUInt64()); }++ float ReadFloat() { return BitwiseCast<float>(ReadUInt32()); }++ double ReadDouble() { return BitwiseCast<double>(ReadUInt64()); }++ /// Reads a length-prefixed UTF-8 encoded string at the current offset. The+ /// closure takes a `Span` pointing to the raw bytes, which it can use to+ /// copy the bytes into an `nsCString` or `nsString`.+ ///+ /// Safety: The closure must copy the span's contents into a new owned string.+ /// It must not hold on to the span, as its contents will be invalidated when+ /// the backing Rust byte buffer is freed. It must not call any other methods+ /// on the reader.+ template <typename T>+ void ReadRawString(+ T& aString,
This seems like a good comment to put in a comment :)
comment created time in 5 days
Pull request review commentmozilla/uniffi-rs
Generate Firefox Desktop front-end bindings with WebIDL
+// This file was autogenerated by some hot garbage in the `uniffi` crate.+// Trust me, you don't want to mess with it!++#ifndef mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared+#define mozilla_dom_{{ ci.namespace()|class_name_webidl }}_Shared++#include <functional>++#include "nsTArray.h"+#include "prnetdb.h"++#include "mozilla/Casting.h"+#include "mozilla/CheckedInt.h"+#include "mozilla/ErrorResult.h"+#include "mozilla/Utf8.h"++#include "mozilla/dom/BindingDeclarations.h"+#include "mozilla/dom/Record.h"+#include "mozilla/dom/{{ ci.namespace()|class_name_webidl }}Binding.h"++extern "C" {++struct RustBuffer {+ int64_t mLen;+ uint8_t* mData;+};++struct RustError {+ int32_t mCode;+ char* mMessage;+};++{% for func in ci.iter_ffi_function_definitions() -%}+{%- match func.return_type() -%}+{%- when Some with (type_) %}+{{ type_|type_ffi }}+{% when None %}+void+{%- endmatch %}+{{ func.name() }}(+ {%- for arg in func.arguments() %}+ {{ arg.type_()|type_ffi }} {{ arg.name() -}}{%- if loop.last -%}{%- else -%},{%- endif -%}+ {%- endfor %}+ {%- if func.has_out_err() -%}{%- if func.arguments().len() > 0 %},{% endif %}+ RustError* out_err+ {%- endif %}+);++{% endfor -%}++} // extern "C"++namespace mozilla {+namespace dom {+// namespace {{ ci.namespace() }} {++// TODO: Rename this to something less conflict-y, and+// make sure `lift_cpp` and `lower_cpp` know about it.+namespace detail {++/// A helper class to read values out of a Rust byte buffer.+class MOZ_STACK_CLASS Reader final {+ public:+ explicit Reader(const RustBuffer& aBuffer) : mBuffer(aBuffer), mOffset(0) {}++ /// Indicates if the offset has reached the end of the buffer.+ bool HasRemaining() {+ return static_cast<int64_t>(mOffset.value()) < mBuffer.mLen;+ }++ /// Helpers to read fixed-width primitive types at the current offset.+ /// Fixed-width integers are read in big endian order.++ uint8_t ReadUInt8() {+ return ReadAt<uint8_t>(+ [this](size_t aOffset) { return mBuffer.mData[aOffset]; });+ }++ int8_t ReadInt8() { return BitwiseCast<int8_t>(ReadUInt8()); }++ uint16_t ReadUInt16() {+ return ReadAt<uint16_t>([this](size_t aOffset) {+ uint16_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint16_t));+ return PR_ntohs(value);+ });+ }++ int16_t ReadInt16() { return BitwiseCast<int16_t>(ReadUInt16()); }++ uint32_t ReadUInt32() {+ return ReadAt<uint32_t>([this](size_t aOffset) {+ uint32_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint32_t));+ return PR_ntohl(value);+ });+ }++ int32_t ReadInt32() { return BitwiseCast<int32_t>(ReadUInt32()); }++ uint64_t ReadUInt64() {+ return ReadAt<uint64_t>([this](size_t aOffset) {+ uint64_t value;+ memcpy(&value, &mBuffer.mData[aOffset], sizeof(uint64_t));+ return PR_ntohll(value);+ });+ }++ int64_t ReadInt64() { return BitwiseCast<int64_t>(ReadUInt64()); }++ float ReadFloat() { return BitwiseCast<float>(ReadUInt32()); }++ double ReadDouble() { return BitwiseCast<double>(ReadUInt64()); }++ /// Reads a length-prefixed UTF-8 encoded string at the current offset. The+ /// closure takes a `Span` pointing to the raw bytes, which it can use to+ /// copy the bytes into an `nsCString` or `nsString`.+ ///+ /// Safety: The closure must copy the span's contents into a new owned string.+ /// It must not hold on to the span, as its contents will be invalidated when+ /// the backing Rust byte buffer is freed. It must not call any other methods+ /// on the reader.+ template <typename T>+ void ReadRawString(+ T& aString,+ const std::function<void(Span<const char>, T& aString)>& aClosure) {+ uint32_t length = ReadInt32();+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += length;+ AssertInBounds(newOffset);+ const char* begin =+ reinterpret_cast<const char*>(&mBuffer.mData[mOffset.value()]);+ aClosure(Span(begin, length), aString);+ mOffset = newOffset;+ }++ private:+ void AssertInBounds(const CheckedInt<size_t>& aNewOffset) const {+ MOZ_RELEASE_ASSERT(aNewOffset.isValid() &&+ static_cast<int64_t>(aNewOffset.value()) <=+ mBuffer.mLen);+ }++ template <typename T>+ T ReadAt(const std::function<T(size_t)>& aClosure) {+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(T);+ AssertInBounds(newOffset);+ T result = aClosure(mOffset.value());+ mOffset = newOffset;+ return result;+ }++ const RustBuffer& mBuffer;+ CheckedInt<size_t> mOffset;+};++class MOZ_STACK_CLASS Writer final {+ public:+ explicit Writer(size_t aCapacity) : mBuffer(aCapacity) {}++ void WriteUInt8(const uint8_t& aValue) {+ WriteAt<uint8_t>(aValue, [this](size_t aOffset, const uint8_t& aValue) {+ mBuffer[aOffset] = aValue;+ });+ }++ void WriteInt8(const int8_t& aValue) {+ WriteUInt8(BitwiseCast<uint8_t>(aValue));+ }++ // This code uses `memcpy` and other eye-twitchy patterns because it+ // originally wrote values directly into a `RustBuffer`, instead of+ // an intermediate `nsTArray`. Once #251 is fixed, we can return to+ // doing that, and remove `ToRustBuffer`.++ void WriteUInt16(const uint16_t& aValue) {+ WriteAt<uint16_t>(aValue, [this](size_t aOffset, const uint16_t& aValue) {+ uint16_t value = PR_htons(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint16_t));+ });+ }++ void WriteInt16(const int16_t& aValue) {+ WriteUInt16(BitwiseCast<uint16_t>(aValue));+ }++ void WriteUInt32(const uint32_t& aValue) {+ WriteAt<uint32_t>(aValue, [this](size_t aOffset, const uint32_t& aValue) {+ uint32_t value = PR_htonl(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint32_t));+ });+ }++ void WriteInt32(const int32_t& aValue) {+ WriteUInt32(BitwiseCast<uint32_t>(aValue));+ }++ void WriteUInt64(const uint64_t& aValue) {+ WriteAt<uint64_t>(aValue, [this](size_t aOffset, const uint64_t& aValue) {+ uint64_t value = PR_htonll(aValue);+ memcpy(&mBuffer.Elements()[aOffset], &value, sizeof(uint64_t));+ });+ }++ void WriteInt64(const int64_t& aValue) {+ WriteUInt64(BitwiseCast<uint64_t>(aValue));+ }++ void WriteFloat(const float& aValue) {+ WriteUInt32(BitwiseCast<uint32_t>(aValue));+ }++ void WriteDouble(const double& aValue) {+ WriteUInt64(BitwiseCast<uint64_t>(aValue));+ }++ /// Writes a length-prefixed UTF-8 encoded string at the current offset. The+ /// closure takes a `Span` pointing to the byte buffer, which it should fill+ /// with bytes and return the actual number of bytes written.+ ///+ /// This function is (more than a little) convoluted. It's written this way+ /// because we want to support UTF-8 and UTF-16 strings. The "size hint" is+ /// the maximum number of bytes that the closure can write. For UTF-8 strings,+ /// this is just the length. For UTF-16 strings, which must be converted to+ /// UTF-8, this can be up to three times the length. Once the closure tells us+ /// how many bytes it's actually written, we can write the length prefix, and+ /// advance the current offset.+ ///+ /// Safety: The closure must copy the string's contents into the span, and+ /// return the exact number of bytes it copied. Returning the wrong count can+ /// either truncate the string, or leave uninitialized memory in the buffer.+ /// The closure must not call any other methods on the writer.+ void WriteRawString(size_t aSizeHint,+ const std::function<size_t(Span<char>)>& aClosure) {+ // First, make sure the buffer is big enough to hold the length prefix.+ // We'll start writing our string directly after the prefix.+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(uint32_t);+ AssertInBounds(newOffset);+ char* begin =+ reinterpret_cast<char*>(&mBuffer.Elements()[newOffset.value()]);++ // Next, ensure the buffer has space for enough bytes up to the size hint.+ // We may write fewer bytes than hinted, but we need to handle the worst+ // case if needed.+ newOffset += aSizeHint;+ AssertInBounds(newOffset);++ // Call the closure to write the bytes directly into the buffer.+ size_t bytesWritten = aClosure(Span(begin, aSizeHint));++ // Great, now we know the real length! Write it at the beginning.+ uint32_t lengthPrefix = PR_htonl(bytesWritten);+ memcpy(&mBuffer.Elements()[mOffset.value()], &lengthPrefix,+ sizeof(uint32_t));++ // And figure out our actual offset.+ newOffset -= aSizeHint;+ newOffset += bytesWritten;+ AssertInBounds(newOffset);+ mOffset = newOffset;+ }++ RustBuffer ToRustBuffer() {+ auto size = static_cast<uint32_t>(mOffset.value());+ auto buffer = {{ ci.ffi_bytebuffer_alloc().name() }}(size);+ memcpy(buffer.mData, mBuffer.Elements(), size);+ return buffer;+ }++ private:+ void AssertInBounds(const CheckedInt<size_t>& aNewOffset) const {+ MOZ_RELEASE_ASSERT(aNewOffset.isValid() &&+ aNewOffset.value() <= mBuffer.Capacity());+ }++ template <typename T>+ void WriteAt(const T& aValue,+ const std::function<void(size_t, const T&)>& aClosure) {+ CheckedInt<size_t> newOffset = mOffset;+ newOffset += sizeof(T);+ AssertInBounds(newOffset);+ mBuffer.SetLength(newOffset.value());+ aClosure(mOffset.value(), aValue);+ mOffset = newOffset;+ }++ nsTArray<uint8_t> mBuffer;+ CheckedInt<size_t> mOffset;+};++/// A "trait" struct with specializations for types that can be read and+/// written into a byte buffer. This struct is specialized for all serializable+/// types.+template <typename T>+struct Serializable {+ /// Returns the size of the serialized value, in bytes. This is used to+ /// calculate the allocation size for the Rust byte buffer.+ static size_t Size(const T& aValue) = delete;++ /// Reads a value of type `T` from a byte buffer.+ static bool ReadFrom(Reader& aReader, T& aValue) = delete;++ /// Writes a value of type `T` into a byte buffer.+ static void WriteInto(Writer& aWriter, const T& aValue) = delete;+};++/// A "trait" with specializations for types that can be transferred back and+/// forth over the FFI. This is analogous to the Rust trait of the same name.+/// As above, this gives us compile-time type checking for type pairs. If+/// `ViaFfi<T, U>::Lift(U, T)` compiles, we know that a value of type `U` from+/// the FFI can be lifted into a value of type `T`.+template <typename T, typename FfiType>+struct ViaFfi {+ static bool Lift(const FfiType& aLowered, T& aLifted) = delete;+ static FfiType Lower(const T& aLifted) = delete;
Another good thing to put in a comment.
comment created time in 5 days
push eventnnethercote/nnethercote.github.io
commit sha e1c6fe0a3c005caf1c8b0b9a4afe3746b11415a5
Create a simple home page and a publications page.
push time in 5 days
push eventnnethercote/counts
commit sha 1ceede0bfc93fe2d89119244975690ca87cc0be6
Allow for a different no-such-file error message on Windows.
push time in 7 days
push eventnnethercote/counts
commit sha 30c11c65817defd049a0f02bad22af0630328fb4
Bump version to 0.1.2, in anticipation of the next release.
commit sha 444ddfd22786417454bd30ace27e1b1ed93d6274
Add some basic integration testing.
push time in 7 days
issue closednnethercote/counts
When ready, please publish this on crates.io for easy installation.
Thanks for making this utility! 😁
closed time in 7 days
jryansissue commentnnethercote/counts
https://crates.io/crates/counts now exists!
comment created time in 7 days
push eventnnethercote/counts
commit sha 75e383a4226762b08baf8e633797252637daaf6d
Bump to v0.1.1.
push time in 7 days
push eventnnethercote/counts
commit sha 2208f7abf5035a0ea793ac03d852caaef9afa5ef
Improve the docs.
push time in 7 days
push eventnnethercote/counts
commit sha dcae80bcc292d9ce5127139e01db8dcfc3f847ec
Prepare for release.
push time in 7 days
push eventnnethercote/counts
commit sha 79799e07986652ff9329ded2a8d16dc89ee5722e
Run `cargo fmt`.
commit sha faf19be82ce78870ab477754a8d311528342026d
Satisfy Clippy.
commit sha 3deee83c2a2f7fe54fe03b1ef5ea4c0a8cef2afc
Add basic CI.
push time in 7 days
pull request commentnnethercote/counts
Added link to corresponding blog post
Thanks for the PR. I won't merge it, because I think that if a link to the blog post is necessary, it shows that the docs are poor.
I had thought that the docs and the PR had exactly the same information, but I checked and saw that the blog post has some details that would be useful in the docs. So I have pushed some commits that add those details to the docs. In other words, your PR led to improvements in the docs, even though it didn't land. Thanks again.
comment created time in 7 days
push eventnnethercote/counts
commit sha ddfe52355baa35377a0109c8803a0ff5d57bb1c0
Minor README formatting fixes.
push time in 7 days
push eventnnethercote/counts
commit sha 67179b8b5c0d252d8aabc16d5892a4ef43be14e9
Put more stuff from the blog post in the README.
push time in 7 days
push eventnnethercote/uniffi-rs
commit sha 192455331ec3949a4975936910679f797fd354b2
Small improvements to `README.md` files. In particular, remove two example `README.md` files that were overlooked in #264, and add `rondpoint` to the list of examples.
commit sha 8b382804ce1a75b3c9eb21f4cdf85d2e3bbc0f67
Merge pull request #267 from nnethercote/improve-docs Improve docs
push time in 11 days
push eventnnethercote/uniffi-rs
commit sha 548869bf5bc75377e91585862b7138999d72d30a
First pass at writing a User Guide
commit sha fef76688b68a79c44d0f5489afa7cdda4f77cc9b
Merge pull request #260 from mozilla/user-manual Uniffi user manual
commit sha 65e9512fa0766eb515036d1961263eef886700e4
Make diagram non-transparent
commit sha 24f9aa848de9af446fb18bc64701cdfce87ce373
Consolidate examples READMEs
commit sha 55160b6e566323a9c3e885bb66a6d4316e4eb249
Merge pull request #264 from mozilla/consolidate-examples-readme Consolidate examples READMEs
commit sha 2e3353a29955186f77e608ac70184cc9c39d4454
Add user manual link
commit sha 192455331ec3949a4975936910679f797fd354b2
Small improvements to `README.md` files. In particular, remove two example `README.md` files that were overlooked in #264, and add `rondpoint` to the list of examples.
push time in 11 days
push eventnnethercote/uniffi-rs
commit sha 548869bf5bc75377e91585862b7138999d72d30a
First pass at writing a User Guide
commit sha fef76688b68a79c44d0f5489afa7cdda4f77cc9b
Merge pull request #260 from mozilla/user-manual Uniffi user manual
commit sha 65e9512fa0766eb515036d1961263eef886700e4
Make diagram non-transparent
commit sha 24f9aa848de9af446fb18bc64701cdfce87ce373
Consolidate examples READMEs
commit sha 55160b6e566323a9c3e885bb66a6d4316e4eb249
Merge pull request #264 from mozilla/consolidate-examples-readme Consolidate examples READMEs
commit sha 2e3353a29955186f77e608ac70184cc9c39d4454
Add user manual link
push time in 11 days
PR opened mozilla/uniffi-rs
Some minor docs improvements for things I noticed when first looking at uniffi-rs.
pr created time in 11 days
issue closedmozilla/fix-stacks
#16 introduces Breakpad symbol support, but requires that a fileid executable from the Firefox build be provided. It's used to choose between symbol files when a binary has multiple symbol files. It would be better if fix-stacks could do fileid's job itself.
https://searchfox.org/mozilla-central/source/testing/tools/fileid has the code for fileid.
closed time in 11 days
nnethercotePull request review commentmozilla/uniffi-rs
+add_task(async function test_rondpoint() {
What is add_task? I can see it used in this file, but I can't see it anywhere else.
comment created time in 11 days
a multi-language bindings generator for rust
fork in 13 days
PR opened rust-lang/rust
This is based on an idea from @oli-obk. The code is incomplete for the moment, and I won't have time to work on it further, but somebody else might be interested in taking it over.
Pros:
&stris nicer to work with thanSymbolStr, e.g. avoids the need for some&and&*occurrences.- It would be nice to eliminate
SymbolStr. - It avoids the lie that
SymbolStrstrings have astaticlifetime, replacing it with a smaller lie that the strings have a lifetime tied to the lifetime of the inputSymbol.
Cons:
- That lifetime is still a lie, and it's possible to cause crashes with this.
- The lie is less obvious in a vanilla
&strthan it is within aSymbolStr. - We can't mark
&stras!Sendand!Sync. - I haven't yet eliminated
SymbolStrentirely. Theto_stable_hash_key()is the hardest case.
I'm totally ambivalent about whether this should land, but it seemed worth putting up here for others to look at.
r? @ghost
pr created time in 13 days
pull request commentron-rs/ron
Speed up parsing with table-driven predicates.
It seems pretty common for people to just release off trunk.
comment created time in 14 days
push eventnnethercote/rust
commit sha 2f96ce89d03b248c269513b011d328bff2c8dc21
Stabilize deque_make_contiguous Closes #70929.
commit sha f3d7645fb79d641de447d4af02d5f3cee91b4af3
Add trailing comma support to matches macro
commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e
Add `slice::check_range`
commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17
Fix links
commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42
Fix links again
commit sha 1316c786a08344c965a97b1b67c76a300a479eec
Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7. The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace. Since it returns ENOSYS in some cases anyway this will trip the HAS_COPY_FILE_RANGE detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs https://bugzilla.redhat.com/show_bug.cgi?id=1783554
commit sha f0783632d315db90c0ca34d79d56207d132f3764
more concise error matching
commit sha 6b0d44e92a529962792d3a5f1e7b44b6e3c6ed05
Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Possible because of #49146 (Allow `if` and `match` in constants).
commit sha 4ddedd521418d67e845ecb43dc02c09b0af53022
perform copy_file_range until EOF is reached instead of basing things on file size This solves several problems - race conditions where a file is truncated while copying from it. if we blindly trusted the file size this would lead to an infinite loop - proc files appearing empty to copy_file_range but not to read/write https://github.com/coreutils/coreutils/commit/4b04a0c - copy_file_range returning 0 for some filesystems (overlay? bind mounts?) inside docker, again leading to an infinite loop
commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46
Replace ad hoc implementations with `slice::check_range`
commit sha 18ad5a594ec4ee039897eb03d90dfeb117b4c6d6
Add a regression test for issue-72793
commit sha e5f9d7ff92f62cde3ef1b7301ac4ac3adab990d9
BTreeMap: introduce marker::ValMut and reserve marker::Mut for unique access
commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487
Add more information to safety comment
commit sha acd396225e0228f297474524396e08e0f594347e
Fix typo in release notes
commit sha d39cc45cf251be63f3066c6002d409274aa9d2a4
Added a lot of min_const_generics revisions
commit sha d89d2a972d3174504594ff2eba70423dacaddcfb
Added more min_const_generics revisions to tests
commit sha 7a7a28d6bbfa6bbbbd3c4d65a11e9b33995cd63f
Fixed file formatting and made `tidy` happy
commit sha aa40c028fcb20a47fb214fea2899ff9a8ae88840
Unstable Book: add links to tracking issues for FFI features
commit sha 294c1160bb693a77ad2683321b9196352bd837dc
Improve docs for the `const` keyword
commit sha f03d0b38d6a33a64307d83f8ddd3df8ef57ca537
`impl Rc::new_cyclic`
push time in 14 days
pull request commentron-rs/ron
Speed up parsing with table-driven predicates.
Is that a non-standard release model? I admit I don't exactly follow the steps required in your description.
I was previously confused as to why the current Cargo.toml on master says 0.6.0 when the current release on crates.io is 0.6.1. Perhaps this non-standard release model explains that?
comment created time in 14 days
pull request commentmozilla/fix-stacks
Test PR to see if CI is working
I found this, which says:
GitHub Actions allow automation to be initiated by various repository events. However, GitHub Actions are only enabled on "modern" accounts. Many of the Mozilla orgs are "legacy" accounts (including 'mozilla'), so GitHub actions are not always available.
comment created time in 18 days
PR closed mozilla/fix-stacks
To see if #34 fixed things.
pr closed time in 18 days
pull request commentmozilla/fix-stacks
Test PR to see if CI is working
No CI actions. And https://github.com/mozilla/fix-stacks/ doesn't have an "Actions" tab, but https://github.com/nnethercote/fix-stacks/ does, and the CI jobs run on my branch. Weird.
comment created time in 18 days
push eventnnethercote/fix-stacks
push time in 18 days
push eventnnethercote/fix-stacks
commit sha a3dfd48132204879aa34c619e7a2f67bdb111b98
Another trivial commit, this time to a source code file.
push time in 18 days
push eventnnethercote/ron
commit sha 2f44ef874ade401af75d3fa5d0bc331aeafe98e9
Speed up parsing with table-driven predicates. (#276) When loading a capture in wrench, startup time is dominated by RON parsing, and most of that time is spent in simple byte predicates such as "is this a whitespace byte?" These predicates currently use `slice::contains` to search through a list of possible matching bytes. The list lengths range from 4 to 63. This commit changes these predicates to use a table. Each predicate is now just an array lookup plus a bit mask. This more than doubles the parsing speed for the wrench capture I have been looking at.
commit sha 4815232ee044673f157c875eaabbc5c89a0717bb
Fix bors signaling
push time in 18 days
pull request commentron-rs/ron
Speed up parsing with table-driven predicates.
This needs to make it into a RON release and then WebRender needs to be updated to use it, of course :)
comment created time in 18 days
pull request commentron-rs/ron
Speed up parsing with table-driven predicates.
Here's a partial Cachegrind profile before, showing instruction counts:
--------------------------------------------------------------------------------
Ir
--------------------------------------------------------------------------------
1,791,647,600 (100.0%) PROGRAM TOTALS
--------------------------------------------------------------------------------
Ir file:function
--------------------------------------------------------------------------------
250,463,413 (13.98%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd//src/libcore/slice/mod.rs:<i8 as core::slice::SliceContains>::slice_contains
205,357,185 (11.46%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd//src/libcore/slice/memchr.rs:<i8 as core::slice::SliceContains>::slice_contains
183,977,818 (10.27%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd//src/libcore/iter/traits/iterator.rs:<i8 as core::slice::SliceContains>::slice_cont
ains
180,738,660 (10.09%) ???:???
128,940,782 ( 7.20%) /home/njn/moz/ron/src/parse.rs:ron::parse::Bytes::skip_ws
94,233,937 ( 5.26%) /build/glibc-YYA7BZ/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms
55,896,204 ( 3.12%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/slice/mod.rs:ron::parse::Bytes::skip_ws
46,453,884 ( 2.59%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd//src/libcore/ptr/mod.rs:<i8 as core::slice::SliceContains>::slice_contains
And after:
--------------------------------------------------------------------------------
Ir
--------------------------------------------------------------------------------
957,105,658 (100.0%) PROGRAM TOTALS
--------------------------------------------------------------------------------
Ir file:function
--------------------------------------------------------------------------------
180,319,309 (18.84%) ???:???
123,210,617 (12.87%) /home/njn/moz/ron/src/parse.rs:ron::parse::Bytes::skip_ws
93,937,965 ( 9.81%) /build/glibc-YYA7BZ/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms
40,092,835 ( 4.19%) ???:llvm::PMTopLevelManager::setLastUser(llvm::ArrayRef<llvm::Pass*>, llvm::Pass*)
24,953,670 ( 2.61%) /home/njn/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-deque-0.7.3/src/lib.rs:crossbeam_deque::Stealer<T>::steal
22,326,638 ( 2.33%) /build/glibc-YYA7BZ/glibc-2.31/elf/dl-lookup.c:do_lookup_x
20,365,249 ( 2.13%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/option.rs:ron::parse::Bytes::skip_ws
19,668,728 ( 2.06%) /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd//src/libcore/str/mod.rs:core::str::from_utf8
I only measured release builds, but this is a simple enough change that I am confident that it would be a significant win on debug builds too.
comment created time in 18 days
push eventnnethercote/fix-stacks
commit sha f6d3c57f67247aeeb25110333ea40c0f9ef7b00f
Stop using an external fileid program The symbolic-debuginfo crate has everything required to replace it already. At the same time, look for breakpad symbols in the directory they're supposed to be based on their fileid, rather than assuming that if there's only one subdirectory, it's the right one. This means breakpad syms directories for tests need to be adjusted, which they are by taking the id as appearing on the MODULE line in the sym file. This validates that obj.debug_id().breakpad() returns the expected value. Also change the instructions to generate the breakpad symbols for examples, using https://github.com/mozilla/dump_syms, which simplifies things, albeit modifies the linux example file.
commit sha 1068a56149850e85043b4df34e6143f1d505b221
Trigger workflows independently of the branch
commit sha 766b4ec00303af6ed09091c23d6811a6b9578c9e
Merge pull request #34 from glandium/workflow Trigger workflows independently of the branch
commit sha 03a325aa0c5fc479dce135415cb8e16371495290
Merge pull request #33 from glandium/fileid Stop using an external fileid program
push time in 19 days
push eventmozilla/fix-stacks
commit sha f6d3c57f67247aeeb25110333ea40c0f9ef7b00f
Stop using an external fileid program The symbolic-debuginfo crate has everything required to replace it already. At the same time, look for breakpad symbols in the directory they're supposed to be based on their fileid, rather than assuming that if there's only one subdirectory, it's the right one. This means breakpad syms directories for tests need to be adjusted, which they are by taking the id as appearing on the MODULE line in the sym file. This validates that obj.debug_id().breakpad() returns the expected value. Also change the instructions to generate the breakpad symbols for examples, using https://github.com/mozilla/dump_syms, which simplifies things, albeit modifies the linux example file.
commit sha 03a325aa0c5fc479dce135415cb8e16371495290
Merge pull request #33 from glandium/fileid Stop using an external fileid program
push time in 19 days
PR merged mozilla/fix-stacks
The symbolic-debuginfo crate has everything required to replace it already.
At the same time, look for breakpad symbols in the directory they're supposed to be based on their fileid, rather than assuming that if there's only one subdirectory, it's the right one. This means breakpad syms directories for tests need to be adjusted, which they are by taking the id as appearing on the MODULE line in the sym file. This validates that obj.debug_id().breakpad() returns the expected value.
pr closed time in 19 days
push eventmozilla/fix-stacks
commit sha 1068a56149850e85043b4df34e6143f1d505b221
Trigger workflows independently of the branch
commit sha 766b4ec00303af6ed09091c23d6811a6b9578c9e
Merge pull request #34 from glandium/workflow Trigger workflows independently of the branch
push time in 19 days
Pull request review commentmozilla/fix-stacks
Stop using an external fileid program
impl Fixer { db_dir.push(&syms_dir); db_dir.push(&db_seg); - // - Unix: `db_entries` iterates over `syms/libxul.so/`- // - Windows: `db_entries` iterates over `syms/xul.pdb/`- let mut db_entries = fs::read_dir(&db_dir)- .context(- "note: this is expected and harmless for system libraries on debug automation runs",
This is a useful error message on automation and I would like to preserve it. I think it needs to be moved to the fs::read(&sym_file) call below.
(While you're there, can you change the "read symbols file" on that error message to "read breakpad symbols file", for consistency with the other error messages in this function. Thanks.)
comment created time in 19 days
push eventnnethercote/rustc-perf
commit sha 9ac9b92e94b4a810144637ab3396b96469453630
Do not run final rustc without a processor This avoids waiting for the rustc to build and then throwing away the results; dependencies will be cached in subsequent runs but this rustc will be thrown away anyway.
commit sha 7b71ccf17b7cd4a558bb05988c202dead36ca77c
Merge pull request #731 from Mark-Simulacrum/speed Skip building final rustc in preparatory steps
commit sha 54cb486458b0e72520a2bcf3826498ec38e3c4c5
Benchmark oldest commits first This means that we have less cases of "straggler" holes being left behind. It can still happen, due to try parents being prioritized above anything else, but should be much rarer.
commit sha dacc640da3b52dfb2b3cf984dc3670103cc77fe0
Refactor missing_commits
commit sha ef5edaa129e49b02b114797cad4e2b7964ed5d6c
Link to PR of try builds
commit sha 005f40084da2e5d923d196df49986c86d999e72a
Merge pull request #732 from Mark-Simulacrum/order-revamp Benchmark oldest commits first
commit sha 87a15623742497da6553ebf0c4bc8af18f68496b
Fix typo
commit sha d8e1f0e3f0ed808f77d59aaab2ca8bb83cb49e18
Clean up stringify for reason Try builds no longer get mangled into [object Object]
commit sha a7e8e02e78e5ebee9be0dd9bbf5072f97515b079
Remove unused variable
commit sha f0603c418bed2132aad24447135de99a17eebe35
Prepare build kinds in parallel rustc is single threaded for a good portion of its compilation, and that means that on many-core systems we're frequently only using one CPU core even during preparation (where we don't care about noise). This builds all builds kinds in parallel -- spawning N Cargos. We arrange for a jobserver to be passed to all Cargos involved to make sure that we're not overloading the system with too many processes.
commit sha 55772d77d7f7bb6f08b06740749a3a41386203a9
Reshuffle CI jobs a bit In theory, the parallel building should allow a more compact arrangement at a lower loss. This might not be the case on the relatively limited CI builders we're using, though.
commit sha baca236f5b9751de7383fb562d4d5779d4c2d8d8
Merge pull request #733 from Mark-Simulacrum/prep-in-parallel Prepare build kinds in parallel
commit sha 39b8d7bb15f1c2b3e68c2aa52d2daf33c19dc4ff
Properly display HTML reasons
commit sha a7c9f34e450823e37b5dc8188085b94b07c8b881
Support fetching rustc path from rustup
commit sha 139bdc69f8fdfb4505c93331cec7661aa1d825d0
Skip aborts on rustc version detection
commit sha 8adf825864fa2cb15d4dab12eb656141fa86eec2
Merge pull request #734 from Mark-Simulacrum/rustc-toolchain Support fetching rustc path from rustup
commit sha 7c6e647797fc41412d35396226514ce5f91ca4fc
Remove PR patch from script-servo This patch adds a significant chunk of time to our longest benchmark, and doesn't add too much value in practice.
commit sha 9b6aa5dbe8037078486884942918b666ede8eebe
Merge pull request #735 from Mark-Simulacrum/delete-script-patch Remove PR patch from script-servo
commit sha 705beb7361d543384737d7a041095f67ac646286
Remove sleep on collection end This just wastes 30 seconds of time for essentially no gain.
commit sha fb1fb8b1585e272d0c2ab1eeb61cc138c7291ff3
Do not rerun doc builds We're not currently enabling self-profile for doc builds, and this makes use of that to avoid a (potentially quite costly) second doc build.
push time in 20 days
PR closed rust-lang/rust
The idea here is to encode symbols that are 4 bytes or shorter directly in the u32, and only use the hash table for longer symbols. Avoiding the hash table accesses should speed things up.
r? @ghost
pr closed time in 20 days
pull request commentrust-lang/rust
Sounds plausible. I think we can close this.
comment created time in 20 days
PR opened rust-lang/rustc-perf
Due to changes at Mozilla, unfortunately I won't be able to spend time on rustc perf triage any more.
pr created time in 20 days
push eventnnethercote/rustc-perf
commit sha 058372d08b06a6ebcec8cc3e3c69ad5a5c531f33
Remove njn from the triage roster.
push time in 20 days
pull request commentrust-lang/rust
The latest perf results are much worse -- small wins on doc builds, little change elsewhere. Not sure why. As it stands, definitely not worth the extra complexity.
comment created time in 20 days
push eventnnethercote/ron
commit sha 27d69895a25b0a4c1258b2c6819778bf4c47ee74
Speed up parsing with table-driven predicates. When loading a capture in wrench, startup time is dominated by RON parsing, and most of that time is spent in simple byte predicates such as "is this a whitespace byte?" These predicates currently use `slice::contains` to search through a list of possible matching bytes. The list lengths range from 4 to 63. This commit changes these predicates to use a table. Each predicate is now just an array lookup plus a bit mask. This more than doubles the parsing speed for the wrench capture I have been looking at.
push time in 21 days
PR opened ron-rs/ron
When loading a capture in wrench, startup time is dominated by RON parsing, and most of that time is spent in simple byte predicates such as "is this a whitespace byte?"
These predicates currently use slice::contains to search through a
list of possible matching bytes. The list lengths range from 4 to 63.
This commit changes these predicates to use a table. Each predicate is now just an array lookup plus a bit mask. This more than doubles the parsing speed for the wrench capture I have been looking at.
pr created time in 21 days
pull request commentrust-lang/rust
@petrochenkov: I have incorporated your commits from #75309.
@bors try @rust-timer queue
comment created time in 21 days
push eventnnethercote/rust
commit sha 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6
Hexagon libstd: update type defs
commit sha 2d1515a2c532b0cceec4a14da6f21e48fdca2da5
Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
commit sha 5f7436b5fd27e534b2800389067b169cbe7864b7
Be consistent when describing a move as a 'partial' in diagnostics When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.
commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926
Improve rendering of crate features via doc(cfg)
commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60
Render longhand multiple crate/target features nicer
commit sha a77e881ec9f324cdc544150f897d8b34281f92e4
should_impl_trait - ignore methods with lifetime params
commit sha 2bc0ecd44b4d09476eade641e02451d949a1c8e2
should_implement_trait - add test cases for every checked trait method
commit sha e6b2254f9e55743dbace44cc73c6447b6bda58e5
should_implement_trait - pr remarks
commit sha 7cc1a2ed879e45605a53b802cfa5291c9a51284c
should_implement_trait - filter on explicit lifetime param only
commit sha 166c520e9a8b1a45819255e75dee737136aa6ec8
should_impl_trait - pr comments
commit sha f9ba829f6701ae03a5c226044dbbde13ce87e123
should_impl_trait - self linting
commit sha 57572cf8096ccb332370f7a711641a061bfd7434
Call into fastfail on abort in libpanic_abort on Windows x86(_64)
commit sha 3e3e50bf0fa6282c7265e34589170033c2301edd
Add example of false positive to PTR_ARG docs. Fixes #214
commit sha fbf637d12c95528846bfa65ce67bd652f2affb43
formatting
commit sha 6778baf516cf00d6ba2d3f448aa312b4ac2e43b5
Fix up docs
commit sha b9b8b5c96b60789b6b7846a4036d3cbf2d393014
Reverse formatting
commit sha 91aa55d891e029831e2eceb662184afc8d2e0415
Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
commit sha b8713e3854cb90b974eceaa1d50484831591619c
unnecessary-mut-passed: make lint message say if fn is a function or a method.
commit sha 3337f7956cf6100c9e5acfd72d42ec312efb6a7f
Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995 unnecessary-mut-passed: make lint message say if fn is a function or a method changelog: refine "unnecessary-mut-passed" lint message
commit sha c0a9d64818d7076b72fd6c3a9e6172eca659034b
stable-sort-primitive: make lint adhere to lint message convention
push time in 21 days
push eventnnethercote/rust
commit sha 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6
Hexagon libstd: update type defs
commit sha 2d1515a2c532b0cceec4a14da6f21e48fdca2da5
Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
commit sha 5f7436b5fd27e534b2800389067b169cbe7864b7
Be consistent when describing a move as a 'partial' in diagnostics When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.
commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926
Improve rendering of crate features via doc(cfg)
commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60
Render longhand multiple crate/target features nicer
commit sha a77e881ec9f324cdc544150f897d8b34281f92e4
should_impl_trait - ignore methods with lifetime params
commit sha 2bc0ecd44b4d09476eade641e02451d949a1c8e2
should_implement_trait - add test cases for every checked trait method
commit sha e6b2254f9e55743dbace44cc73c6447b6bda58e5
should_implement_trait - pr remarks
commit sha 7cc1a2ed879e45605a53b802cfa5291c9a51284c
should_implement_trait - filter on explicit lifetime param only
commit sha 166c520e9a8b1a45819255e75dee737136aa6ec8
should_impl_trait - pr comments
commit sha f9ba829f6701ae03a5c226044dbbde13ce87e123
should_impl_trait - self linting
commit sha 57572cf8096ccb332370f7a711641a061bfd7434
Call into fastfail on abort in libpanic_abort on Windows x86(_64)
commit sha 3e3e50bf0fa6282c7265e34589170033c2301edd
Add example of false positive to PTR_ARG docs. Fixes #214
commit sha fbf637d12c95528846bfa65ce67bd652f2affb43
formatting
commit sha 6778baf516cf00d6ba2d3f448aa312b4ac2e43b5
Fix up docs
commit sha b9b8b5c96b60789b6b7846a4036d3cbf2d393014
Reverse formatting
commit sha 91aa55d891e029831e2eceb662184afc8d2e0415
Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
commit sha b8713e3854cb90b974eceaa1d50484831591619c
unnecessary-mut-passed: make lint message say if fn is a function or a method.
commit sha 3337f7956cf6100c9e5acfd72d42ec312efb6a7f
Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995 unnecessary-mut-passed: make lint message say if fn is a function or a method changelog: refine "unnecessary-mut-passed" lint message
commit sha c0a9d64818d7076b72fd6c3a9e6172eca659034b
stable-sort-primitive: make lint adhere to lint message convention
push time in 21 days
push eventnnethercote/ron
commit sha b43c1074d517131fd0cfc1deb96e11f95d6f42d8
Optionally always include float decimals
commit sha 67f6835abcdd193cecd769bc66a84a84174d9727
test: enforce newlines in array format
commit sha 35355ba7eb495f07282162826c29873154c2fa14
fix: expected array formatting Fixes #240
commit sha 6748ae646eda9d94d74ccfa00ecc8edce663db81
refactor: simplify Compound declaration
commit sha 25aa1eba9bbe39ef777a3d7a1fe2f3c0fb58696d
include hex characters into unsigned definition
commit sha 57295c9a1ead90cce52fb03e0715feb34d5f500f
rename PrettyConfig methods
commit sha 71e48ca202a0b0dc47a4cd37ae06fc4b898eb8ab
pin repository to msrv of 1.41.0 (#261) * pin repository to msrv of 1.41.0 * Restore ci.yaml * chore(rustc): pin version to 1.34.0 No reason to update the MSRV until we need a specific feature from it. `ron` does compile down to 1.34.0, so we will pin it down for this version.
commit sha 14173aecdc747b947d6a5119d2a3ed26d89ef3c5
chore(readme): add MSRV badge (#262)
commit sha 057378fad4ffaf7acdab4a780b0f7fb839239a7b
Change order of line/col fields of `Position` (#266) This makes debug output easier to read: `Position { line: 0, col: 0 }` instead of confusing `Position { col: 0, line: 0 }`. (Note: debug output is used e.g. for `.unwrap`ing)
commit sha 5947067d1505bb785f992d22c156d08d7e0ee302
Add to_writer_pretty (#269)
commit sha 8abced4a22448d0ea86fbfb15a967b6ccf5bb3fe
Add another intellij plugin to README
commit sha 06cd519833b99150ef62ebe9b9bab68cd45739c4
README: Fix issues list formatting (#271)
commit sha 995d9e93d98b93cfbf0d6040230f6732dd4cf32b
Add EBNF for multiline-comment to grammar docs (#272)
commit sha 6b834468017c1c1f2207e3ba61a5f2ed8f407edf
Fix link to intellij plugin
commit sha 6ff3dd28a5019056b6b4f0fd3fd4f9487978bde7
Remove link to paid IntelliJ plugin reviews say "broken and dev doesn't respond"
commit sha 83628d99f24521c1d40712de30bdfaa56843ec80
Merge pull request #274 from ron-rs/rm-link Remove link to paid IntelliJ plugin
commit sha 37714324c9bcac12bcb37c97455ce80630cbbc73
Add EMACS tooling to the list (#275)
push time in 24 days
pull request commentrust-lang/rustc-perf
initial uPlot & JSON-based graph page prototype. (#742)
I agree that it would be nice to have a dot for each point.
comment created time in a month
push eventnnethercote/rust
commit sha 9914f73f14fc4edbb7595078e97b3ee1f5d3bd4b
Add doc-comment for `kind_side_channel`
commit sha 98922795f68e86b0bca5aea8cfc66499d58eba1a
Auto merge of #75121 - tmiasko:str-slicing, r=Mark-Simulacrum Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code. Closes #68874.
commit sha 644c8949121da0c16f65b772bf6e217748d94530
test min_const_generics using revisions
commit sha d51b7b229a09561311de67ef7bb5137204e227dd
Update hashbrown to 0.8.1
commit sha e3283e0331f6301b1dd8fc24d886c29359c49bbd
Handle new HashMap layout in GDB and LLDB
commit sha 122c03745ed18452fc3559862ff47f551bc44181
Handle new HashMap layout in CDB, MSVC, WinDbg, etc.
commit sha 5f331c05853983001a1319d4d2116c44a087e5a4
Rollup merge of #74774 - oliver-giersch:set_data_ptr, r=dtolnay adds [*mut|*const] ptr::set_ptr_value I propose the addition of these two functions to `*mut T` and `*const T`, respectively. The motivation for this is primarily byte-wise pointer arithmetic on (potentially) fat pointers, i.e. for types with a `T: ?Sized` bound. A concrete use-case has been discussed in [this](https://internals.rust-lang.org/t/byte-wise-fat-pointer-arithmetic/12739) thread. TL;DR: Currently, byte-wise pointer arithmetic with potentially fat pointers in not possible in either stable or nightly Rust without making assumptions about the layout of fat pointers, which is currently still an implementation detail and not formally stabilized. This PR adds one function to `*mut T` and `*const T` each, allowing to circumvent this restriction without exposing any internal implementation details. One possible alternative would be to add specific byte-wise pointer arithmetic functions to the two pointer types in addition to the already existing count-wise functions. However, I feel this fairly niche use case does not warrant adding a whole set of new functions like `add_bytes`, `offset_bytes`, `wrapping_offset_bytes`, etc. (times two, one for each pointer type) to `libcore`.
commit sha 5b1ed09df0528ec47e9007bfbf53ab3e584b97eb
Rollup merge of #75079 - jyn514:disambiguator, r=Manishearth Disallow linking to items with a mismatched disambiguator Closes https://github.com/rust-lang/rust/issues/74851 r? @Manishearth
commit sha 25c8e9ac172cca11fc23b21f3bba4b2653a9bad2
Rollup merge of #75203 - canova:btreemap-into-iter, r=dtolnay Make `IntoIterator` lifetime bounds of `&BTreeMap` match with `&HashMap` This is a pretty small change on the lifetime bounds of `IntoIterator` implementations of both `&BTreeMap` and `&mut BTreeMap`. This is loosening the lifetime bounds, so more code should be accepted with this PR. This is lifetime bounds will still be implicit since we have `type Item = (&'a K, &'a V);` in the implementation. This change will make the HashMap and BTreeMap share the same signature, so we can share the same function/trait with both HashMap and BTreeMap in the code. Fixes #74034. r? @dtolnay hey, I was touching this file on my previous PR and wanted to fix this on the way. Would you mind taking a look at this, or redirecting it if you are busy?
commit sha 9ab750d05dfc112b132ea4774ae105ca00474e46
Rollup merge of #75227 - Amanieu:fix_asm_arch, r=Mark-Simulacrum Fix ICE when using asm! on an unsupported architecture Fixes #75220
commit sha 3d1388f514ab18ad798251f511c54097ba5c60ca
Add more examples to Path ends_with We faced a footgun when using ends_with to check extension, showing an example could prevent that.
commit sha e46bb17936abd262df4190fcac851cb9d48d10b4
Fix natvis tests
commit sha d4c940f0821754a98491b2d23fbb5323c14a2bf5
Auto merge of #75244 - Manishearth:rollup-dzfyjva, r=Manishearth Rollup of 4 pull requests Successful merges: - #74774 (adds [*mut|*const] ptr::set_ptr_value) - #75079 (Disallow linking to items with a mismatched disambiguator) - #75203 (Make `IntoIterator` lifetime bounds of `&BTreeMap` match with `&HashMap` ) - #75227 (Fix ICE when using asm! on an unsupported architecture) Failed merges: r? @ghost
commit sha 8b26609481c956a666f9189738f1ba611078e1ab
Auto merge of #70052 - Amanieu:hashbrown7, r=Mark-Simulacrum Update hashbrown to 0.8.1 This update includes: - https://github.com/rust-lang/hashbrown/pull/146, which improves the performance of `Clone` and implements `clone_from`. - https://github.com/rust-lang/hashbrown/pull/159, which reduces the size of `HashMap` by 8 bytes. - https://github.com/rust-lang/hashbrown/pull/162, which avoids creating small 1-element tables. Fixes #28481
commit sha 48a6c2125b5313f5d0f6d713d72033dbe559588e
Only add a border for the rust logo
commit sha 0aee186723a3bb3290fd4348b92b3c1aad862fc9
make MaybeUninit::as_(mut_)ptr const
commit sha ec5d78d35004846f1d0c344e968eaf0068a68357
fix feature gate and tracking issue
commit sha e31116af50f35ff81f83561ba607c610f42bbf4a
Add `into_{keys,values}` methods for HashMap
commit sha 13529f22ba574e723bea2514ba153bd0dc53bfbb
Add `into_{keys,values}` methods for BTreeMap
commit sha 41dd4ee7ffea3e2bed0422675143426b322fc23b
Add unit tests for new `HashMap::into_{keys,values}` methods
push time in a month
push eventnnethercote/rust
commit sha 5d32786b4f656f7b7e44a8afbf124e924dc12429
Switch to intra-doc links in `std::macros` Also: * Fix typo in module docs * Link to `std::io::stderr` instead of `std::io::Stderr` to match the link text * Link to `std::io::stdout`
commit sha becf5ec4ea65d1805a3a9fe5a55e2db8a86b9e47
Add missing intra-doc link
commit sha 637659be6a87da5c8972f147d7a508bb808d669b
Add missing links
commit sha 69d3334adf9d7042546aba741bca7fc7b0ffd2bc
Fix typo in documentation of i32 wrapping_abs()
commit sha 2c995d29f72c0d295ecddd6315520f8abf1ab8f8
Prefer https link for wikipedia URLs
commit sha 18f47d81dae6740a4b62262cf2518ea1cfe19e62
Misleading documentation for derived Ord/PartialOrd implementation for enums #75620
commit sha 2e6f2e885506ee46ea32622e33fe74d99774cf57
publish-toolstate: show more context on HTTP error
commit sha e9928d8926e0de92d41ca3e8ac997517369a82bd
Switch to intra-doc links in `std::collections`
commit sha 04e8237c6d8a7ad8decfbe380467481d1f9c2a0b
Switch to intra-doc links in `core::array`
commit sha 7c6362a19c9c80c25cbefd910427f3b99b0d6f2a
expand-yaml-anchors: fix clippy::match_ref_pats and clippy::redundant_closure
commit sha d97c4703eb427be4209bc2bd4845fa6abafa3eb5
linkcheckr: fix clippy::redundant_static_lifetimes and clippy::single_char_pattern
commit sha d36e3e23a80f039ee98117ebba0bb2ea6e34f0c1
Use intra-doc-links in `core::{char, macros, fmt}`
commit sha ebac0e4727769dbb9da1f2ecfe353438defa8b78
tidy: remove redundant variable from check_if_error_code_is_test_in_explanation
commit sha ba6b4274b57ae38420e4bee951f29455204967e8
unicode_table_generator: fix clippy::writeln_empty_string, clippy::useless_format, clippy:::for_kv_map
commit sha a72500145b28a5aa584dab9d19565597aae72892
unstable-book-gen: fix clippy::single_char_pattern and clippy::iter_skip_next
commit sha bc47f70f888afff97ffd7a4161bd45f9054dede6
doc: Fix typo in std::process::Child documentation
commit sha 50bdcc2f2eb3b7149ccd29e34d9d7c7707ae4aac
Rollup merge of #75819 - LeSeulArtichaut:core-intra-docs-2, r=jyn514 Use intra-doc-links in `core::{char, macros, fmt}` Helps with #75080. r? @jyn514
commit sha 640b36f97acaa066cbbe2d647bf7e5ef14602b69
Rollup merge of #75821 - camelid:intra-doc-links-for-std-macros, r=jyn514 Switch to intra-doc links in `std::macros` Part of #75080. --- * Switch to intra-doc links in `std::macros` * Fix typo in module docs * Link to `std::io::stderr` instead of `std::io::Stderr` to match the link text * Link to `std::io::stdout` --- @rustbot modify labels: A-intra-doc-links T-doc T-rustdoc
commit sha b8e456f2db80e2f9bf030232315ff2c9137be7fb
Rollup merge of #75825 - jrheard:patch-1, r=steveklabnik Fix typo in documentation of i32 wrapping_abs() Hi! I was reading through the std library docs and noticed that this section flowed a bit oddly; comparing it against https://doc.rust-lang.org/std/primitive.i32.html#method.wrapping_div and https://doc.rust-lang.org/std/primitive.i32.html#method.wrapping_neg , I noticed that those two pieces of documentation used a semicolon here. This is my first time submitting a PR to this repo. Am I doing this right? Are tiny typo-fix PRs like this worth submitting, or are they not a good use of time? Thank you!
commit sha 427e969c4334fb2d4e2c8b25fff9a729c0a754aa
Rollup merge of #75826 - ayushmishra2005:misleading_documentation_for_derived_Ord_PartialOrd, r=KodrAus Corrected Misleading documentation for derived Ord/PartialOrd implementation Corrected Misleading documentation for derived Ord/PartialOrd implementation Fixes #75620
push time in a month
push eventnnethercote/rust
commit sha 230393993ffc255d3f20d98400c8a376bd51d1c0
Don't visit foreign function bodies when lowering ast to hir Previously the existence of bodies inside a foreign function block would cause a panic in the hir `NodeCollector` during its collection of crate bodies to compute a crate hash: https://github.com/rust-lang/rust/blob/e59b08e62ea691916d2f063cac5aab4634128022/src/librustc_middle/hir/map/collector.rs#L154-L158 The collector walks the hir tree and creates a map of hir nodes, then attaching bodies in the crate to their owner in the map. For a code like ```rust extern "C" { fn f() { fn g() {} } } ``` The crate bodies include the body of the function `g`. But foreign functions cannot have bodies, and while the parser AST permits a foreign function to have a body, the hir doesn't. This means that the body of `f` is not present in the hir, and so neither is `g`. So when the `NodeCollector` finishes the walking the hir, it has no record of `g`, cannot find an owner for the body of `g` it sees in the crate bodies, and blows up. Why do the crate bodies include the body of `g`? The AST walker has a need a for walking function bodies, and FFIs share the same AST node as functions in other contexts. There are at least two options to fix this: - Don't unwrap the map entry for an hir node in the `NodeCollector` - Modifier the ast->hir lowering visitor to ignore foreign function blocks I don't think the first is preferrable, since we want to know when we can't find a body for an hir node that we thought had one (dropping this information may lead to an invalid hash). So this commit implements the second option. Closes #74120
commit sha ab4275cddc3749caf9f20373eb812e6f09bd3309
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 68aca3baf6566cea3ad2f83a07726c9ee017b9fc
fixup! fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 0c64d32a4a439f373f388f7925048f6f349bd5b2
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha d442bf7162647743f941977a5154676322a5614b
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 08990e5c7554d4d6a0440debc2edc99c8e9565c8
MinGW: disable self-contained mode when cross compiling When cross compiling users have to provide own linker and libraries anyway. Using rust provided MinGW crt objects is harmful here and has no benefits.
commit sha 442c8ae23b90874485468b3becfc011f8c9d40bb
Fix FP for `suspicious_arithmetic_impl` from `suspicious_trait_impl` lint
commit sha 30659cd45ee01f5626aeef4bbe29c68536dc833d
older toolchains not valid any more with the change to llvm 10 the parameter LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN do not do any thing as min and soft error is the same. see https://github.com/rust-lang/llvm-project/blob/86b120e6f302d39cd6973b6391fb299d7bc22122/llvm/cmake/modules/CheckCompilerVersion.cmake
commit sha 51f2a6f8b6eea9ebefddff39e87a1ca16c59827c
Add documentation for basic Clippy hacking
commit sha 9b5a974bd5c398e5706e463045121b20f0f6abb9
Correctly parse `{} && false` in tail expression Fix #74233.
commit sha 17903f6d7107c6d31ee15f4c46af29d1f4aa363f
Mention lint naming guidelines earlier
commit sha 3a4cc9f7f085e73fbfe57e8c896b90a5fe61c4f4
Address review comments
commit sha b375f1dd20bf07175ec06d13e1e9dc8b20287cd3
Add suggestion for `iter_skip_next` lint
commit sha d164ab65f706540f0132268c8ad2237d2e53e08a
Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup
commit sha f5d429cd762423901f946abd800dc2cd91366ccf
Auto merge of #5820 - ThibsG:FixSuspiciousArithmeticImpl, r=flip1995 Fix FP for `suspicious_arithmetic_impl` from `suspicious_trait_impl` … As discussed in #3215, the `suspicious_trait_impl` lint causes too many false positives, as it is complex to find out if binary operations are suspicious or not. This PR restricts the number of binary operations to at most one, otherwise we don't lint. This can be seen as very conservative, but at least FP can be reduced to bare minimum. Fixes: #3215 changelog: limit the `suspicious_arithmetic_impl` lint to one binop, to avoid many FPs
commit sha 8dc9d4d567dae3481a47ad677e263cb3bd57cdf5
[experiment] ty/layout: compute both niche-filling and tagged layouts for enums.
commit sha b34d3004914a1b6b2e7c91b2c41ac1af28745874
compare tagged/niche-filling layout and pick the best one
commit sha 144b1592e8186ab7c24212058bb2c897260897e3
document test changes
commit sha 5a644964fc05752a1283dab238b81de7583f7d03
run cargo dev new_lint specifically: cargo dev new_lint --name derive_ord_xor_partial_ord --category correctness --pass late
commit sha fc20ee63a105c0df78113126e8749f5958d7dc47
move derive_ord_xor_partial_ord into derive mod so we can reuse derive_hash_xor_partial_eq code later
push time in a month
PR closed rust-lang/rust
PR #72962 shrank Obligation at the cost of more heap allocations;
overall it was a perf win.
This PR partly undoes that change, making Obligation a little bigger
(though not as big as it was) while reducing the number of heap
allocations.
r? @ghost
pr closed time in a month
pull request commentrust-lang/rust
Eliminate `ObligationCauseData`.
This isn't going anywhere.
comment created time in a month
Pull request review commentrust-lang/rust
Add a packed/tagged pointer abstraction and utilize it for ParamEnv
impl WithOptConstParam<DefId> { /// When type checking, we use the `ParamEnv` to track /// details about the set of where-clauses that are in scope at this /// particular point.-#[derive(Copy, Clone)]+#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ParamEnv<'tcx> {- // We pack the caller_bounds List pointer and a Reveal enum into this usize.- // Specifically, the low bit represents Reveal, with 0 meaning `UserFacing`- // and 1 meaning `All`. The rest is the pointer.- //- // This relies on the List<Predicate<'tcx>> type having at least 2-byte- // alignment. Lists start with a usize and are repr(C) so this should be- // fine; there is a debug_assert in the constructor as well.- //- // Note that the choice of 0 for UserFacing is intentional -- since it is the- // first variant in Reveal this means that joining the pointer is a simple `or`.- packed_data: usize,-- /// `Obligation`s that the caller must satisfy. This is basically- /// the set of bounds on the in-scope type parameters, translated+ /// This packs both caller bounds and the reveal enum into one pointer.+ ///+ /// Caller bounds are `Obligation`s that the caller must satisfy. This is+ /// basically the set of bounds on the in-scope type parameters, translated /// into `Obligation`s, and elaborated and normalized. ///- /// Note: This is packed into the `packed_data` usize above, use the- /// `caller_bounds()` method to access it.- caller_bounds: PhantomData<&'tcx List<Predicate<'tcx>>>,-+ /// Use the `caller_bounds()` method to access.+ /// /// Typically, this is `Reveal::UserFacing`, but during codegen we /// want `Reveal::All`. ///- /// Note: This is packed into the caller_bounds usize above, use the reveal()- /// method to access it.- reveal: PhantomData<traits::Reveal>,+ /// Note: This is packed, use the reveal() method to access it.+ packed: CopyTaggedPtr<&'tcx List<Predicate<'tcx>>, traits::Reveal, true>, /// If this `ParamEnv` comes from a call to `tcx.param_env(def_id)`, /// register that `def_id` (useful for transitioning to the chalk trait /// solver). pub def_id: Option<DefId>, } +unsafe impl rustc_data_structures::tagged_ptr::Tag for traits::Reveal {+ const BITS: usize = 1;+ fn into_usize(self) -> usize {+ match self {+ traits::Reveal::UserFacing => 0,+ traits::Reveal::All => 1,+ }+ }+ unsafe fn from_usize(ptr: usize) -> Self {+ match ptr {+ 0 => traits::Reveal::UserFacing,+ 1 => traits::Reveal::All,+ _ => std::hint::unreachable_unchecked(),
ditto
comment created time in a month
Pull request review commentrust-lang/rust
Add a packed/tagged pointer abstraction and utilize it for ParamEnv
impl WithOptConstParam<DefId> { /// When type checking, we use the `ParamEnv` to track /// details about the set of where-clauses that are in scope at this /// particular point.-#[derive(Copy, Clone)]+#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ParamEnv<'tcx> {- // We pack the caller_bounds List pointer and a Reveal enum into this usize.- // Specifically, the low bit represents Reveal, with 0 meaning `UserFacing`- // and 1 meaning `All`. The rest is the pointer.- //- // This relies on the List<Predicate<'tcx>> type having at least 2-byte- // alignment. Lists start with a usize and are repr(C) so this should be- // fine; there is a debug_assert in the constructor as well.- //- // Note that the choice of 0 for UserFacing is intentional -- since it is the- // first variant in Reveal this means that joining the pointer is a simple `or`.- packed_data: usize,-- /// `Obligation`s that the caller must satisfy. This is basically- /// the set of bounds on the in-scope type parameters, translated+ /// This packs both caller bounds and the reveal enum into one pointer.+ ///+ /// Caller bounds are `Obligation`s that the caller must satisfy. This is+ /// basically the set of bounds on the in-scope type parameters, translated /// into `Obligation`s, and elaborated and normalized. ///- /// Note: This is packed into the `packed_data` usize above, use the- /// `caller_bounds()` method to access it.- caller_bounds: PhantomData<&'tcx List<Predicate<'tcx>>>,-+ /// Use the `caller_bounds()` method to access.+ /// /// Typically, this is `Reveal::UserFacing`, but during codegen we /// want `Reveal::All`. ///- /// Note: This is packed into the caller_bounds usize above, use the reveal()- /// method to access it.- reveal: PhantomData<traits::Reveal>,+ /// Note: This is packed, use the reveal() method to access it.+ packed: CopyTaggedPtr<&'tcx List<Predicate<'tcx>>, traits::Reveal, true>, /// If this `ParamEnv` comes from a call to `tcx.param_env(def_id)`, /// register that `def_id` (useful for transitioning to the chalk trait /// solver). pub def_id: Option<DefId>, } +unsafe impl rustc_data_structures::tagged_ptr::Tag for traits::Reveal {+ const BITS: usize = 1;+ fn into_usize(self) -> usize {+ match self {+ traits::Reveal::UserFacing => 0,+ traits::Reveal::All => 1,
Can you add = 0 / = 1 at the Reveal definition, and then do self as usize instead of the match, as is done here?
comment created time in a month
issue commentrust-lang/rust
[NLL] Bad higher ranked subtype error
I hit it again a couple of days later in a different piece of code, but I didn't record the exact problem that time.
If the error message said something like "there might be a problem with lifetimes of a closure", that would be a significant hint in the right direction.
comment created time in a month
delete branch nnethercote/rust
delete branch : tweak-confusable-idents-checking
delete time in a month
Pull request review commentrust-lang/rust
impl Symbol { } } +// These `Symbol` methods are for accessing symbols via `SESSION_GLOBALS`.+impl Symbol {+ /// Map a string to its symbol representation, using the interner's table+ /// from `SESSION_GLOBALS` if necessary (a relatively slow operation).+ pub fn intern(string: &str) -> Self {+ if let Some(sym) = Symbol::try_new_inlined(string) {+ sym+ } else {+ with_interner(|interner| interner.intern(string))+ }+ }++ /// Access the symbol's chars, using the interner's table from+ /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+ pub fn with<F: FnOnce(&str) -> R, R>(self, f: F) -> R {+ f(self.as_str().deref())+ }++ /// Convert to a `SymbolStr`, using the interner's table from+ /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+ pub fn as_str(self) -> SymbolStr {
Aha, I can fix the sort problems by switching from sort_by_key to sort_by.
comment created time in a month
pull request commentrust-lang/rust
Tweak confusable idents checking
These two commits are the first two commits from #74554.
comment created time in a month
PR opened rust-lang/rust
The confusable idents checking does some sub-optimal things with symbols.
r? @petrochenkov cc @crlf0710
pr created time in a month
create barnchnnethercote/rust
branch : tweak-confusable-idents-checking
created branch time in a month
push eventnnethercote/rust
commit sha a5d0c2c17482e56cae5112083207e8c0ce19cb96
Remove redundant len binding
commit sha 34c343ac27c519350577bd1bfdc4d1a3b90e6db6
Make use of macro to avoid repetition
commit sha f55e4d036c10f5b887b4ed8c12b7b31f3bb75d23
Get pointer from address of c directly
commit sha a4fb1d0b76a6e4e5e980a6839eb318a879635882
adjust remaining targets - fix commit 7dc3886 - previous commit doesn't adjust all targets
commit sha 1f63a6a572a0f9afc769a88229d80cc81ff04697
Hash parent ExpnData
commit sha 955aebf529787fd49b05f07346e3de97da31cb09
Don't serialize ExpnData for foreign crates When we encode an ExpnId into the crate metadata, we write out the CrateNum of the crate that 'owns' the corresponding `ExpnData`, which is later used to decode the `ExpnData` from its owning crate. However, we current serialize the `ExpnData` for all `ExpnIds` that we serialize, even if the `ExpnData` was already serialized into a foreign crate. This commit skips encoding this kind of `ExpnData`, which should hopefully speed up metadata encoding and reduce the total metadata size.
commit sha e1ef3fa686040a8c9aba34dd954a7ff7227a23ee
Consistent variable name alloc for raw_vec
commit sha d243fa109fd22d334a717e4f03bf208ce9c3a9f4
Fix the documentation for move about Fn traits implementations
commit sha 375bccb8b3fa2a517e6e19e24da25cad0413987d
add min_const_generics feature gate
commit sha 289e5fca7ecdb03db97be9d89ae908f253a3f263
forbid generic params in complex consts
commit sha 188bbf840dd858edb929459bd3536219fa062077
forbid complex types for generic parameters
commit sha a5a5ca0da8cd536c0d6b2e7eb7da6304047dc750
add tracking issue
commit sha 0d54f571c10dbc7e6d8632698c5f08f77b4a7578
impl review
commit sha a784729cde2f558bba91984eadf0f152b8a9d288
Add `as_mut_ptr` to `NonNull<[T]>`
commit sha bbcacddef691464e5abe373f95849670298c63a7
Don't call a function in function-arguments-naked.rs Fixes #75096 It's U.B. to use anything other than inline assmebling in a naked function. Fortunately, the `#break` directive works fine without anything in the function body.
commit sha 37c29adabc638f9c601daf5b78d0f6de63e35f99
allow complex expressions in assoc consts
commit sha 644c8949121da0c16f65b772bf6e217748d94530
test min_const_generics using revisions
commit sha 0aee186723a3bb3290fd4348b92b3c1aad862fc9
make MaybeUninit::as_(mut_)ptr const
commit sha ec5d78d35004846f1d0c344e968eaf0068a68357
fix feature gate and tracking issue
commit sha e31116af50f35ff81f83561ba607c610f42bbf4a
Add `into_{keys,values}` methods for HashMap
push time in a month
pull request commentrust-lang/rust
Perf results from the landing. A bit weird; lots of improvements but some regressions as well, most in the incr-patched runs. I'm disappointed it's not a clearer and more uniform win.
comment created time in a month
pull request commentrust-lang/rust
@petrochenkov: thank you for doing #75309. I had though that a proc macro could probably improve the keyword categorization, but I didn't have the gumption to do it myself.
I am on PTO for the next two weeks so I won't get to this until after that. I'm still ambivalent about this, particularly because of my uncertainty in https://github.com/rust-lang/rust/pull/74554#discussion_r466844042. If I had to choose between eliminating SymbolStr or getting the small speedup from inlined symbols, I'd probably choose the former...
comment created time in a month
pull request commentrust-lang/rust
rustc_span: Generate keyword classification functions automatically
Yeah, maybe we shouldn't land this until we are certain about #74554?
comment created time in a month
pull request commentrust-lang/rust
Remove `librustc_ast` session globals
I added the 256 recursion limit.
@bors r=petrochenkov
comment created time in a month
push eventnnethercote/rust
commit sha af88ce5eb34b0ecdfd2f8dfcc837c353688d6c75
allow aux builds in rustdoc-ui mode
commit sha 608807934d41168cb30c6eee6442fe29251e40f0
use outermost invocation span for doctest names Fixes #70090.
commit sha c3454c000706176b61ef089107203766735348f7
Check whether locals are too large instead of whether accesses into them are too large
commit sha b26a7d5cd9d9c9ec84eba90b806a453135d20b99
Stop propagating to locals that were marks as unpropagatable. We used to erase these values immediately after propagation, but some things slipped through and it caused us to still initialize huge locals.
commit sha 9e21004c74b8749686c0e5b9195e6822be6280d0
Update ui tests
commit sha 8d5f2bdcd17f3139965b9ef6da8cb13183324485
Add test ensuring that we don't propagate large arrays
commit sha dc0408ec43fa6b63b5cbffbbc07823577c97ea24
Update clippy ui test. The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.
commit sha f7a1e64fdb209951e6e77369364feb530a60b04c
Update tests after rebase
commit sha 1864a973b3a0a5a6c5a7c71d7d7cd052732e5c02
Improve the diagnostics around misspelled mir dump filenames
commit sha 7f54cf26511b2716d35e2f2198bbff9da5a33123
compiletest: ignore-endian-big, fixes #74829, fixes #74885
commit sha 8e0e925e2bd45806f88195a94e59246e2e5b6d5e
Disallow linking to items with a mismatched disambiguator
commit sha 519c85439a39d85d0c4b08ff8622cad5bd707ada
Don't mark associated items as traits This caused the following false positive: ``` warning: unresolved link to `Default::default` --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(broken_intra_doc_links)]` on by default note: this item resolved to a trait, which did not match the disambiguator 'fn' --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ ```
commit sha 743f9327428801932bd70688b5c83f38bf61615a
Keep the previous behavior of `register_res` Now that we're returning the `Res` of the associated item, not the trait itself, it got confused.
commit sha 6c81556a36ac5507fe1f9cd8ee699e6fa2b11077
adds [*mut|*const] ptr::set_ptr_value
commit sha 99354f552df332c669d6e621e68dda403ea135fd
item -> link
commit sha 427634b5037ba1c00b72b70b561ff20767ea97e2
Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code.
commit sha 444f5a0556fc5779663e69ff1a3d5a7362ba9618
Give a much better error message if the struct failed to resolve
commit sha fc273a035dfb352fd90246dd2560c807701eeea7
Unresolved link -> incompatible link kind Clearly it has been resolved, because we say on the next line what it resolved to.
commit sha 725d37cae0a175edb0c013b3de5b337ce5b5054d
Make doctests of Ipv4Addr::from(u32) easier to read
commit sha d9f260e95efcb3ada02d1cd85d304438de8af294
Remove unused FromInner impl for Ipv4Addr
push time in a month
push eventnnethercote/rust
commit sha af88ce5eb34b0ecdfd2f8dfcc837c353688d6c75
allow aux builds in rustdoc-ui mode
commit sha 608807934d41168cb30c6eee6442fe29251e40f0
use outermost invocation span for doctest names Fixes #70090.
commit sha c3454c000706176b61ef089107203766735348f7
Check whether locals are too large instead of whether accesses into them are too large
commit sha b26a7d5cd9d9c9ec84eba90b806a453135d20b99
Stop propagating to locals that were marks as unpropagatable. We used to erase these values immediately after propagation, but some things slipped through and it caused us to still initialize huge locals.
commit sha 9e21004c74b8749686c0e5b9195e6822be6280d0
Update ui tests
commit sha 8d5f2bdcd17f3139965b9ef6da8cb13183324485
Add test ensuring that we don't propagate large arrays
commit sha dc0408ec43fa6b63b5cbffbbc07823577c97ea24
Update clippy ui test. The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.
commit sha f7a1e64fdb209951e6e77369364feb530a60b04c
Update tests after rebase
commit sha 1864a973b3a0a5a6c5a7c71d7d7cd052732e5c02
Improve the diagnostics around misspelled mir dump filenames
commit sha 7f54cf26511b2716d35e2f2198bbff9da5a33123
compiletest: ignore-endian-big, fixes #74829, fixes #74885
commit sha 8e0e925e2bd45806f88195a94e59246e2e5b6d5e
Disallow linking to items with a mismatched disambiguator
commit sha 519c85439a39d85d0c4b08ff8622cad5bd707ada
Don't mark associated items as traits This caused the following false positive: ``` warning: unresolved link to `Default::default` --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(broken_intra_doc_links)]` on by default note: this item resolved to a trait, which did not match the disambiguator 'fn' --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ ```
commit sha 743f9327428801932bd70688b5c83f38bf61615a
Keep the previous behavior of `register_res` Now that we're returning the `Res` of the associated item, not the trait itself, it got confused.
commit sha 6c81556a36ac5507fe1f9cd8ee699e6fa2b11077
adds [*mut|*const] ptr::set_ptr_value
commit sha 99354f552df332c669d6e621e68dda403ea135fd
item -> link
commit sha 427634b5037ba1c00b72b70b561ff20767ea97e2
Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code.
commit sha 444f5a0556fc5779663e69ff1a3d5a7362ba9618
Give a much better error message if the struct failed to resolve
commit sha fc273a035dfb352fd90246dd2560c807701eeea7
Unresolved link -> incompatible link kind Clearly it has been resolved, because we say on the next line what it resolved to.
commit sha 725d37cae0a175edb0c013b3de5b337ce5b5054d
Make doctests of Ipv4Addr::from(u32) easier to read
commit sha d9f260e95efcb3ada02d1cd85d304438de8af294
Remove unused FromInner impl for Ipv4Addr
push time in a month
pull request commentrust-lang/rust
Remove `librustc_ast` session globals
It's a weird rustdoc failure I haven't seen before, only on one of the linux platforms:
error[E0275]: overflow evaluating the requirement `alloc::raw_vec::RawVec<(rustc_ast::ast::UseTree, rustc_ast::ast::NodeId)>: std::marker::Sync`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustc_plugin_impl`)
= note: required because it appears within the type `std::vec::Vec<(rustc_ast::ast::UseTree, rustc_ast::ast::NodeId)>`
= note: required because it appears within the type `rustc_ast::ast::UseTreeKind`
... <lots more lines like that> ...
This is while running rustdoc on the rustc_plugin_impl module. That seems unrelated to my changes, unless we happened to be really close to the recursion limit previously and my patch changed enough things to tip it over the limit?
I'm not sure what to do here, whether it's spurious and likely to disappear if we try again, or if it's likely to recur. If it's the latter, I guess I should add the recusion_limit="256" like the message suggests?
@jyn514, any ideas?
comment created time in a month