| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
The implementation of the `Vec::extract_if` iterator violates the safety
contract adverized by `slice::from_raw_parts` by always constructing a
mutable slice for the entire length of the vector even though that span
of memory can contain holes from items already drained. The safety
contract of `slice::from_raw_parts` requires that all elements must be
properly initialized.
As an example we can look at the following code:
```rust
let mut v = vec![Box::new(0u64), Box::new(1u64)];
for item in v.extract_if(.., |x| **x == 0) {
drop(item);
}
```
In the second iteration a `&mut [Box<u64>]` slice of length 2 will be
constructed. The first slot of the slice contains the bitpattern of an
already deallocated box, which is invalid.
This fixes the issue by only creating references to valid items and
using pointer manipulation for the rest. I have also taken the liberty
to remove the big `unsafe` blocks in place of targetted ones with a
SAFETY comment. The approach closely mirrors the implementation of
`Vec::retain_mut`.
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
|
|
minor: Another regression test for next solver fixed bug
|
|
|
|
|
|
Fixes:
- applicable on underscore prefix parameter
- using binding mode as an expression
Examples
---
```rust
fn foo($0_x: i32, y: i32) {}
```
**Before this PR**:
```rust
fn foo(_x: i32, y: i32) {
let _ = _x;
}
```
**After this PR**:
Assist not applicable
---
```rust
fn foo(ref $0y: i32) {}
```
**Before this PR**:
```rust
fn foo(ref y: i32) {
let _ = ref y;
}
```
**After this PR**:
```rust
fn foo(ref y: i32) {
let _ = y;
}
```
|
|
Example
---
```rust
fn foo() {
let mut a = 1;
if true {
a = 2;
} else if true {
$0a = 3;
} else {
a = 4;
}
}
```
**Before this PR**:
```rust
fn foo() {
let mut a = 1;
if true {
a = 2;
} else a = if true {
3
} else {
4
};
}
```
**After this PR**:
```rust
fn foo() {
let mut a = 1;
a = if true {
2
} else if true {
3
} else {
4
};
}
```
|
|
|
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: 9f32ccf35fb877270bc44a86a126440f04d676d0
Filtered ref: 87b13773969f65eec6762cfe4194954e7513f59b
Upstream diff: https://github.com/rust-lang/rust/compare/2f3f27bf79ec147fec9d2e7980605307a74067f4...9f32ccf35fb877270bc44a86a126440f04d676d0
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
This updates the rust-version file to 9f32ccf35fb877270bc44a86a126440f04d676d0.
|
|
|
|
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
|
|
minor: Clarify `rust-analyzer.inlayHints.maxLength` is not a hard guarantee
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- rust-lang/rust#143857 (Port #[macro_export] to the new attribute parsing infrastructure)
- rust-lang/rust#146486 (Improve `core::sync::atomic` coverage)
- rust-lang/rust#146606 (ci: x86_64-gnu-tools: Add `--test-args` regression test)
- rust-lang/rust#146639 (std: merge definitions of `StdioPipes`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
std: merge definitions of `StdioPipes`
All platforms define this structure the same way, so we can just put it in the `process` module directly.
|
|
ci: x86_64-gnu-tools: Add `--test-args` regression test
See https://github.com/rust-lang/rust/pull/146601#issuecomment-3293179561
r? ``@Mark-Simulacrum``
|
|
Improve `core::sync::atomic` coverage
This PR improves the `core::sync::atomic` coverage by adding new tests to `coretests`.
r? libs
|
|
Port #[macro_export] to the new attribute parsing infrastructure
Ports macro_export to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
r? ``@oli-obk``
cc ``@JonathanBrouwer`` ``@jdonszelmann``
|
|
Add the initial no-std Motor OS compiler target.
Motor OS has been developed for several years in the open:
https://github.com/moturus/motor-os.
It has a more or less full implementation of Rust std library,
as well as tokio/mio ports.
Build instructions can be found here:
https://github.com/moturus/motor-os/blob/main/docs/build.md.
Signed-off-by: U. Lasiotus <lasiotus@motor-os.org>
|
|
|
|
I missed this target when I changed all the other tier 3 targets. Only
realized that this one was still statically linked when I looked at the
list of targets in the test later.
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
|
|
|
|
|
|
All platforms define this structure the same way, so we can just put it in the `process` module directly.
|
|
Correct a misspelling of RUSTC_LOG
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Consider errors in MIR as impossible predicates to empty the body.
The ICEs come from elaborating drops or performing state transform in MIR bodies that fail typeck or borrowck.
If the body is tainted, replace it with `unreachable`.
Fixes https://github.com/rust-lang/rust/issues/122630
Fixes https://github.com/rust-lang/rust/issues/122904
Fixes https://github.com/rust-lang/rust/issues/125185
Fixes https://github.com/rust-lang/rust/issues/139556
|
|
|
|
to CARGO_MANIFEST_DIR, so the config actually use the <src>/bootstrap.toml and the /tmp/bootstrap.toml
|
|
current
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using the temp directory created via the testCtx
|
|
|