Rollup of 6 pull requests#126815
Closed
matthiaskrgr wants to merge 15 commits intorust-lang:masterfrom
Closed
Conversation
…hecked_raw in allocation.rs; add pub fn get_alloc_bytes_unchecked_raw[_mut] in memory.rs
We are still at Python 3.8 in Fuchsia infra. This was introduced at Python 3.10.
This trait allows cloning DSTs, but is unsafe to implement and use because it writes to possibly-uninitialized memory which must be of the correct size, and must initialize that memory. It is only implemented for `T: Clone` and `[T] where T: Clone`, but additional implementations could be provided for specific `dyn Trait` or custom-DST types.
This requires introducing a new internal type `RcUninit` (and `ArcUninit`), which can own an `RcBox<T>` without requiring it to be initialized, sized, or a slice. This is similar to `UniqueRc`, but `UniqueRc` doesn't support the allocator parameter, and there is no `UniqueArc`.
Generalize `{Rc,Arc}::make_mut()` to unsized types.
* `{Rc,Arc}::make_mut()` now accept any type implementing the new unstable trait `core::clone::CloneToUninit`.
* `CloneToUninit` is implemented for `T: Clone` and for `[T] where T: Clone`.
* `CloneToUninit` is a generalization of the existing internal trait `alloc::alloc::WriteCloneIntoRaw`.
* New feature gate: `clone_to_uninit`
This allows performing `make_mut()` on `Rc<[T]>` and `Arc<[T]>`, which was not previously possible.
---
Previous PR description, now obsolete:
> Add `{Rc, Arc}::make_mut_slice()`
>
> These functions behave identically to `make_mut()`, but operate on `Arc<[T]>` instead of `Arc<T>`.
>
> This allows performing the operation on slices, which was not previously possible because `make_mut()` requires `T: Clone` (and slices, being `!Sized`, do not and currently cannot implement `Clone`).
>
> Feature gate: `make_mut_slice`
Add method to get `FnAbi` of function pointer Provide a StableMIR API to query `FnAbi` of a function pointer. Fixes [rust-lang/project-stable-mir#63](rust-lang/project-stable-mir#63)
Add direct accessors for memory addresses in `Machine` (for Miri)
The purpose of this PR is to enable direct (immutable) access to memory addresses in `Machine`, which will be needed for further extension of Miri.
This is done by adding (/completing missings pairs of) accessor functions, with the relevant signatures as follows:
```rust
/* rust/compiler/rustc_middle/src/mir/interpret/allocation.rs */
pub trait AllocBytes {
// ..
fn as_ptr(&self) -> *const u8;
/*fn as_mut_ptr(&mut self) -> *mut u8; -- Already in the compiler*/
}
impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes> {
// ..
pub fn get_bytes_unchecked_raw(&self) -> *const u8;
/*pub fn get_bytes_unchecked_raw_mut(&mut self) -> *mut u8; -- Already in the compiler*/
}
```
```rust
/* rust/compiler/rustc_const_eval/src/interpret/memory.rs */
impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// ..
pub fn get_alloc_bytes_unchecked_raw(&self, id: AllocId) -> InterpResult<'tcx, *const u8>;
pub fn get_alloc_bytes_unchecked_raw_mut(&mut self, id: AllocId) -> InterpResult<'tcx, *mut u8>;
}
```
r? `@RalfJung`
[fuchsia-test-runner] Remove usage of kw_only We are still at Python 3.8 in Fuchsia infra. This was introduced at Python 3.10. r? tmandry r? erickt
Remove stray `.` from error message
Add a tidy rule to check that fluent messages and attrs don't end in `.` This adds a new dependency on `fluent-parse` to `tidy` -- we already rely on it in rustc so I feel like it's not that big of a deal. This PR also adjusts many error messages that currently end in `.`; not all of them since I added an `ALLOWLIST`, excluded `rustc_codegen_*` ftl files, and `.teach_note` attributes. r? `@estebank` `@oli-obk`
Member
Author
|
@bors r+ rollup=never p=6 |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 22, 2024
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#116113 ( Generalize `{Rc,Arc}::make_mut()` to unsized types.) - rust-lang#126722 (Add method to get `FnAbi` of function pointer) - rust-lang#126787 (Add direct accessors for memory addresses in `Machine` (for Miri)) - rust-lang#126798 ([fuchsia-test-runner] Remove usage of kw_only) - rust-lang#126809 (Remove stray `.` from error message) - rust-lang#126811 (Add a tidy rule to check that fluent messages and attrs don't end in `.`) r? `@ghost` `@rustbot` modify labels: rollup
Collaborator
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Collaborator
|
💔 Test failed - checks-actions |
Member
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 22, 2024
Rollup of 6 pull requests Successful merges: - rust-lang#116113 ( Generalize `{Rc,Arc}::make_mut()` to unsized types.) - rust-lang#126722 (Add method to get `FnAbi` of function pointer) - rust-lang#126787 (Add direct accessors for memory addresses in `Machine` (for Miri)) - rust-lang#126798 ([fuchsia-test-runner] Remove usage of kw_only) - rust-lang#126809 (Remove stray `.` from error message) - rust-lang#126811 (Add a tidy rule to check that fluent messages and attrs don't end in `.`) r? `@ghost` `@rustbot` modify labels: rollup try-job: test-various
Member
|
rerunning test-various to see if that failure repros. not sure why. there's nothing that screams "I'm going to fail on specifically wasm". |
Member
|
wait, I think I know which... |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Collaborator
|
💔 Test failed - checks-actions |
Member
|
nice, does repro. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
{Rc,Arc}::make_mut()to unsized types. #116113 ( Generalize{Rc,Arc}::make_mut()to unsized types.)FnAbiof function pointer #126722 (Add method to getFnAbiof function pointer)Machine(for Miri) #126787 (Add direct accessors for memory addresses inMachine(for Miri)).from error message #126809 (Remove stray.from error message).#126811 (Add a tidy rule to check that fluent messages and attrs don't end in.)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup
try-job: test-various