On many bindings with move error, limit the number of Spans - #159997
Merged
Conversation
Collaborator
|
rustbot has assigned @ShoyuVanilla. Use Why was this reviewer chosen?The reviewer was selected based on:
|
ShoyuVanilla
approved these changes
Jul 27, 2026
This comment has been minimized.
This comment has been minimized.
When a "can't move out of" error would point at too many places, limit the number of spans so that we don't span the terminal.
```
error[E0507]: cannot move out of `f` as enum variant `Foo1` which is behind a shared reference
--> $DIR/borrowck-move-error-many-places.rs:15:11
|
LL | match *f {
| ^^
LL | Foo::Foo1(num1,
| ---- data moved here
LL | num2) => (),
| ---- ...and here
LL | Foo::Foo2(num) => (),
| --- ...and here
LL | Foo::Foo3(num) => (),
| --- ...and here
LL | Foo::Foo4(num) => (),
| --- ...and here
|
= note: ...and 4 other places
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the dereference here
|
LL - match *f {
LL + match f {
|
```
estebank
force-pushed
the
many-move-spans
branch
from
July 27, 2026 09:06
38ce386 to
4a7d5c8
Compare
Contributor
Author
|
@bors r=ShoyuVanilla |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
…uwer Rollup of 14 pull requests Successful merges: - #160009 (`rust-analyzer` subtree update) - #159833 (ci: Make the `x86_64-gnu-parallel-frontend` job non-optional) - #158873 (applying `/Brepro` in bootstrap on MSVC and adding a run-make test.) - #159777 (Enforce that we don't generate code for comptime fns) - #159997 (On many bindings with move error, limit the number of `Span`s) - #158205 (fix: defer const normalize in coherence mode) - #159312 (Windows implementation for stdio set/take/replace) - #159772 (Fix lowering of resolved const inference variables) - #159785 (Share _Unwind_Exception definition between native and wasm) - #159968 (Fix the const impl suggestion) - #159974 (Update thinvec to 0.2.19) - #160013 (tests/ui: Ignore one query cycle test in parallel frontend mode) - #160016 (compiletest: do not talk about JSON when the user never sees any) - #160018 (test suite: add ARM case to ABI-required target feature check for -Ctarget-cpu)
rust-timer
added a commit
that referenced
this pull request
Jul 27, 2026
Rollup merge of #159997 - estebank:many-move-spans, r=ShoyuVanilla On many bindings with move error, limit the number of `Span`s When a "can't move out of" error would point at too many places, limit the number of spans so that we don't spam the terminal. ``` error[E0507]: cannot move out of `f` as enum variant `Foo1` which is behind a shared reference --> $DIR/borrowck-move-error-many-places.rs:15:11 | LL | match *f { | ^^ LL | Foo::Foo1(num1, | ---- data moved here LL | num2) => (), | ---- ...and here LL | Foo::Foo2(num) => (), | --- ...and here LL | Foo::Foo3(num) => (), | --- ...and here LL | Foo::Foo4(num) => (), | --- ...and here | = note: ...and 4 other places = note: move occurs because these variables have types that don't implement the `Copy` trait help: consider removing the dereference here | LL - match *f { LL + match f { | ```
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.
When a "can't move out of" error would point at too many places, limit the number of spans so that we don't spam the terminal.