rust/compiler
bors ce45663e14 Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk
Implement `#[must_not_suspend]`

implements #83310

Some notes on the impl:

1. The code that searches for the attribute on the ADT is basically copied from the `must_use` lint. It's not shared, as the logic did diverge
2. The RFC does specify that the attribute can be placed on fn's (and fn-like objects), like `must_use`. I think this is a direct copy from the `must_use` reference definition. This implementation does NOT support this, as I felt that ADT's (+ `impl Trait` + `dyn Trait`) cover the usecase's people actually want on the RFC, and adding an imp for the fn call case would be significantly harder. The `must_use` impl can do a single check at fn call stmt time, but `must_not_suspend` would need to answer the question: "for some value X with type T, find any fn call that COULD have produced this value". That would require significant changes to `generator_interior.rs`, and I would need mentorship on that. `@eholk` and I are discussing it.
3. `@estebank` do you know a way I can make the user-provided `reason` note pop out? right now it seems quite hidden

Also, I am not sure if we should run perf on this

r? `@nikomatsakis`
2021-09-22 06:43:33 +00:00
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_arena Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ast Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ast_lowering Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_ast_passes Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ast_pretty Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_attr Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_borrowck Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_builtin_macros Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_codegen_cranelift Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_codegen_llvm Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_codegen_ssa Auto merge of #88629 - wesleywiser:fix_debuginfo_for_scalarpair_params, r=oli-obk 2021-09-22 01:13:49 +00:00
rustc_const_eval Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_data_structures Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472 2021-09-21 22:07:32 +00:00
rustc_driver Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_error_codes Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_errors Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_expand Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_feature Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_hir Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_hir_pretty Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_incremental Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_index Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_infer Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_interface Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_lexer Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_lint Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
rustc_lint_defs Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
rustc_llvm Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_macros Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_metadata Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_middle Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472 2021-09-21 22:07:32 +00:00
rustc_mir_build Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472 2021-09-21 22:07:32 +00:00
rustc_mir_dataflow Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_mir_transform Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_monomorphize Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_parse Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472 2021-09-21 22:07:32 +00:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
rustc_plugin_impl Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_privacy Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_query_impl Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_query_system Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_resolve Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472 2021-09-21 22:07:32 +00:00
rustc_save_analysis Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_serialize Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_session Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_span Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
rustc_symbol_mangling Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_target Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_trait_selection Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_traits Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ty_utils Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank 2021-09-21 19:25:49 +00:00
rustc_type_ir Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_typeck Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00