run-make tests: use edition 2024
Bump run-make tests to edition 2024 to prevent test failures when using 2024 idioms in included code, such as I ran into here: https://github.com/rust-lang/rust/pull/147808.
Fix invalid tag closing when leaving expansion "original code"
Fixesrust-lang/rust#148184.
Problem was that in case an element inside the expansion's "original" element was not closed, this element would get its `pending_exit` field set to `true`, removing it when the next non-mergeable item gets pushed instead of being put inside it, and then next `exit_elem` would try to exit an empty class queue.
r? ```@notriddle```
add extend_front to VecDeque with specialization like extend
ACP: https://github.com/rust-lang/libs-team/issues/658
Tracking issue: rust-lang/rust#146975
_Text below was written before opening the ACP_
Feature was requested in rust-lang/rust#69939, I recently also needed it so decided to implement it as my first contribution to the Rust standard library. I plan on doing more but wanted to start with a small change.
Some questions I had (both on implementation and design) with answers:
- Q: `extend` allows iterators that yield `&T` where `T` is `Clone`, should extend_front do too?
A: No, users can use [`copied`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.copied) and/or [`cloned`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.cloned).
- Q: Does this need a whole new trait like Extend or only a method on `VecDeque`?
A: No, see ACP.
- Q: How do I deal with all the code duplication? Most code is similar to that of `extend`, maybe there is a nice way to factor out the code around `push_unchecked`/`push_front_unchecked`.
Will come back to this later.
- Q: Why are certain things behind feature gates, `cfg(not(test))` like `vec::IntoIter` here and `cfg(not(no_global_oom_handling))` like `Vec::extend_from_within`? (I am also looking at implementing `VecDeque::extend_from_within`)
A: See https://github.com/rust-lang/rust/pull/146861#pullrequestreview-3250163369
- Q: Should `extend_front` act like repeated pushes to the front of the queue? This reverses the order of the elements. Doing it different might incur an extra move if the iterator length is not known up front (where do you start placing elements in the buffer?).
A: `extend_front` acts like repeated pushes, `prepend` preserves the element order, see ACP or tracking issue.
Add num_children method to some gdb pretty-printers
gdb doesn't have a way to know when an object hasn't yet been initialized, and in this case, if a pretty-printer returns an absurd number of children, this can result in apparent hangs in some modes. This came up specifically with DAP, see this bug report:
https://sourceware.org/bugzilla/show_bug.cgi?id=33594
This patch (mostly) addresses this potential issue in the Rust pretty-printers, by adding 'num_children' methods. In particular a method like this is added when the number of children is variable and also relatively easy to compute. (I.e., I didn't attempt the btree printers.)
Supplying num_children is good for DAP regardless of the initialization problem, because DAP requires a count of child objects and this is more efficient than enumerating the children, which is gdb's fallback approach.
Minor fixes to StdNonZeroNumberProvider for gdb
While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.
First, gdb.Type.fields() already returns a sequence, so there's no need to call list().
Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value. This also lets gdb apply whatever formats were passed to `print`, as the new test shows.
Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.
std-detect: improve detect macro docs
Specifically, document that the detect macros expand to `true` when the feature is statically enabled.
Now that we have a bunch of these macros, perhaps we should streamline further how they are documented?
r? ``@Amanieu``
Add default sanitizers to TargetOptions
Some sanitizers are part of a system's ABI, like the shadow call stack on Aarch64 and RISC-V Fuchsia. Typically ABI options have other spellings, but LLVM has, for historical reasons, marked this as a sanitizer instead of an alternate ABI option. As a result, Fuchsia targets may not be compiled against the correct ABI unless this option is set. This hasn't caused correctness problems, since the backend reserves the SCS register, and thus preserves its value. But this is an issue for unwinding, as the SCS will not be an array of PCs describing the call complete call chain, and will have gaps from callers that don't use the correct ABI.
In the long term, I'd like to see all the sanitizer configs that all frontends copy from clang moved into llvm's libFrontend, and exposed so that frontend consumers can use a small set of simple APIs to use sanitizers in a consistent way across the LLVM ecosystem, but that work is not yet ready today.
Fix ICE from lit_to_mir_constant caused by type error
Fixesrust-lang/rust#148515
we still need to mark that there were errors to prevent later phases (like MIR building) from proceeding.
miri subtree update
x86/rounding-error is causing spurious test failures. This sync fixes that.
---
Subtree update of `miri` to de2a63b1e2.
Created using https://github.com/rust-lang/josh-sync.
r? ``@ghost``
Unify the configuration of the compiler docs
Previously it was rather inconsistent which crates got the rust logo and which didn't and setting html_root_url was forgotten in many cases.
[rustdoc search] Simplify itemTypes and filter "dependencies"
We currently have a list of type filters, some constants to be able to index the list of type filters and finally a `switch` to include some types in a given filter (for example when we filter on `constant`, we also include `associatedconstant` items).
r? ``@notriddle``
Deduplicate deprecation warning when using unit or tuple structs
First commit adds a test that's broken currently, 2nd commit fixes it.
Created with `@WaffleLapkin`
gdb doesn't have a way to know when an object hasn't yet been
initialized, and in this case, if a pretty-printer returns an absurd
number of children, this can result in apparent hangs in some modes.
This came up specifically with DAP, see this bug report:
https://sourceware.org/bugzilla/show_bug.cgi?id=33594
This patch (mostly) addresses this potential issue in the Rust
pretty-printers, by adding 'num_children' methods. In particular a
method like this is added when the number of children is variable and
also relatively easy to compute. (I.e., I didn't attempt the btree
printers.)
Supplying num_children is good for DAP regardless of the
initialization problem, because DAP requires a count of child objects
and this is more efficient than enumerating the children, which is
gdb's fallback approach.
While looking at the pretty-printers, I found a few minor oddities in
StdNonZeroNumberProvider.
First, gdb.Type.fields() already returns a sequence, so there's no
need to call list().
Second, it's more idiomatic for the (somewhat misnamed) to_string
method to simply return the underlying gdb.Value. This also lets gdb
apply whatever formats were passed to `print`, as the new test shows.
Third, there's no need to use the field's name when looking up a field
in a value, the gdb.Field itself can be used.
error on non-rustic ABIs using unsized parameters
tracking issue: https://github.com/rust-lang/rust/issues/48055
This came up in https://github.com/rust-lang/rust/pull/144529#discussion_r2470214068.
The idea is that the layout of an unsized type is unstable (following the rust layout rules), and hence stable ABIs should not use unsized types. On stable, unsized types (or generics with a `?Sized` bound) are not accepted as parameters, so the errors introduced by this PR can only be observed when the unstable `unsized_fn_params` feature is enabled.
r? `@bjorn3`
cc `@RalfJung`