2021-11-04 17:44:29 -04:00
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
2021-09-21 04:05:11 -04:00
--> $DIR/auto_traits.rs:22:19
2021-04-08 19:09:08 -04:00
|
2021-07-07 18:47:32 -04:00
LL | thread::spawn(move || unsafe {
2022-06-27 07:45:35 +02:00
| ^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send`
2021-07-07 18:47:32 -04:00
...
LL | *fptr.0 = 20;
2021-08-12 21:13:00 +02:00
| ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
2021-04-08 19:09:08 -04:00
|
2022-09-18 19:55:36 +04:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2021-04-08 19:09:08 -04:00
note: the lint level is defined here
--> $DIR/auto_traits.rs:2:9
|
2021-06-29 15:35:15 +02:00
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2021-04-08 19:09:08 -04:00
help: add a dummy let to cause `fptr` to be fully captured
|
2021-06-21 19:07:19 -07:00
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
2021-08-12 12:17:35 +02:00
LL |
2021-07-07 10:29:06 -04:00
...
2022-06-06 19:26:50 +04:00
LL |
2023-02-12 14:37:09 -05:00
LL ~ } }).join().unwrap();
2022-06-06 19:26:50 +04:00
|
2021-04-08 19:09:08 -04:00
2021-11-04 17:44:29 -04:00
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
2021-09-21 04:05:11 -04:00
--> $DIR/auto_traits.rs:42:19
2021-04-08 19:09:08 -04:00
|
2021-07-07 18:47:32 -04:00
LL | thread::spawn(move || unsafe {
2022-06-27 07:45:35 +02:00
| ^^^^^^^
2021-11-04 17:44:29 -04:00
| |
2021-11-05 12:43:42 -04:00
| in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0.0` does not implement `Send`
2022-05-03 19:17:57 -07:00
| in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync`
2021-07-07 18:47:32 -04:00
...
LL | *fptr.0.0 = 20;
2021-08-12 21:13:00 +02:00
| --------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`
2021-04-08 19:09:08 -04:00
|
2021-06-27 16:54:48 +00:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2021-04-08 19:09:08 -04:00
help: add a dummy let to cause `fptr` to be fully captured
|
2021-06-21 19:07:19 -07:00
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
2021-11-04 17:44:29 -04:00
LL |
2021-07-07 10:29:06 -04:00
...
2022-06-06 19:26:50 +04:00
LL |
2023-02-12 14:37:09 -05:00
LL ~ } }).join().unwrap();
2022-06-06 19:26:50 +04:00
|
2021-04-08 19:09:08 -04:00
2021-11-04 17:44:29 -04:00
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/auto_traits.rs:67:13
2021-04-08 19:09:08 -04:00
|
2021-07-07 18:47:32 -04:00
LL | let c = || {
2021-11-05 12:43:42 -04:00
| ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f` is not fully captured and `f.1` does not implement `Clone`
2021-07-07 18:47:32 -04:00
...
LL | let f_1 = f.1;
2021-08-12 21:13:00 +02:00
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1`
2021-07-07 10:29:06 -04:00
...
2021-07-07 18:47:32 -04:00
LL | }
2021-08-12 21:13:00 +02:00
| - in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure
2021-04-08 19:09:08 -04:00
|
2021-06-27 16:54:48 +00:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2021-04-08 19:09:08 -04:00
help: add a dummy let to cause `f` to be fully captured
|
2021-08-12 11:23:48 +02:00
LL ~ let c = || {
LL + let _ = &f;
2021-08-12 12:17:35 +02:00
|
2021-04-08 19:09:08 -04:00
error: aborting due to 3 previous errors