rust/compiler/rustc_resolve
许杰友 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
..
src Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01:00
Cargo.toml Update pulldown-cmark version to 0.9.5 2024-01-29 14:14:03 +01:00
messages.ftl And more general error 2024-05-24 11:20:33 -04:00