| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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`
|
|
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.
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
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`
|
|
and document `VaList::arg`.
|
|
|
|
r=workingjubilee
core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref
also add INFO.md file explaining the purpose of the ptr/docs dir, and give some pointers (heh) to future maintainers.
follow up to rust-lang/rust#142101
part of rust-lang/rust#139190
r? `@workingjubilee`
|
|
also add INFO.md file explaining the purpouse of the ptr/docs dir.
|
|
inclusive `Range`s: change `end` to `last`
Tracking issue: rust-lang/rust#125687
ACP: rust-lang/libs-team#511
|
|
simplify the declaration of the legacy integer modules (`std::u32` etc.)
This PR removes some duplicated code from the declaration of the legacy integer modules by expanding the macro which is already used to generate `MIN` and `MAX` to now generate the whole module.
This would also make the remaining steps listed in rust-lang/rust#68490 such as fully deprecating the modules or placing `#[doc(hidden)]` on them easier.
|
|
const-eval: disable pointer fragment support
This fixes https://github.com/rust-lang/rust/issues/146291 by disabling pointer fragment support for const-eval. I want to properly fix this eventually, but won't get to it in the next few weeks, so this is an emergency patch to prevent the buggy implementation from landing on stable. The beta cutoff is on Sep 12th so if this PR lands after that, we'll need a backport.
|
|
mark `format_args_nl!` as `#[doc(hidden)]`
The `#[unstable]` attribute of the macro already says:
> `format_args_nl` is only for internal language use and is subject to change
It does seem plausible to hide it from the `std` docs accordingly.
The PR also removes the single usage of the macro outside of `std` as it does not seem like the macro is actually needed there.
|
|
Implement `Sum` and `Product` for `f16` and `f128`.
Tracking issue: rust-lang/rust#116909.
This PR implements `core::iter::{Sum, Product}` for `f16` and `f128`.
I'm curious as to why these two traits aren't already implemented. I've been unable to find any information about it at all, so if there is anything that currently blocks them, I would appreciate if someone could fill me in.
|
|
|
|
|
|
Fix typo in default.rs
This sentence currently reads:
> Rust implements `Default` for various primitives types.
I think it should just be "primitive types".
|
|
|
|
|
|
Don't include ASCII characters in Unicode tables
Split off from https://github.com/rust-lang/rust/pull/145219
|
|
|
|
|
|
|
|
The ASCII subset of Unicode is fixed and will never change, so we don't
need to generate tables for it with every new Unicode version. This
saves a few bytes of static data and speeds up `char::is_control` and
`char::is_grapheme_extended` on ASCII inputs.
Since the table lookup functions exported from the `unicode` module will
give nonsensical errors on ASCII input (and in fact will panic in debug
mode), I had to add some private wrapper methods to `char` which check
for ASCII-ness first.
|
|
LorrensP-2158466:miri-float-nondet-foreign-items-take2, r=RalfJung
Miri: non-deterministic floating point operations in foreign_items
Take 2 of rust-lang/rust#143906. The last 2 commits are what changed compared to the original pr.
Verified the tests using (fish shell):
```fish
env MIRIFLAGS="-Zmiri-max-extra-rounding-error -Zmiri-many-seeds" ./x miri --no-fail-fast std core coretests -- f32 f64
```
r? `@RalfJung`
|
|
|
|
single buffer for exponent fmt of integers
No need for fragmented buffers when formatting.
```
orig.txt: fmt::write_i128_exp 143.39ns/iter +/- 0.32
orig.txt: fmt::write_i64_exp 68.72ns/iter +/- 0.03
new.txt: fmt::write_i128_exp 138.29ns/iter +/- 0.50
new.txt: fmt::write_i64_exp 58.93ns/iter +/- 4.62
```
This patch fully eliminates unsafe pointer use (after rust-lang/rust#135265 and rust-lang/rust#136594).
r? libs
|
|
|
|
change file-is-generated doc comment to inner
Alternatively this could perhaps be better as a normal comment...
|
|
Simplify `{f16, f32, f64, f128}::midpoint()`
`(float_ty::MAX / 2) - (float_ty::MIN_POSITIVE * 2)` equals `(float_ty::MAX / 2) + (float_ty::MIN_POSITIVE * 2)` equals `(float_ty::MAX / 2)`. So these branches are pointless.
CC `@Urgau` who wrote the original implementation in https://github.com/rust-lang/rust/pull/92048; does this seem right?
`@rustbot` label A-floating-point
|
|
|
|
|
|
`(float_ty::MAX / 2) - (float_ty::MIN_POSITIVE * 2)` equals
`(float_ty::MAX / 2) + (float_ty::MIN_POSITIVE * 2)` equals
`(float_ty::MAX / 2)`. So these branches are pointless
|
|
add exact bitshifts
Tracking issue: rust-lang/rust#144336
cc ```@lolbinarycat```
|
|
Implement Integer funnel shifts
Tracking issue: rust-lang/rust#145686
ACP: https://github.com/rust-lang/libs-team/issues/642
This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else
Thanks `@folkertdev` for the fixes and tests
cc `@rust-lang/libs-api`
|
|
AudaciousAxiom:docs/missing-closing-code-block-fences, r=tgross35
docs(std): add missing closing code block fences in doc comments
This PR adds a few closing code block fences which I believe are missing in some doc comments. It seems that rustdoc just autocloses code blocks at the end of doc comments and thus these were easily overlooked: I do not think these code blocks are special in any way.
I found these when working on a Clippy lint that checks the last sentence of doc comments for terminal punctuation, and these were failing cases when testing against the std. Therefore I am not entirely sure these are all such cases, but still have high hopes that they are (or at least a well-defined subset of them).
|
|
add `#[must_use]` to `array::repeat`
|
|
core: add Peekable::next_if_map
Implementation for rust-lang/rust#143702
|
|
r=joshtriplett,tgross35
unicode-table-generator refactors
Split off from https://github.com/rust-lang/rust/pull/145219
|
|
Constify conversion traits (part 1)
This is the first part of rust-lang/rust#144289 being split into smaller pieces. It adds/moves constness of several traits under the `const_convert` feature:
* `From`
* `Into`
* `TryFrom`
* `TryInto`
* `FromStr`
* `AsRef`
* `AsMut`
* `Borrow`
* `BorrowMut`
* `Deref`
* `DerefMut`
There are a few methods that are intrinsically tied to these traits which I've included in the feature. Particularly, those which are wrappers over `AsRef`:
* `ByteStr::new` (unstable under `bstr` feature)
* `OsStr::new`
* `Path::new`
Those which directly use `Into`:
* `Result::into_ok`
* `Result::into_err`
And those which use `Deref` and `DerefMut`:
* `Pin::as_ref`
* `Pin::as_mut`
* `Pin::as_deref_mut`
* `Option::as_deref`
* `Option::as_deref_mut`
* `Result::as_deref`
* `Result::as_deref_mut`
(note: the `Option` and `Result` methods were suggested by ``@npmccallum`` initially as rust-lang/rust#146101)
The parts which are missing from this PR are:
* Anything that involves heap-allocated types
* Making any method const than the ones listed above
* Anything that could rely on the above, *or* could rely on system-specific code for `OsStr` or `Path` (note: this mostly makes these methods useless since `str` doesn't implement `AsRef<OsStr>` yet, but it's better to track the method for now and add impls later, IMHO)
r? ``@tgross35`` (who mostly already reviewed this)
|
|
- Add a fallback implementation for the intrinsics
- Add LLVM backend support for funnel shifts
Co-Authored-By: folkertdev <folkert@folkertdev.nl>
|
|
|