| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Fix indent for convert_match_to_let_else
|
|
Add guard to let-chain for replace_match_with_if_let
|
|
```rust
fn main() {
match$0 Some(0) {
Some(n) if n % 2 == 0 && n != 6 => (),
_ => code(),
}
}
```
->
```rust
fn main() {
if let Some(n) = Some(0) && n % 2 == 0 && n != 6 {
()
} else {
code()
}
}
|
|
Example
---
```
//- minicore: option
fn f() {
let x$0 = match Some(()) {
Some(it) => it,
None => {//comment
println!("nope");
return
},
};
}
```
**Old output**:
```rust
fn f() {
let Some(x) = Some(()) else {//comment
println!("nope");
return
};
}
```
**This PR output**:
```rust
fn f() {
let Some(x) = Some(()) else {//comment
println!("nope");
return
};
}
```
|
|
Add if..else completions in LetStmt and ArgList
|
|
Fix dead link to Cargo.toml in documentation
|
|
[internal] Update to the latest @vscode/vsce for extension build
|
|
This isn't a logic change, but it fixes an npm warning during the
build. vsce itself hasn't had any major changes between 3.2.2 and 3.6.
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.3.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.4.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.5.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.6.0
|
|
../../Cargo.toml resolves to https://rust-analyzer.github.io/Cargo.toml, which is an invalid link
|
|
next-solver fun time
|
|
|
|
|
|
|
|
Merge Trait and TraitAlias handling
|
|
fix: Attach db for inlay hint compute
|
|
|
|
minor: Print fields of interned IDs in hir-ty instead of just the ID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Switch from Chalk to the next trait solver
|
|
sgasho/fix/20215_implement_default_member_to_resolve_ident_pat
Fix "Implement default members" to resolve IdentPat
|
|
|
|
fix: Panic while trying to clear old diagnostics while there's nothing
|
|
|
|
feat: Add Config Option to Exclude Locals from Document Symbol Search
|
|
hotfix: Update flycheck diagnostics generation
|
|
|
|
Rustc pull update
|
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: 21a19c297d4f5a03501d92ca251bd7a17073c08a
Filtered ref: 9a5c1fb93028e1a29a7598ce782efb0c5d7be534
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
This updates the rust-version file to 21a19c297d4f5a03501d92ca251bd7a17073c08a.
|
|
Detect struct construction with private field in field with default
When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.
```
error[E0603]: struct `Priv1` is private
--> $DIR/non-exhaustive-ctor-2.rs:19:39
|
LL | let _ = S { field: (), field1: m::Priv1 {} };
| ------ ^^^^^ private struct
| |
| while setting this field
|
note: the struct `Priv1` is defined here
--> $DIR/non-exhaustive-ctor-2.rs:14:4
|
LL | struct Priv1 {}
| ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
|
LL | let _ = S { field: (), .. };
| ~~
```
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#144553 (Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
- rust-lang/rust#145064 (Add regression test for `saturating_sub` bounds check issue)
- rust-lang/rust#145121 (bootstrap: `x.py dist rustc-src` should keep LLVM's siphash)
- rust-lang/rust#145150 (Replace unsafe `security_attributes` function with safe `inherit_handle` alternative)
- rust-lang/rust#145152 (Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`)
- rust-lang/rust#145200 (mbe: Fix typo in attribute tracing)
- rust-lang/rust#145222 (Fix typo with paren rustc_llvm/build.rs)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix typo with paren rustc_llvm/build.rs
The current parenthesis looks suspect: it means that OpenHarmony is always excluded whereas it looks like it was intended to only be excluded if the architecture was Arm.
Since Rust doesn't support the other architectures with OpenHarmony, there currently isn't a bug but this cleans up some suspicious code and avoids a potential future annoyance for someone trying to bring up a new triple.
r? `@Amanieu`
|
|
mbe: Fix typo in attribute tracing
|
|
Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`
A small optimization has been made, using `to_ascii_lowercase()` instead of `to_lowercase().to_string()`.
r? compiler
|
|
Replace unsafe `security_attributes` function with safe `inherit_handle` alternative
The `security_attributes` function is marked as safe despite taking a raw pointer which will later be used. Fortunately this function is only used internally and only in one place that has been basically the same for a decade now. However, we only ever set one bool so it's easy enough to replace with something that's actually safe.
In the future we might want to expose the ability for users to set security attributes. But that should be properly designed (and safe!).
|
|
lambdageek:dist-must-keep-llvm-third-party-siphash, r=Kobzol
bootstrap: `x.py dist rustc-src` should keep LLVM's siphash
Fixes rust-lang/rust#145117
|
|
Add regression test for `saturating_sub` bounds check issue
Add codegen test for issue where `valid_index.saturating_sub(X)` produced an extra bounds check.
This was fixed by the LLVM upgrade.
Closes rust-lang/rust#139759
|
|
Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`
rust-lang/rust#143902 divided into smaller, easier to review chunks.
Part of rust-lang/rust#133895
Methodology:
1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer
Inspired by the methodology that `@Kivooeo` was using.
r? `@jieyouxu`
|
|
|
|
|
|
When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.
```
error[E0603]: struct `Priv1` is private
--> $DIR/non-exhaustive-ctor.rs:25:39
|
LL | let _ = S { field: (), field1: m::Priv1 {} };
| ------ ^^^^^ private struct
| |
| while setting this field
|
note: the struct `Priv1` is defined here
--> $DIR/non-exhaustive-ctor.rs:14:4
|
LL | struct Priv1 {}
| ^^^^^^^^^^^^
help: the field `field1` you're trying to set has a default value, you can use `..` to use it
|
LL | let _ = S { field: (), .. };
| ~~
```
|
|
Start reporting future breakage for `ILL_FORMED_ATTRIBUTE_INPUT` in dependencies
This has been a warn lint since early 2019 and a deny-by-default lint since late 2019.
We're currently transitioning some of the cases where this lint is being produced to a hard error (https://github.com/rust-lang/rust/pull/143607 https://github.com/rust-lang/rust/pull/143808 and more)
So let's report this lint in all dependencies for the remaining attributes
r? `@traviscross`
`@rustbot` labels +I-lang-nominated +T-lang -T-compiler
cc `@jdonszelmann`
(Separate question: Why does the "Future incompatibility report" only trigger if `report_in_deps` is true, even if the future incompatibility happens in the same crate, is this correct?)
This also needs a crater run, but I don't have permissions to trigger this
|