Skip to content

Commit 672fb05

Browse files
Rollup merge of #155096 - aerooneqq:delegation-user-specified-args-impl-traits, r=petrochenkov
delegation: support proper interaction of user-specified args and impl Traits This PR supports usages of user-specified args with impl Traits. When there are user-specified args in child we still need to generate synthetic generic params and use them during signature inheritance: ```rust fn foo<T, const N: usize>(f: impl FnOnce()) {} reuse foo::<String, 123> as bar; //desugaring fn bar<TSynth: impl FnOnce()>(f: _) { foo::<String, 123>(f) } ``` When inheriting predicates we process impl Trait ones, so we need generic params to instantiate them. Other approach may involve not generating synthetic generic params and try to filter out those predicates, but fairly generating synthetic params seems more consistent?. Fixes rust-lang/rust#154780, part of rust-lang/rust#118212. r? @petrochenkov
2 parents 49fa8b4 + 1b94472 commit 672fb05

0 file changed

File tree

    0 commit comments

    Comments
     (0)