rust/compiler/rustc_ast/src
许杰友 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
..
attr Change comment to FIXME 2024-06-06 20:27:25 -05:00
expand Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
util Rework precise capturing syntax 2024-06-17 22:35:25 -04:00
ast_traits.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
ast.rs Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
entry.rs Various improvements to entrypoint code 2024-05-04 14:48:42 +02:00
format.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
lib.rs Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
mut_visit.rs Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
node_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
ptr.rs Implement BOXED_SLICE_INTO_ITER 2024-05-20 19:21:30 -04:00
token.rs Handle safety keyword for extern block inner items 2024-06-04 14:19:42 -03:00
tokenstream.rs Use JointHidden in a couple of suitable places. 2024-05-23 06:03:17 +10:00
visit.rs Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00