rust/compiler
许杰友 Jieyou Xu (Joe) f8ce1cfbf5
Rollup merge of #124135 - petrochenkov:deleglob, r=fmease
delegation: Implement glob delegation

Support delegating to all trait methods in one go.
Overriding globs with explicit definitions is also supported.

The implementation is generally based on the design from https://github.com/rust-lang/rfcs/pull/3530#issuecomment-2020869823, but unlike with list delegation in https://github.com/rust-lang/rust/pull/123413 we cannot expand glob delegation eagerly.
We have to enqueue it into the queue of unexpanded macros (most other macros are processed this way too), and then a glob delegation waits in that queue until its trait path is resolved, and enough code expands to generate the identifier list produced from the glob.

Glob delegation is only allowed in impls, and can only point to traits.
Supporting it in other places gives very little practical benefit, but significantly raises the implementation complexity.

Part of https://github.com/rust-lang/rust/issues/118212.
2024-06-19 01:51:36 +01:00
..
rustc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustc_abi Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_arena Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_ast Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
rustc_ast_ir Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_ast_lowering Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_ast_passes Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_ast_pretty Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
rustc_attr Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_baked_icu_data Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_borrowck Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_builtin_macros Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_codegen_cranelift Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_codegen_gcc Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_codegen_llvm Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_codegen_ssa Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_const_eval Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_data_structures Use Linux file locking on Redox 2024-06-16 12:56:50 +00:00
rustc_driver Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_driver_impl Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_error_codes Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubilee 2024-06-12 11:10:50 +00:00
rustc_error_messages Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_errors Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_expand Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
rustc_feature Delay a bug and mark precise_capturing as not incomplete 2024-06-17 22:35:25 -04:00
rustc_fluent_macro Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_fs_util Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_graphviz Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_hir Rework precise capturing syntax 2024-06-17 22:35:25 -04:00
rustc_hir_analysis Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_hir_pretty Rework precise capturing syntax 2024-06-17 22:35:25 -04:00
rustc_hir_typeck Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_incremental Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_index Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_index_macros rustc_span: Minor improvements 2024-06-16 14:08:25 +03:00
rustc_infer Auto merge of #126614 - compiler-errors:uplift-next-trait-solver, r=lcnr 2024-06-18 19:41:33 +00:00
rustc_interface Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwco 2024-06-18 16:49:19 +00:00
rustc_lexer Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_lint Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_lint_defs Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope 2024-06-14 11:05:35 -04:00
rustc_llvm Auto merge of #125141 - SergioGasquez:feat/no_std-xtensa, r=davidtwco 2024-06-12 13:43:31 +00:00
rustc_log Bump tracing-tree and allow rendering lines again 2024-06-12 10:11:41 +00:00
rustc_macros Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_metadata Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_middle Auto merge of #126614 - compiler-errors:uplift-next-trait-solver, r=lcnr 2024-06-18 19:41:33 +00:00
rustc_mir_build Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_mir_dataflow Use is_lang_item more aggressively 2024-06-14 16:54:29 -04:00
rustc_mir_transform Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwco 2024-06-18 16:49:19 +00:00
rustc_monomorphize Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_next_trait_solver Fix transmute goal 2024-06-18 11:04:01 -04:00
rustc_parse Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
rustc_parse_format Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_passes Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_pattern_analysis Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_privacy Do not ICE in privacy when type inference fails. 2024-06-17 10:09:27 +00:00
rustc_query_impl Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_query_system Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_resolve Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
rustc_sanitizers Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
rustc_serialize Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_session Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwco 2024-06-18 16:49:19 +00:00
rustc_smir Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
rustc_span [perf] More span update benchmarking 2024-06-17 16:26:56 +03:00
rustc_symbol_mangling Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_target Add i686-unknown-redox target 2024-06-16 12:56:48 +00:00
rustc_trait_selection Auto merge of #126614 - compiler-errors:uplift-next-trait-solver, r=lcnr 2024-06-18 19:41:33 +00:00
rustc_traits Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_transmute safe transmute: support Variants::Single enums 2024-06-13 01:38:51 +00:00
rustc_ty_utils Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
rustc_type_ir Fix transmute goal 2024-06-18 11:04:01 -04:00
rustc_type_ir_macros Uplift TraitPredicate 2024-05-11 18:20:00 -04:00
stable_mir Rollup merge of #126410 - RalfJung:smir-const-operand, r=oli-obk 2024-06-15 19:51:35 +02:00