rust/compiler
bors 9f2e753b2f 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
2021-07-11 03:50:28 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_ast_lowering Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa 2021-07-11 01:06:58 +00:00
rustc_ast_passes
rustc_ast_pretty Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_attr Enhance well-formedness checks for #[repr(...)] attributes 2021-07-09 22:03:48 +02:00
rustc_builtin_macros
rustc_codegen_cranelift Use cranelift's Type::int instead of doing the match myself 2021-07-08 14:55:58 -07:00
rustc_codegen_llvm Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa 2021-07-11 01:06:58 +00:00
rustc_codegen_ssa Auto merge of #86873 - nikic:opaque-ptrs, r=nagisa 2021-07-10 19:01:41 +00:00
rustc_data_structures
rustc_driver
rustc_error_codes Rollup merge of #86838 - lambinoo:I-69630-rust_const_unstable_check_const, r=oli-obk 2021-07-08 18:30:34 +02:00
rustc_errors Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_expand Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_feature remove const_raw_ptr_to_usize_cast feature 2021-07-10 12:08:58 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis 2021-07-08 18:30:33 +02:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer
rustc_interface Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_lexer
rustc_lint Auto merge of #86968 - inquisitivecrystal:missing-docs-v2, r=oli-obk 2021-07-10 03:32:42 +00:00
rustc_lint_defs
rustc_llvm Pass type when creating atomic load 2021-07-09 22:00:19 +02:00
rustc_macros
rustc_metadata Add support for raw-dylib with stdcall, fastcall functions on i686-pc-windows-msvc. 2021-07-09 12:04:54 -07:00
rustc_middle Auto merge of #87029 - JohnTitor:rollup-0yapv7z, r=JohnTitor 2021-07-10 16:41:26 +00:00
rustc_mir Rollup merge of #87028 - aDotInTheVoid:patch-1, r=petrochenkov 2021-07-11 01:15:43 +09:00
rustc_mir_build remove const_raw_ptr_to_usize_cast feature 2021-07-10 12:08:58 +02:00
rustc_parse Rollup merge of #86932 - rylev:fix-ice-86895, r=estebank 2021-07-08 10:44:34 +09:00
rustc_parse_format Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_passes Rollup merge of #86838 - lambinoo:I-69630-rust_const_unstable_check_const, r=oli-obk 2021-07-08 18:30:34 +02:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve
rustc_save_analysis
rustc_serialize
rustc_session
rustc_span Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa 2021-07-11 01:06:58 +00:00
rustc_symbol_mangling
rustc_target Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa 2021-07-11 01:06:58 +00:00
rustc_trait_selection Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis 2021-07-08 18:30:33 +02:00
rustc_traits
rustc_ty_utils
rustc_type_ir
rustc_typeck Auto merge of #86965 - sexxi-goose:rfc2229-improve-lint, r=nikomatsakis,lqd 2021-07-11 03:50:28 +00:00