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 use jemallocator in rustc/rustdoc 2021-04-04 14:10:26 -07:00
rustc_apfloat Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
rustc_arena Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
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 Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco 2021-06-17 06:34:12 +00:00
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 Auto merge of #86599 - Amanieu:asm_raw, r=nagisa 2021-06-25 20:44:28 +00:00
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_data_structures: Drop unused dependency on crossbeam-utils 2021-06-25 01:03:16 -07:00
rustc_driver Auto merge of #80182 - in42:stack_trace, r=tmandry 2021-07-02 05:40:51 +00:00
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 Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
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 Rollup merge of #86358 - klensy:pp-loop, r=Mark-Simulacrum 2021-06-29 00:26:55 +09:00
rustc_incremental Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_index Remove unused feature gates 2021-05-31 13:55:43 +02:00
rustc_infer remove unused Option 2021-07-04 11:09:32 -04:00
rustc_interface Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_lexer Rename 'bad prefix' to 'unknown prefix'. 2021-06-26 23:11:14 +08:00
rustc_lint Auto merge of #86968 - inquisitivecrystal:missing-docs-v2, r=oli-obk 2021-07-10 03:32:42 +00:00
rustc_lint_defs rename rust_2021_token_prefixes to rust_2021_prefixes_incompatible_syntax 2021-07-06 20:13:36 +02:00
rustc_llvm Pass type when creating atomic load 2021-07-09 22:00:19 +02:00
rustc_macros Lint for unused borrows as part of UNUSED_MUST_USE 2021-06-18 15:09:40 +08:00
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 Use () for plugin_registrar_fn. 2021-05-12 13:58:43 +02:00
rustc_privacy Add more tests + visit_ty in some places 2021-06-09 19:28:41 +01:00
rustc_query_impl rustc_query_impl: Remove unused dependencies 2021-06-25 01:13:00 -07:00
rustc_query_system Auto merge of #85154 - cjgillot:lessfn, r=bjorn3 2021-06-15 14:52:58 +00:00
rustc_resolve Auto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, r=michaelwoerister 2021-07-06 11:31:59 +00:00
rustc_save_analysis Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_serialize Emit warnings for unused fields in custom targets. 2021-06-17 21:48:02 +02:00
rustc_session Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakis 2021-07-06 16:50:33 +00:00
rustc_span Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa 2021-07-11 01:06:58 +00:00
rustc_symbol_mangling Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
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 Combine individual limit queries into single limits query 2021-07-04 13:02:51 -05:00
rustc_ty_utils Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_type_ir Remove unused feature gates 2021-05-31 13:55:43 +02:00
rustc_typeck Auto merge of #86965 - sexxi-goose:rfc2229-improve-lint, r=nikomatsakis,lqd 2021-07-11 03:50:28 +00:00