Skip to content

Comments

Add tests for delegation generics#152907

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generics-new-tests
Feb 21, 2026
Merged

Add tests for delegation generics#152907
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generics-new-tests

Conversation

@aerooneqq
Copy link
Contributor

@aerooneqq aerooneqq commented Feb 20, 2026

This PR adds tests from #151864 as discussed in this comment. Part of #118212.

The majority of new tests are added in mapping folder, (ast-hir-engine folder in #151864), those tests test mapping between generic params of delegee and our generated function for delegation (that is why the name of the folder was changed, I think it better reflects what those tests testing). In each mapping test comments were added to each test case and one comment describing the goal of mapping tests was added at the top of each file.

Next, tests for defaults in generic params (generic-params-defaults.rs), params with the same name (generic-params-same-names), errors in providing user-specified generic args (generics-gen-args-errors.rs) and wrong signature of a generated function in impl trait case (impl-trait-wrong-args-count.rs, renamed from wrong-args-count-ice.rs in #151864). generic-aux-pass.rs test was not added, as all reuses in this test produce known ICE DefId::expect_local DefId(..) isn't local #143498 (which will be fixed in #151864, however it will not close mentioned issue, as synthetic generic params are not yet supported in new generics implementation).

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 20, 2026
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📌 Commit 7348ffb has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2026
@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label Feb 20, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 21, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #146832 (Not linting irrefutable_let_patterns on let chains)
 - #146972 (Support importing path-segment keyword with renaming)
 - #152241 (For panic=unwind on Wasm targets, define __cpp_exception tag)
 - #152527 (Remove -Zemit-thin-lto flag)
 - #152769 (Do not cancel try builds after first job failure)
 - #152907 (Add tests for delegation generics)
 - #152455 (Remove the translation `-Z` options and the `Translator` type. )
 - #152813 (Skip the `use_existential_projection_new_instead` field in the `Debug` impl)
 - #152912 (Expose Span for all DefIds in rustc_public)
@rust-bors rust-bors bot merged commit fd38ec4 into rust-lang:main Feb 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 21, 2026
rust-timer added a commit that referenced this pull request Feb 21, 2026
Rollup merge of #152907 - aerooneqq:delegation-generics-new-tests, r=petrochenkov

Add tests for delegation generics

This PR adds tests from #151864 as discussed in this [comment](#151864 (comment)). Part of #118212.

The majority of new tests are added in `mapping` folder, (`ast-hir-engine` folder in #151864), those tests test mapping between generic params of delegee and our generated function for delegation (that is why the name of the folder was changed, I think it better reflects what those tests testing). In each mapping test comments were added to each test case and one comment describing the goal of mapping tests was added at the top of each file.

Next, tests for defaults in generic params (`generic-params-defaults.rs`), params with the same name (`generic-params-same-names`), errors in providing user-specified generic args (`generics-gen-args-errors.rs`) and wrong signature of a generated function in impl trait case (`impl-trait-wrong-args-count.rs`, renamed from `wrong-args-count-ice.rs` in #151864). `generic-aux-pass.rs` test was not added, as all reuses in this test produce known ICE `DefId::expect_local DefId(..) isn't local` #143498 (which will be fixed in #151864, however it will not close mentioned issue, as synthetic generic params are not yet supported in new generics implementation).

r? @petrochenkov
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 22, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#146832 (Not linting irrefutable_let_patterns on let chains)
 - rust-lang/rust#146972 (Support importing path-segment keyword with renaming)
 - rust-lang/rust#152241 (For panic=unwind on Wasm targets, define __cpp_exception tag)
 - rust-lang/rust#152527 (Remove -Zemit-thin-lto flag)
 - rust-lang/rust#152769 (Do not cancel try builds after first job failure)
 - rust-lang/rust#152907 (Add tests for delegation generics)
 - rust-lang/rust#152455 (Remove the translation `-Z` options and the `Translator` type. )
 - rust-lang/rust#152813 (Skip the `use_existential_projection_new_instead` field in the `Debug` impl)
 - rust-lang/rust#152912 (Expose Span for all DefIds in rustc_public)
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Feb 23, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#146832 (Not linting irrefutable_let_patterns on let chains)
 - rust-lang/rust#146972 (Support importing path-segment keyword with renaming)
 - rust-lang/rust#152241 (For panic=unwind on Wasm targets, define __cpp_exception tag)
 - rust-lang/rust#152527 (Remove -Zemit-thin-lto flag)
 - rust-lang/rust#152769 (Do not cancel try builds after first job failure)
 - rust-lang/rust#152907 (Add tests for delegation generics)
 - rust-lang/rust#152455 (Remove the translation `-Z` options and the `Translator` type. )
 - rust-lang/rust#152813 (Skip the `use_existential_projection_new_instead` field in the `Debug` impl)
 - rust-lang/rust#152912 (Expose Span for all DefIds in rustc_public)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-fn_delegation `#![feature(fn_delegation)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants