Skip to content

On many bindings with move error, limit the number of Spans - #159997

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:many-move-spans
Jul 27, 2026
Merged

On many bindings with move error, limit the number of Spans#159997
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:many-move-spans

Conversation

@estebank

@estebank estebank commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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 {
   |

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 27, 2026
@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

r? @ShoyuVanilla

rustbot has assigned @ShoyuVanilla.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 74 candidates
  • Random selection from 18 candidates

@ShoyuVanilla ShoyuVanilla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me when CI is green

View changes since this review

@rust-log-analyzer

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

Copy link
Copy Markdown
Contributor Author

@bors r=ShoyuVanilla

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4a7d5c8 has been approved by ShoyuVanilla

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious failures

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2026
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-bors
rust-bors Bot merged commit fccf88e into rust-lang:main Jul 27, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 27, 2026
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 {
   |
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants