| Age | Commit message (Collapse) | Author | Lines |
|
GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors
repr_transparent_external_private_fields: special-case some std types
Fixes #129470
```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #128596 (stabilize const_fn_floating_point_arithmetic)
- #129199 (make writes_through_immutable_pointer a hard error)
- #129246 (Retroactively feature gate `ConstArgKind::Path`)
- #129290 (Pin `cc` to 1.0.105)
- #129323 (Implement `ptr::fn_addr_eq`)
- #129500 (remove invalid `TyCompat` relation for effects)
- #129501 (panicking: improve hint for Miri's RUST_BACKTRACE behavior)
- #129505 (interpret: ImmTy: tighten sanity checks in offset logic)
- #129510 (Fix `elided_named_lifetimes` in code)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Put Pin::as_deref_mut in impl Pin<Ptr> / rearrange Pin methods
Tracking issue: #86918
Based on the suggestion in https://github.com/rust-lang/rust/issues/86918#issuecomment-2189367582
> Some advantages:
>
> * Synergy with the existing `as_ref` and `as_mut` signatures (stable since Rust 1.33)
>
> * Lifetime elision reduces noise in the signature
>
> * Turbofish less verbose: `Pin::<&mut T>::as_deref_mut` vs `Pin::<&mut Pin<&mut T>>::as_deref_mut`
The comment seemed to imply that `Pin::as_ref` and `Pin::as_mut` already share an impl block, which they don't. So, I rearranged it so that they do, and we can see which looks better in the docs.
<details><summary><b>Docs screenshots</b></summary>
Current nightly:

`Pin::as_deref_mut` moved into the same block as `as_mut`:

`Pin::as_ref`, `as_mut`, and `as_deref_mut` all in the same block:

</details>
I think I like the last one the most; obviously I'm biased since I'm the one who rearranged it, but it doesn't make sense to me to have `as_ref` methods split up by an `into_inner` method.
r? dtolnay
|
|
Add a special case for `CStr`/`CString` in the `improper_ctypes` lint
Revives #120176. Just needed to bless a test and fix an argument, but seemed reasonable to me otherwise.
Instead of saying to "consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct", we now tell users to "Use `*const ffi::c_char` instead, and pass the value from `CStr::as_ptr()`" when the type involved is a `CStr` or a `CString`.
The suggestion is not made for `&mut CString` or `*mut CString`.
r? ``````@cjgillot`````` (since you were the reviewer of the original PR #120176, but feel free to reroll)
|
|
This adds a minor missing feature to `fake_variadic`,
so that it can render `impl From<(T,)> for [T; 1]` correctly.
|
|
remove invalid `TyCompat` relation for effects
if the current impl uses `Maybe` (`impl const`), the parent impl must use `Maybe` (`impl const`) as well.
I'd like to rename `TyCompat` to `Sub` which is probably clearer. But it would conflict with my other PR.
r? ``@rust-lang/project-const-traits``
|
|
Implement `ptr::fn_addr_eq`
This PR implements https://github.com/rust-lang/libs-team/issues/323: `ptr::fn_addr_eq`.
r? libs
|
|
r=nnethercote
stabilize const_fn_floating_point_arithmetic
Part of https://github.com/rust-lang/rust/issues/128288
Fixes https://github.com/rust-lang/rust/issues/57241
The existing test `tests/ui/consts/const_let_eq_float.rs` ([link](https://github.com/RalfJung/rust/blob/const_fn_floating_point_arithmetic/tests/ui/consts/const_let_eq_float.rs)) covers the basics, and also Miri has extensive tests covering the interpreter's float machinery. Also, that machinery can already be used on stable inside `const`/`static` initializers, just not inside `const fn`.
This was explicitly called out in https://github.com/rust-lang/rfcs/pull/3514 so in a sense t-lang just recently already FCP'd this, but let's hear from them whether they want another FCP for the stabilization here or whether that was covered by the FCP for the RFC.
Cc ``@rust-lang/lang``
### Open items
- [x] Update the Reference: https://github.com/rust-lang/reference/pull/1566
|
|
|
|
|
|
|
|
|
|
Since `f16` now works on x86 and x86-64, change doctests to use this
instead of aarch64. This is to make sure any changes get run in PR CI.
|
|
fixes https://github.com/rust-lang/rust/issues/128857
|
|
|
|
|
|
Documents that `BikeshedIntrinsicFrom` models transmute-via-union,
which is slightly more expressive than the transmute-via-cast
implemented by `transmute_copy`. Additionally, we provide an
implementation of transmute-via-union as a method on the
`BikeshedIntrinsicFrom` trait with additional documentation on
the boundary between trait invariants and caller obligations.
Whether or not transmute-via-union is the right kind of transmute
to model remains up for discussion [1]. Regardless, it seems wise
to document the present behavior.
[1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967
|
|
Stabilize feature `char_indices_offset`
Stabilized API:
```rust
impl CharIndices<'_> {
pub fn offset(&self) -> usize;
}
```
Tracking issue: https://github.com/rust-lang/rust/issues/83871
Closes https://github.com/rust-lang/rust/issues/83871
I also attempted to improved the documentation to make it more clear that it returns the offset of the character that will be returned by the next call to `next()`.
|
|
|
|
`rustc_allow_const_fn_unstable`
|
|
Rollup of 8 pull requests
Successful merges:
- #128432 (WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}`)
- #129373 (Add missing module flags for CFI and KCFI sanitizers)
- #129374 (Use `assert_unsafe_precondition!` in `AsciiChar::digit_unchecked`)
- #129376 (Change `assert_unsafe_precondition` docs to refer to `check_language_ub`)
- #129382 (Add `const_cell_into_inner` to `OnceCell`)
- #129387 (Advise against removing the remaining Python scripts from `tests/run-make`)
- #129388 (Do not rely on names to find lifetimes.)
- #129395 (Pretty-print own args of existential projections (dyn-Trait w/ GAT constraints))
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Add `const_cell_into_inner` to `OnceCell`
`Cell` and `RefCell` have their `into_inner` methods const unstable. `OnceCell` has the same logic, so add it under the same gate.
Tracking issue: https://github.com/rust-lang/rust/issues/78729
|
|
ChaiTRex:assert_unsafe_precondition_check_language_ub, r=workingjubilee,the8472
Change `assert_unsafe_precondition` docs to refer to `check_language_ub`
|
|
ChaiTRex:digit_unchecked_assert_unsafe_precondition, r=scottmcm
Use `assert_unsafe_precondition!` in `AsciiChar::digit_unchecked`
|
|
Rollup of 9 pull requests
Successful merges:
- #127279 (use old ctx if has same expand environment during decode span)
- #127945 (Implement `debug_more_non_exhaustive`)
- #128941 ( Improve diagnostic-related lints: `untranslatable_diagnostic` & `diagnostic_outside_of_impl`)
- #129070 (Point at explicit `'static` obligations on a trait)
- #129187 (bootstrap: fix clean's remove_dir_all implementation)
- #129231 (improve submodule updates)
- #129264 (Update `library/Cargo.toml` in weekly job)
- #129284 (rustdoc: animate the `:target` highlight)
- #129302 (compiletest: use `std::fs::remove_dir_all` now that it is available)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
`unbounded_shr`/`unbounded_shl`
|
|
`Cell` and `RefCell` have their `into_inner` methods const unstable.
`OnceCell` has the same logic, so add it under the same gate.
Tracking issue: https://github.com/rust-lang/rust/issues/78729
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Change neutral element of <fNN as iter::Sum> to neg_zero
The neutral element used to be positive zero, but +0 + -0 = +0 so -0 seems better indicated.
|
|
Implement `debug_more_non_exhaustive`
This implements the ACP at https://github.com/rust-lang/libs-team/issues/248, adding `.finish_non_exhaustive()` for `DebugTuple`, `DebugSet`, `DebugList`, and `DebugMap`.
Also used this as an opportunity to make some documentation and tests more readable by using raw strings instead of escaped quotes.
Tracking issue: https://github.com/rust-lang/rust/issues/127942
|
|
Fix stability attribute of `impl !Error for &str`
It was introduced in bf7611d55ee6e24647aefc4d1c82b1dba0164536 (#99917), which was included in Rust 1.65.0.
|
|
It was introduced in bf7611d55ee6e24647aefc4d1c82b1dba0164536 (#99917),
which was included in Rust 1.65.0.
|
|
Add a precondition check for Layout::from_size_align_unchecked
Ran into this while looking into https://github.com/rust-lang/miri/issues/3679. This is of course not the cause of the ICE, but the reproducer doesn't encounter a precondition check and it ought to.
|
|
|
|
|
|
The neutral element used to be positive zero, but +0 + -0 = +0 so
-0 seems better indicated.
|
|
|
|
|
|
|
|
|
|
|