rust/tests/ui/delegation
许杰友 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
..
auxiliary delegation: Support async, const, extern "ABI" and C-variadic functions 2024-04-23 23:05:39 +03:00
bad-resolve.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
bad-resolve.stderr delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
body-identity-glob.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
body-identity-list.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
duplicate-definition-inside-trait-impl.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
duplicate-definition-inside-trait-impl.stderr Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
empty-glob.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
empty-glob.stderr delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
empty-list.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
empty-list.stderr delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
explicit-paths-in-traits-pass.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
explicit-paths-pass.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
explicit-paths-signature-pass.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
explicit-paths.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
explicit-paths.stderr Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
fn-header.rs delegation: Support async, const, extern "ABI" and C-variadic functions 2024-04-23 23:05:39 +03:00
glob-bad-path.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-bad-path.stderr delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-glob-conflict.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-glob-conflict.stderr delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-glob.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-non-fn.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-non-fn.stderr delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-non-impl.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-non-impl.stderr delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob-override.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
glob.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
ice-issue-122550.rs Delegation: fix ICE on bound_vars divergence 2024-03-22 17:24:41 +03:00
ice-issue-122550.stderr Delegation: fix ICE on bound_vars divergence 2024-03-22 17:24:41 +03:00
ice-issue-124342.rs Delegation: fix ICE on late diagnostics 2024-06-10 19:25:34 +03:00
ice-issue-124342.stderr Delegation: fix ICE on late diagnostics 2024-06-10 19:25:34 +03:00
ice-issue-124347.rs Delegation: fix ICE on recursive delegation 2024-06-10 21:27:25 +03:00
ice-issue-124347.stderr Delegation: fix ICE on recursive delegation 2024-06-10 21:27:25 +03:00
impl-trait.rs delegation: Support async, const, extern "ABI" and C-variadic functions 2024-04-23 23:05:39 +03:00
inner-attr.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
inner-attr.stderr delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
list.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
macro-inside-glob.rs delegation: Implement glob delegation 2024-06-14 19:27:51 +03:00
macro-inside-list.rs delegation: Fix hygiene for self 2024-06-15 00:45:05 +03:00
not-supported.rs Bless a test 2024-06-13 12:24:31 +02:00
not-supported.stderr Point out exactly what obligation will fail 2024-06-13 21:47:43 -04:00
parse.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
rename.rs delegation: Implement list delegation 2024-05-15 02:32:59 +03:00
self-hygiene.rs delegation: Fix hygiene for self 2024-06-15 00:45:05 +03:00
self-hygiene.stderr delegation: Fix hygiene for self 2024-06-15 00:45:05 +03:00
target-expr-pass.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
target-expr-pass.stderr Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
target-expr.rs Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
target-expr.stderr Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00