Repository navigation
feat: Use macrotest to test the expanded macro code - #501
Conversation
ecbc3bf to
14debf5
Compare
But this means that we may need to regenerate every few days if there are (experimental) changes in nightly. |
|
Unfortunately we can't gate a test on |
4be1edd to
1d7572d
Compare
|
Are you sure ? https://crates.io/crates/rustversion starts with: I experimented a bit with: fn main() {
print_version();
}
#[rustversion::stable(1.85)]
fn print_version() {
println!("1.85");
}
#[rustversion::stable]
fn print_version() {
println!("Stable");
}
#[rustversion::nightly]
fn print_version() {
println!("Nightly");
}and Since we don't need to both |
|
If we change it to |
Co-authored-by: Martin Grigorov <[email protected]>
|
It all works now. |
Co-authored-by: Martin Grigorov <[email protected]>
This makes it a lot easier (for both reviewers and programmers) to see the generated code.
I've also moved some tests of error cases to the
uitests.Generated code can be overwritten using
MACROTEST=overwrite(just likeTRYBUILD=overwrite), and the tests only run on nightly, as code expansion can change between compiler versions.We might need to add
cargo expandto the CI.