diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-07-20 02:22:55 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-07-21 16:21:23 +0000 |
| commit | 8df93e6966e71da8a249a0022680b83eff105f42 (patch) | |
| tree | 9208683bd104beb777378e9451f2dbdb7c67848e /tests/codegen/issues/issue-98678-enum.rs | |
| parent | 5082e6a300974459aec6dc73e76cc039c3a517c1 (diff) | |
| download | rust-8df93e6966e71da8a249a0022680b83eff105f42.tar.gz rust-8df93e6966e71da8a249a0022680b83eff105f42.zip | |
Tweak spans when encountering multiline initializer in move error
```
error[E0507]: cannot move out of `f`, a captured variable in an `FnMut` closure
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:57:13
|
LL | let mut f = move |g: Box<dyn FnMut(isize)>, b: isize| {
| ----- captured outer variable
...
LL | f(Box::new(|a| {
| --- captured by this `FnMut` closure
LL |
LL | foo(f);
| ^ move occurs because `f` has type `{closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 52:58}`, which does not implement the `Copy` trait
```
instead of
```
error[E0507]: cannot move out of `f`, a captured variable in an `FnMut` closure
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:57:13
|
LL | let mut f = move |g: Box<dyn FnMut(isize)>, b: isize| {
| _________-----___-
| | |
| | captured outer variable
LL | | let _ = s.len();
LL | | };
| |_____- move occurs because `f` has type `{closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 52:58}`, which does not implement the `Copy` trait
LL | f(Box::new(|a| {
| --- captured by this `FnMut` closure
LL |
LL | foo(f);
| ^ `f` is moved here
```
Diffstat (limited to 'tests/codegen/issues/issue-98678-enum.rs')
0 files changed, 0 insertions, 0 deletions
