Rollup of 17 pull requests#152400
Closed
JonathanBrouwer wants to merge 96 commits intorust-lang:mainfrom
Closed
Conversation
Example
---
```rust
fn main() {
match 92 {
x @ 0..30 $0if x % 3 == 0 => false,
x @ 0..30 if x % 2 == 0 => true,
_ => false
}
}
```
**Before this PR**
```rust
fn main() {
match 92 {
x @ 0..30 => if x % 3 == 0 {
false
},
x @ 0..30 if x % 2 == 0 => true,
_ => false
}
}
```
**After this PR**
```rust
fn main() {
match 92 {
x @ 0..30 => if x % 3 == 0 {
false
} else if x % 2 == 0 {
true
},
_ => false
}
}
```
The derived `T: Copy` constraint is not appropriate for an iterator by reference, but we generally do not want `Copy` on iterators anyway.
This implementation doesn't need the derived `T: Clone`.
Easy to input other patterns, or bind variable in let-chain
Example
---
```rust
fn main() {
let bar = 2;
if bar.$0
}
```
**Before this PR**
No complete 'let'
**After this PR**
```rust
fn main() {
let bar = 2;
if let $1 = bar
}
```
fix: Fix more glob issues
Remove outdated SyntaxErrorKind FIXME comment
And refactor the mechanism to be more maintainable.
CargoCheckMessage and CargoCheckParser were misleading, because they could apply to any tool that emits diagnostics. For example, it may be rustc directly rather than via cargo. Clarify this in the names. This is most noticeable when working on custom check commands in rust-project.json.
PR rust-lang#18043 changed flycheck to be scoped to the relevant package. This broke projects using check commands that invoke rustc directly, because diagnostic JSON from rustc doesn't contain the package ID. This was visible in the rust-analyzer logs when RA_LOG is set to `rust_analyzer::flycheck=trace`. Before: 2026-02-02T07:03:48.020184937-08:00 TRACE diagnostic received flycheck_id=0 mismatched types package_id=None scope=Workspace ... 2026-02-02T07:03:55.082046488-08:00 TRACE clearing diagnostics flycheck_id=0 scope=Workspace After: 2026-02-02T07:14:32.760707785-08:00 TRACE diagnostic received flycheck_id=0 mismatched types package_id=None scope=Package { package: BuildInfo { label: "fbcode//rust_devx/rust-guess-deps:rust-guess-deps" }, workspace_deps: Some({}) } ... 2026-02-02T07:14:48.355981415-08:00 TRACE clearing diagnostics flycheck_id=0 scope=Package { package: BuildInfo { label: "fbcode//rust_devx/rust-guess-deps:rust-guess-deps" }, workspace_deps: Some({}) } Previously r-a assumed that a diagnostic without a package ID applied to the whole workspace. We would insert the diagnostic at the workspace level, but then only clear diagnostics for the package. As a result, red squiggles would get 'stuck'. Users who had fixed compilation issues would still see the old red squiggles until they introduced a new compilation error. Instead, always apply diagnostics to the current package if flycheck is scoped to a package and the diagnostic doesn't specify a package. This makes CargoCheckEvent(None) and CargoCheckEvent(Some(_)) more consistent, as they now both match on scope.
Since we can't read the real file size.
Implement the new homogeneous & heterogeneous try blocks
…date minor: Remove unnecessary `unsafe(non_update_types)`
feat: fallback let postfix completions in condition
Support else-branch for move_guard
The usage of normal `display()` caused it to emit `{unknown}` which then failed to parse in `make::ty()`.
Really we should not use stringly-typed things here, but that's a change for another day.
Have a separate query for it.
Unfortunately it obscures bugs, but it's necessary because of malformed code.
…custom-targets, r=scottmcm compiletest: `-Zunstable-options` for json targets bootstrap runs compiletest with synthetic custom targets when blessing `mir-opt` tests, but that no longer works after rust-lang#150151/rust-lang#151534 because `-Zunstable-options` is required Contexts on [Zulips](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/custom.20targets.20are.20unstable.20and.20require.20.60-Zunstable-options.60).
…enkov Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented compiler/rustc_trait_selection/src/traits/vtable.rs@`vtable_entries`: The impossible predicates check in `vtable_entries` used `instantiate_own` which only includes the method's own `where` clauses, without the parent trait's bounds. Replace it with `instantiate_and_check_impossible_predicates` which also checks the trait ref itself, so unsatisfied supertrait bounds are caught and the method is marked `Vacant` instead of ICEing. Closes rust-lang#137190. Closes rust-lang#135470.
fix: sup_trace to sub_trace This looks like a copy-past here from the line above.
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
…ait_impls, r=tgross35 Add some conversion trait impls - `impl<T, const N: usize> From<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc rust-lang#96097) - `impl<T, const N: usize> AsRef<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc rust-lang#96097) - `impl<T, const N: usize> AsRef<[MaybeUninit<T>]> for MaybeUninit<[T; N]>` (cc rust-lang#96097) - `impl<T, const N: usize> AsMut<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc rust-lang#96097) - `impl<T, const N: usize> AsMut<[MaybeUninit<T>]> for MaybeUninit<[T; N]>` (cc rust-lang#96097) - `impl<T, const N: usize> From<MaybeUninit<[T; N]>> for [MaybeUninit<T>; N]` (cc rust-lang#96097) - `impl<T, const N: usize> AsRef<[Cell<T>; N]> for Cell<[T; N]>` (equivalent of `as_array_of_cells`, cc rust-lang#88248) - `impl<T, const N: usize> AsRef<[Cell<T>]> for Cell<[T; N]>` - `impl<T> AsRef<[Cell<T>]> for Cell<[T]>` (equivalent of `as_slice_of_cells`) @rustbot label T-libs-api needs-fcp -T-libs I’ve tried to only add impls that are unlikely to cause single-applicable-impl inference breakage.
rustc_parse_format: improve diagnostics for unsupported debug = syntax
Detect Python-style f-string debug syntax in format strings and emit a
clear diagnostic explaining that it is not supported in Rust. When the
intended operation can be inferred, suggest the corresponding Rust
alternative (e.g. `dbg!` for `{x=}`).
Update to Xcode 26.2
Update our CI to run with Xcode 26.
This means that:
- LLVM will be built with a newer Clang version (before Apple Clang 15, now Apple Clang 17).
- Our binaries (e.g. `rustc` and `libstd*.dylib`) will have their SDK version raised (before macOS 14.5, now 26.2).
- Our binaries will be built with a newer linker (before 1053.12, now 1230.1).
The last two points can be observed with:
```sh
$ vtool -show-build ./build/host/stage1/bin/rustc
Load command 10
cmd LC_BUILD_VERSION
cmdsize 32
platform MACOS
minos 11.0
sdk 26.2
ntools 1
tool LD
version 1230.1
$ vtool -show-build ./build/host/stage1/lib/rustlib/aarch64-apple-darwin/lib/libstd*.dylib
Load command 9
cmd LC_BUILD_VERSION
cmdsize 32
platform MACOS
minos 11.0
sdk 26.2
ntools 1
tool LD
version 1230.1
```
This shouldn't have much of an effect, but things like `dyld` is known to inspect the SDK version, so it _might_ expose some latent bugs (I really don't expect it to though).
This also updates the macOS runners to run on macOS 15 (the macOS 14 runners only have up to Xcode 16.2 available). That is desirable anyhow, as [the macOS 14 runners will be deprecated in July](actions/runner-images#13518). This is probably also required for rust-lang#147192.
r? shepmaster
Port rustc_no_implicit_bounds attribute to parser. Tracking Issue: rust-lang#131229 r? @JonathanBrouwer
fix: rhs_span to rhs_span_new
…es-ready, r=lcnr Check stalled coroutine obligations eagerly Fixes rust-lang#151322 Fixes rust-lang#151323 Fixes rust-lang#137916 Fixes rust-lang#138274 The problem is that stalled coroutine obligations can't be satisifed so that they cause normalization to fail in `mir_borrowck`. Thus, we failed to register any opaque to storage in the next solver. I fix it by checking these obligations earlier in `mir_borrowck`. r? @lcnr
…ercote Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash` `JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics. The new name and comments should hopefully be clearer about its (limited) role. I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`. r? nnethercote (or compiler)
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
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:
rust-analyzersubtree update #152388 (rust-analyzersubtree update)ArrayWindowstrait impls withWindows#151613 (AlignArrayWindowstrait impls withWindows)asm!()args that are macros #152157 (Fix error spans forasm!()args that are macros)proc_macro::bridge#152166 (cleanup some more things inproc_macro::bridge)-Zunstable-optionsfor json targets #152236 (compiletest:-Zunstable-optionsfor json targets)std::path#142957 (std: introduce path normalize methods at top ofstd::path)JobOwnertoActiveJobGuard, and includekey_hash#152377 (Rename the query system'sJobOwnertoActiveJobGuard, and includekey_hash)r? @ghost
Create a similar rollup