| Age | Commit message (Collapse) | Author | Lines |
|
Example
---
```rust
fn foo<c$0>() {}
```
->
```rust
fn foo<const $1: $0>() {}
```
|
|
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#146795 (Enable `limit_rdylib_exports` on wasm targets)
- rust-lang/rust#146828 (fix a crash in rustdoc merge finalize without input file)
- rust-lang/rust#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
- rust-lang/rust#146884 (Fix modification check of `rustdoc-json-types`)
- rust-lang/rust#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Fix closure in match not applicable for add_braces
|
|
Fix complete type in nested pattern
|
|
Fix apply in inner if for pull_assignment_up
|
|
Fix applicable on underscore for bind_unused_param
|
|
fix: Fix lifetime elision handling for `Fn`-style trait bounds
|
|
internal: Migrate more predicate things to next-solver
|
|
|
|
Mark float intrinsics with no preconditions as safe
Note: for ease of reviewing, the list of safe intrinsics is sorted in the first commit, and then safe intrinsics are added in the second commit.
All *recently added* float intrinsics have been correctly marked as safe to call due to the fact that they have no preconditions. This adds the remaining float intrinsics which are safe to call to the safe intrinsic list, and removes the unsafe blocks around their calls.
---
Side note: this may want a try run before being added to the queue, since I'm not sure if there's any tier-2 code that uses these intrinsics that might not be tested on the usual PR flow. We've already uncovered a few places in subtrees that do this, and it's worth double-checking before clogging up the queue.
|
|
Two fixes were needed:
1. Previously, we enabled elision for the generic args of `Fn` itself, instead of for generic args of paths within it.
2. In lowering in the new solver the `Output` parameter did not have elision set correctly, I don't know why. In the old lowering it was done correctly.
|
|
|
|
|
|
|
|
TB: update terminology to match paper & MiniRust
|
|
|
|
|
|
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
};
}
```
|
|
|
|
|
|
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``
|
|
|
|
Co-authored-by: Anne Stijns <anstijns@gmail.com>
|
|
|
|
|
|
|
|
|
|
`remove_dbg` not applicable for whitespaces after trailing comma
Example
---
```rust
fn foo() {
dbg!(
bar(),
);
}
```
**Before this PR**:
Assist not applicable
**After this PR**:
```rust
fn foo() {
bar();
}
```
|
|
Fix and provide instructions for running test suite on Apple simulators
The following now works:
```sh
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo
```
I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit).
I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device.
The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host.
I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries.
r? jieyouxu
CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
|
|
|
|
Fix to implements in-place stdx::replace
|
|
|
|
Fix IfExpr branches suggests
|
|
|
|
- And add logic operation suggest
Example
---
In the old implementation, it always suggested conditions,
this is a lot of noise, e.g `contract_checks()~(use std::intrinsics::contract_checks) const fn() -> bool`
```rust
fn foo() {
if true {
c$0
}
}
```
|
|
Fix unused_variables fixes shorthand record field
|
|
A4-Tacks/destruct-panic-on-not-add-deref-and-paren
Fix panic `!self.data().mutable` for destructure_struct_binding
|
|
Fix selected applicable generate_default_from_enum_variant
|
|
fix: Make flycheck clearing dependency-aware
|
|
|
|
A4-Tacks/fix-applicable-after-l-curly-replace-is-method-with-if-let
Fix applicable after l_curly for replace_is_method_with_if_let_method
|