| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Remove Rvalue::Len again.
Now that we have `RawPtrKind::FakeForPtrMetadata`, we can reimplement `Rvalue::Len` using `PtrMetadata(&raw const (fake) place)`.
r? ``@scottmcm``
|
|
Iterator repeat: no infinite loop for `last` and `count`
This removes two cases of infinite looping from [`Repeat`](https://doc.rust-lang.org/nightly/std/iter/struct.Repeat.html):
- [`last`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.last): By viewing the iterator as returning None after [omega](https://en.wikipedia.org/wiki/Ordinal_number) calls to `next`, this method can simply return the repeated element.
- [`count`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.count): From its docs: """The method does no guarding against overflows, so counting elements of an iterator with more than [usize::MAX](https://doc.rust-lang.org/nightly/std/primitive.usize.html#associatedconstant.MAX) elements either produces the wrong result or panics. If overflow checks are enabled, a panic is guaranteed.""", so a panic'ing impl is allowed by the docs, and is more honest than an infinite loop.
|
|
initial implementation of the darwin_objc unstable feature
Tracking issue: https://github.com/rust-lang/rust/issues/145496
This feature makes it possible to reference Objective-C classes and selectors using the same ABI used by native Objective-C on Apple/Darwin platforms. Without it, Rust code interacting with Objective-C must resort to loading classes and selectors using costly string-based lookups at runtime. With it, these references can be loaded efficiently at dynamic load time.
r? ```@tmandry```
try-job: `*apple*`
try-job: `x86_64-gnu-nopt`
|
|
Stabilize `btree_entry_insert` feature
This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](https://github.com/rust-lang/rust/issues/65225).
New stable API:
```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```
(FCP ended almost a year ago, so if it's needed for process we could rerun it)
Closes: https://github.com/rust-lang/rust/issues/65225
|
|
libtest: expose --fail-fast as an unstable command-line option
This exposes the `fail_fast` option added in rust-lang/rust#105153 on the test harness command line, so that workflows that only want to know if any test fails can find out without waiting for everything to run. For example, cargo-mutants just needs to know if any tests fails. It only works with `-Zunstable-options`.
Tracking issue: rust-lang/rust#142859
|
|
|
|
|
|
Improve `core::ascii` coverage
This PR improves the `core::ascii` coverage by adding a new test to `coretests`
r? `@workingjubilee`
|
|
|
|
|
|
|
|
These docs are in en_US, so "adapter" is the correct spelling
(and indeed used in the next line.)
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#145095 (Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`)
- rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions)
- rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization)
- rust-lang/rust#146466 (llvm-wrapper: other cleanup)
- rust-lang/rust#146574 (compiletest: Enable new-output-capture by default)
- rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`)
- rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again)
- rust-lang/rust#146608 (improve internal bootstrap docs)
- rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
replace some `#[const_trait]` with `const trait`
|
|
Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`
Now that we have ``#[unstable_feature_bound]``, we can remove ``UnsizedConstParamTy`` that was meant to be an unstable impl of stable type and ``ConstParamTy_`` trait.
r? `@BoxyUwU`
|
|
On FreeBSD, use readdir instead of readdir_r
readdir_r has the same problems on FreeBSD as it does on other platforms: it assumes a fixed NAME_MAX. And readdir has the same thread-safety guarantee as it does on other platforms: it's safe as long as only one thread tries to read from the directory stream at a given time.
Furthermore, readdir_r is likely to be removed for FreeBSD 16, so we should stop using it now.
|
|
Switch `std::vec::PeekMut::pop` from self to this parameter.
Since PeekMut implements Deref, it shouldn't have any methods of its own.
See also: `std::collections::binary_heap::PeekMut::pop`
Pointed out: https://github.com/rust-lang/rust/issues/122742#issuecomment-3064050551
Related: rust-lang/rust#122742
|
|
Note some previous attempts to change the Default impl for `[T; 0]`
Recently, rust-lang/rust#145457 experimented with changing the Default impl for `[T; 0]`.
Subsequently, rust-lang/rust#146531 also aimed to perform a similar experiment.
It seems like a good idea to add some links to the relevant source code, so that the historical context of this tricky topic is easier to find.
|
|
RISC-V: Improvements of inline assembly uses
|
|
|
|
|
|
|
|
|
|
Remove big-endian swizzles from `vreinterpret`
|
|
r=Mark-Simulacrum
Improve `core::ptr` coverage
This PR improves the `core::ptr` coverage by adding a new test to `coretests` for the `<*const T>::is_aligned_to` method.
r? libs
|
|
r=Mark-Simulacrum
Improve `core::fmt` coverage
This PR improves the `core::fmt` coverage by adding new tests to `coretests`
|
|
r=Mark-Simulacrum
Remove `div_rem` from `core::num::bignum`
This fixes very old fixme that sounds like this
```
Stupid slow base-2 long division taken from
https://en.wikipedia.org/wiki/Division_algorithm
FIXME use a greater base ($ty) for the long division.
```
By deleting this method since it was never used
|
|
readdir_r has the same problems on FreeBSD as it does on other
platforms: it assumes a fixed NAME_MAX. And readdir has the same
thread-safety guarantee as it does on other platforms: it's safe as long
as only one thread tries to read from the directory stream at a given
time.
Furthermore, readdir_r is likely to be removed for FreeBSD 16, so we
should stop using it now.
|
|
Since PeekMut implements Deref, it shouldn't have any methods of its
own.
See also: `std::collections::binary_heap::PeekMut::pop`
|
|
Brings the list of checkable features up to date with the initial release of macOS 26 "Tahoe".
|
|
|
|
Now that this feature has a standard identifier, Darwin has started exposing it accordingly, in addition to the existing less-standard way. Check both, and enable the `crc` feature if either identifier for it is present to ensure backwards and forwards compatibility.
|
|
This commit performs various improvements (better register allocation,
less register clobbering on the worst case and better readability) of
RISC-V inline assembly use cases.
Note that it does not change the `p` module (which defines the "P"
extension draft instructions but very likely to change).
1. Use `lateout` as possible.
Unlike `out(reg)` and `in(reg)` pair, `lateout(reg)` and `in(reg)`
can share the same register because they state that the late-output
register is written after all the reads are performed.
It can improve register allocation.
2. Add `preserves_flags` option as possible.
While RISC-V doesn't have _regular_ condition codes, RISC-V inline
assembly in the Rust language assumes that some registers
(mainly vector state registers) may be overwritten by default.
By adding `preserves_flags` to the intrinsics corresponding
instructions without overwriting them, it can minimize register
clobbering on the worst case.
3. Use trailing semicolon.
As `asm!` declares an action and it doesn't return a value by
itself, it would be better to have trailing semicolon to denote that
an `asm!` call is effectively a statement.
4. Make most of `asm!` calls multi-lined.
`rustfmt` makes some simple (yet long) `asm!` calls multi-lined but
it does not perform formatting of complex `asm!` calls with inputs
and/or outputs. To keep consistency, it makes most of the `asm!`
calls multi-lined.
|
|
|
|
|
|
document `core::ffi::VaArgSafe`
tracking issue: https://github.com/rust-lang/rust/issues/44930
A modification of https://github.com/rust-lang/rust/pull/146454, keeping just the documentation changes, but not unsealing the trait.
Although conceptually we'd want to unseal the trait, there are many edge cases to supporting arbitrary types. We'd need to exhaustively test that all targets/calling conventions support all types that rust might generate (or generate proper error messages for unsupported cases). At present, many of the `va_arg` implementations assume that the argument is a scalar, and has an alignment of at most 8. That is totally sufficient for an MVP (accepting all of the "standard" C types), but clearly does not cover all rust types.
This PR also adds some various other tests for edge cases of c-variadic:
- the `#[inline]` attribute in its various forms. At present, LLVM is unable to inline c-variadic functions, but the attribute should still be accepted. `#[rustc_force_inline]` already rejects c-variadic functions.
- naked functions should accept and work with a C variable argument list. In the future we'd like to allow more ABIs with naked functions (basically, any ABI for which we accept defining foreign c-variadic functions), but for now only `"C"` and `"C-unwind` are supported
- guaranteed tail calls: c-variadic functions cannot be tail-called. That was already rejected, but there was not test for it.
r? `@workingjubilee`
|
|
fix Condvar::wait_timeout docs
[Context](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Condvar.20wait_timeout.20sleep.20duration.20decremented/with/539279839)
r? `@joboet`
|
|
Revert "Constify SystemTime methods"
This reverts https://github.com/rust-lang/rust/pull/144519. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation.
Fixes https://github.com/rust-lang/rust/issues/146228.
Closes https://github.com/rust-lang/rust/issues/144517 (since the feature is gone).
r? `@tgross35`
Cc `@clarfonthey`
|
|
and document `VaList::arg`.
|
|
|
|
|
|
|
|
|
|
Stabilize BTree{Map,Set}::extract_if
Tracking issue: rust-lang/rust#70530
FCP completed: https://github.com/rust-lang/rust/issues/70530#issuecomment-3191454465
Closes: rust-lang/rust#70530
|
|
Improve `core::hash` coverage
This PR improves the `core::hash` coverage by adding a new test to `coretests` and extending one of the existing tests to use 128-bit integers
r? libs
|
|
Improve `core::char` coverage
This PR improves the `core::char` coverage by adding new tests to `coretests`
r? ``@workingjubilee``
|
|
Improve `alloc::Layout` coverage
This PR improves the `core::alloc` coverage by adding a new test to `coretests` that cover the `Layout` methods when they error.
Tracking issue: https://github.com/rust-lang/rust/issues/55724
|
|
|