about summary refs log tree commit diff
path: root/library/std/src/os/linux/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-11 03:50:28 +0000
committerbors <bors@rust-lang.org>2021-07-11 03:50:28 +0000
commit9f2e753b2fd1f614c64ba451ff816f50a3ac2edd (patch)
treefdc8ab47b9a2482b94bd24d5f715afba918f1189 /library/std/src/os/linux/mod.rs
parent99f8efec46c72cb11418f858ae142baa5f3582a9 (diff)
parent08c616741c6eff64443cc50d2ec8db9663ff61d8 (diff)
downloadrust-9f2e753b2fd1f614c64ba451ff816f50a3ac2edd.tar.gz
rust-9f2e753b2fd1f614c64ba451ff816f50a3ac2edd.zip
Auto merge of #86965 - sexxi-goose:rfc2229-improve-lint, r=nikomatsakis,lqd
Improves migrations lint for RFC2229

This PR improves the current disjoint capture migration lint by providing more information on why drop order or auto trait implementation for a closure is impacted by the use of the new feature.

The drop order migration lint will now look something like this:
```
error: changes to closure capture in Rust 2021 will affect drop order
  --> $DIR/significant_drop.rs:163:21
   |
LL |             let c = || {
   |                     ^^
...
LL |                 tuple.0;
   |                 ------- in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
...
LL |         }
   |         - in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
```

The auto trait migration lint will now look something like this:
```
error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure
  --> $DIR/auto_traits.rs:14:19
   |
LL |     thread::spawn(move || unsafe {
   |                   ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send`
...
LL |         *fptr.0 = 20;
   |         ------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
```

r? `@nikomatsakis`

Closes https://github.com/rust-lang/project-rfc-2229/issues/54
Diffstat (limited to 'library/std/src/os/linux/mod.rs')
0 files changed, 0 insertions, 0 deletions