| Age | Commit message (Collapse) | Author | Lines |
|
Revert panic oom
This temporarily reverts https://github.com/rust-lang/rust/pull/109507 until https://github.com/rust-lang/rust/issues/110771 is addressed
r? `@Amanieu`
|
|
Check requested digit length and the fractional or integral parts of the number. Falls back earlier without trying the Grisu algorithm if the specific condition meets.
Fix #110129
|
|
Add LazyCell::into_inner
This enables uses cases that need to extract the evaluated value and do something owned with it.
|
|
This reverts commit abc0660118cc95f47445fd33502a11dd448f5968.
|
|
This moves more of the internal/lang items into the private rt module.
|
|
|
|
|
|
Add `intrinsics::transmute_unchecked`
This takes a whole 3 lines in `compiler/` since it lowers to `CastKind::Transmute` in MIR *exactly* the same as the existing `intrinsics::transmute` does, it just doesn't have the fancy checking in `hir_typeck`.
Added to enable experimenting with the request in <https://github.com/rust-lang/rust/pull/106281#issuecomment-1496648190> and because the portable-simd folks might be interested for dependently-sized array-vector conversions.
It also simplifies a couple places in `core`.
See also https://github.com/rust-lang/rust/pull/108442#issuecomment-1474777273, where `CastKind::Transmute` was added having exactly these semantics before the lang meeting (which I wasn't in) independently expressed interest.
|
|
This takes a whole 3 lines in `compiler/` since it lowers to `CastKind::Transmute` in MIR *exactly* the same as the existing `intrinsics::transmute` does, it just doesn't have the fancy checking in `hir_typeck`.
Added to enable experimenting with the request in <https://github.com/rust-lang/rust/pull/106281#issuecomment-1496648190> and because the portable-simd folks might be interested for dependently-sized array-vector conversions.
It also simplifies a couple places in `core`.
|
|
|
|
Report allocation errors as panics
OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`.
This should be review one commit at a time:
- The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics.
- The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API.
ACP: https://github.com/rust-lang/libs-team/issues/192
Closes #51540
Closes #51245
|
|
Rollup of 7 pull requests
Successful merges:
- #109949 (rustdoc: migrate `document_type_layout` to askama)
- #110622 (Stable hash tag (discriminant) of `GenericArg`)
- #110635 (More `IS_ZST` in `library`)
- #110640 (compiler/rustc_target: Raise m68k-linux-gnu baseline to 68020)
- #110657 (nit: consistent naming for SimplifyConstCondition)
- #110659 (rustdoc: clean up JS)
- #110660 (Print ty placeholders pretty)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
More `IS_ZST` in `library`
I noticed that `post_inc_start` and `pre_dec_end` were doing this check in different ways
https://github.com/rust-lang/rust/blob/d19b64fb54391b64ce99981577c67c93ac2a9ffa/library/core/src/slice/iter/macros.rs#L76-L93
so started making this PR, then added a few more I found since I was already making changes anyway.
|
|
Add offset_of! macro (RFC 3308)
Implements https://github.com/rust-lang/rfcs/pull/3308 (tracking issue #106655) by adding the built in macro `core::mem::offset_of`. Two of the future possibilities are also implemented:
* Nested field accesses (without array indexing)
* DST support (for `Sized` fields)
I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it.
cc `@thomcc` (RFC author)
|
|
I noticed that `post_inc_start` and `pre_dec_end` were doing this check in different ways
https://github.com/rust-lang/rust/blob/d19b64fb54391b64ce99981577c67c93ac2a9ffa/library/core/src/slice/iter/macros.rs#L76-L93
so started making this PR, then added a few more I found since I was already making changes anyway.
|
|
`provide_sorted_batch` in core is incorrectly marked with
`#[cfg(not(no_global_oom_handling))]` which prevents core
from building with the cfg enabled.
Nothing in core allocates memory including this function, so
the `cfg` gate is incorrect.
|
|
|
|
|
|
A bunch of places were using `replace(…, &mut [])`, but that can just be `take`.
|
|
Co-authored-by: jyn <github@jyn.dev>
|
|
|
|
|
|
|
|
|
|
|
|
cmp doc examples improvements
Most changes are for stylistic consistency, with some changes to provide more clarity.
|
|
Negating a non-zero integer currently requires unpacking to a
primitive and re-wrapping. Since negation of non-zero signed
integers always produces a non-zero result, it is safe to
implement `Neg` for `NonZeroI{N}`.
The new `impl` is marked as stable because trait implementations
for two stable types can't be marked unstable.
|
|
Rm const traits in libcore
See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework)
* [x] Bless ui tests
* [ ] Re constify some unstable functions with workarounds if they are needed
|
|
with `Mutex` and `RwLock`
`Mutex` prints `<locked>` as a field value when its inner value cannot be accessed, but the lazy types print a fixed string like "`OnceCell(Uninit)`". This could cause confusion if the inner type is a unit type named `Uninit` and does not respect the pretty-printing flag. With this change, the format message is now "`OnceCell(<uninit>)`", consistent with `Mutex`.
|
|
Report more detailed reason why `Index` impl is not satisfied
Fixes #110373
|
|
|
|
5 little typos
|
|
|
|
|
|
|
|
|
|
`core::intrinsics::is_nonoverlapping`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and `unwrap` in `core::intrinsics`.
|
|
Add intra-doc links to size_of_* functions
Also some smaller doc improvements.
|
|
|
|
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
|
|
Remove some unneeded imports / qualified paths
Continuation of #105537.
|