Skip to content

Conversation

@aerooneqq
Copy link
Contributor

I've encountered a problem with building auxiliary in pretty tests with the following configuration:

//@ edition:2021
//@ aux-crate:to_reuse_functions=to-reuse-functions.rs
//@ pretty-mode:hir
//@ pretty-compare-only
//@ pp-exact:delegation-inherit-attributes.pp

In such kind of tests, I want to test the resulting HIR, without final typecheck (pretty-compare-only). I plan to use such tests during testing the attribute inheritance in delegation feature. However, related auxiliary is built only in self.typecheck_source method (in compose_and_run_compiler routine), so it is impossible to execute test in my scenario. As a solution I've added the auxiliary build in print_source method, so it is also built in a compare only scenarios.

I've tried to search other solutions to this problem, but I haven't found a way to force auxiliary build in such a configuration of a pretty test.

r? @petrochenkov

@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 10, 2025
@aerooneqq
Copy link
Contributor Author

Example failure

@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 10, 2025

📌 Commit a3970b0 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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 Dec 10, 2025
bors added a commit that referenced this pull request Dec 10, 2025
Rollup of 7 pull requests

Successful merges:

 - #148052 (Stabilize `const_mul_add`)
 - #149386 (Display funding link in the github overview)
 - #149489 (Experimentally add *heterogeneous* `try` blocks)
 - #149764 (Make `--print=backend-has-zstd` work by default on any backend)
 - #149838 (Build auxiliary in pretty tests)
 - #149839 (Use `PointeeSized` bound for `TrivialClone` impls)
 - #149846 (Statically require links to an issue or the edition guide for all FCWs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Dec 10, 2025
Rollup of 7 pull requests

Successful merges:

 - #148052 (Stabilize `const_mul_add`)
 - #149386 (Display funding link in the github overview)
 - #149489 (Experimentally add *heterogeneous* `try` blocks)
 - #149764 (Make `--print=backend-has-zstd` work by default on any backend)
 - #149838 (Build auxiliary in pretty tests)
 - #149839 (Use `PointeeSized` bound for `TrivialClone` impls)
 - #149846 (Statically require links to an issue or the edition guide for all FCWs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7b2f36e into rust-lang:main Dec 10, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 10, 2025
rust-timer added a commit that referenced this pull request Dec 10, 2025
Rollup merge of #149838 - aerooneqq:build-aux-in-pp-tests, r=petrochenkov

Build auxiliary in pretty tests

I've encountered a problem with building auxiliary in pretty tests with the following configuration:
```
//@ edition:2021
//@ aux-crate:to_reuse_functions=to-reuse-functions.rs
//@ pretty-mode:hir
//@ pretty-compare-only
//@ pp-exact:delegation-inherit-attributes.pp
```

In such kind of tests, I want to test the resulting HIR, without final typecheck (`pretty-compare-only`). I plan to use such tests during testing the attribute inheritance in delegation feature. However, related auxiliary is built only in [self.typecheck_source](https://github.com/rust-lang/rust/blob/2e667b0c6491678642a83e3aff86626397360af5/src/tools/compiletest/src/runtest/pretty.rs#L79) method (in `compose_and_run_compiler` routine), so it is impossible to execute test in my scenario. As a solution I've added the auxiliary build in [print_source](https://github.com/rust-lang/rust/blob/2e667b0c6491678642a83e3aff86626397360af5/src/tools/compiletest/src/runtest.rs#L434) method, so it is also built in a compare only scenarios.

I've tried to search other solutions to this problem, but I haven't found a way to force auxiliary build in such a configuration of a pretty test.

r? `@petrochenkov`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants