rust/compiler
Dylan DPC ada50112ba
Rollup merge of #103224 - compiler-errors:semi-after-closure-in-macro, r=fee1-dead
Allow semicolon after closure within parentheses in macros

#88546 added some parsing logic that if we're parsing a closure, and we're within parentheses, and a semicolon follows, then we must be parsing something erroneous like: `f(|| a; b)`, so it replaces the closure body with an error expression. However, it's valid to parse those tokens if we're within a macro, as in #103222.

This is a bit unsatisfying fix. Is there a more robust way of checking that we're within a macro?

I would also be open to removing this "_It is likely that the closure body is a block but where the braces have been removed_" check altogether at the expense of more verbose errors, since it seems very suspicious in the first place...

Fixes #103222.
2022-10-22 16:28:08 +05:30
..
rustc Don't rerun the build script for the compiler each time on linux 2022-07-10 23:57:25 -05:00
rustc_apfloat Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_arena Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
rustc_ast Fix TyKind::is_simple_path. 2022-10-18 15:51:23 +11:00
rustc_ast_lowering Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors 2022-10-21 17:29:58 +05:30
rustc_ast_passes Rollup merge of #103351 - oli-obk:tilde_const_impls, r=fee1-dead 2022-10-22 00:14:02 +02:00
rustc_ast_pretty Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
rustc_attr Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_borrowck Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr 2022-10-20 13:33:50 +00:00
rustc_builtin_macros Mark derived StructuralEq as automatically derived. 2022-10-15 15:16:32 +00:00
rustc_codegen_cranelift more dupe word typos 2022-10-14 12:57:56 +08:00
rustc_codegen_gcc Stabilize asm_sym 2022-10-17 22:38:37 +01:00
rustc_codegen_llvm Get rid of native_library projection queries 2022-10-19 16:21:21 +02:00
rustc_codegen_ssa Auto merge of #103196 - Nilstrieb:no-meta-query, r=cjgillot 2022-10-22 05:08:51 +00:00
rustc_const_eval Rollup merge of #103315 - RalfJung:interpret-switchint-ice, r=bjorn3 2022-10-20 22:42:41 +02:00
rustc_data_structures fix some typos 2022-10-21 18:04:00 +08:00
rustc_driver Clarify run_in_thread_pool_with_globals. 2022-10-19 17:37:48 +11:00
rustc_error_codes fix small word dupe typos 2022-10-13 00:53:46 +08:00
rustc_error_messages Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors 2022-10-21 17:29:58 +05:30
rustc_errors Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors 2022-10-21 17:29:58 +05:30
rustc_expand Rollup merge of #102922 - kper:bugfix/102902-filtering-json, r=oli-obk 2022-10-21 17:29:58 +05:30
rustc_feature Add code comments and documentation 2022-10-20 22:44:10 +00:00
rustc_fs_util Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_graphviz Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_hir Use tidy-alphabetical in the compiler 2022-10-12 17:49:10 +05:30
rustc_hir_analysis Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obk 2022-10-22 07:49:33 +00:00
rustc_hir_pretty pretty: fix to print some lifetimes on HIR pretty-print 2022-10-15 23:34:21 +09:00
rustc_hir_typeck update doc links 2022-10-20 23:47:49 +02:00
rustc_incremental Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
rustc_index Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_infer Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors 2022-10-21 17:29:58 +05:30
rustc_interface Auto merge of #103310 - lcnr:rustc_hir_typeck, r=compiler-errors 2022-10-21 09:52:18 +00:00
rustc_lexer Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_lint Rollup merge of #102602 - WaffleLapkin:linty_action, r=estebank 2022-10-22 16:28:07 +05:30
rustc_lint_defs Rollup merge of #102635 - lcnr:incoherent_auto_trait_objects, r=jackh726 2022-10-22 00:13:59 +02:00
rustc_llvm Avoid LLVM-deprecated Optional::hasValue 2022-09-26 16:51:18 -07:00
rustc_log Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_macros infer: use derive more 2022-10-17 09:54:24 +01:00
rustc_metadata Auto merge of #103196 - Nilstrieb:no-meta-query, r=cjgillot 2022-10-22 05:08:51 +00:00
rustc_middle Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obk 2022-10-22 07:49:33 +00:00
rustc_mir_build Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholk 2022-10-15 07:36:38 +00:00
rustc_mir_dataflow Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk 2022-10-08 14:38:18 +02:00
rustc_mir_transform Introduce deduced parameter attributes, and use them for deducing readonly on 2022-10-21 02:33:15 -07:00
rustc_monomorphize mir constants: type traversing bye bye 2022-10-17 10:54:01 +02:00
rustc_parse Don't erroneously deny semicolons after closure expr within parentheses in a macro 2022-10-22 06:59:49 +00:00
rustc_parse_format Detect and reject out-of-range integers in format string literals 2022-10-01 01:05:01 +02:00
rustc_passes Allow #[unstable] impl for fn() -> UnstableType. 2022-10-19 13:34:18 +02:00
rustc_plugin_impl Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_privacy manually inline and rm visit_abstract_const_expr 2022-10-19 10:15:46 +02:00
rustc_query_impl Introduce deduced parameter attributes, and use them for deducing readonly on 2022-10-21 02:33:15 -07:00
rustc_query_system Remove the describe method from the QueryDescription trait 2022-10-14 22:35:56 +02:00
rustc_resolve Rollup merge of #103111 - cjgillot:shadow-label, r=estebank 2022-10-21 17:29:59 +05:30
rustc_save_analysis ImplItemKind::TyAlias => ImplItemKind::Type 2022-10-09 07:09:57 +00:00
rustc_serialize remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_session Auto merge of #103196 - Nilstrieb:no-meta-query, r=cjgillot 2022-10-22 05:08:51 +00:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span Auto merge of #103185 - chenyukang:yukang/fix-span-next-point, r=davidtwco 2022-10-20 10:40:09 +00:00
rustc_symbol_mangling more dupe word typos 2022-10-14 12:57:56 +08:00
rustc_target Split is_stable from rustc_target::spec::abi::is_enabled. 2022-10-19 12:41:11 +02:00
rustc_trait_selection Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obk 2022-10-22 07:49:33 +00:00
rustc_traits rm try_normalize_mir_const_after_erasing_regions 2022-10-17 10:54:03 +02:00
rustc_transmute Remove TypeckResults from InferCtxt 2022-10-07 07:06:19 -05:00
rustc_ty_utils Introduce deduced parameter attributes, and use them for deducing readonly on 2022-10-21 02:33:15 -07:00
rustc_type_ir Deny const variables as well 2022-10-19 17:11:40 +00:00