You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that given that these are comptime tests, this comptime code runs whenever you compile any program... which is fine, but I guess if we start adding more and more comptime checks to the std it will make things slow (or at least slower).
Do you think it's worth moving these tests back to a test program? Also in a test program I can use println to debug things.
@asterite noted in #5730 that placing comptime blocks in the stdlib for testing results in us having to interpret these comptime blocks on every compilation. Considering these are test functions this is completely wasted effort as they should be ignored if we're not actively running tests on the stdlib. This will affect any library which uses comptime blocks in tests.
One solution to this would be to have some kind of #[cfg(test)] block similar to rust which would allow us to ignore the tests entirely when not actively running them.
Performing analysis on which comptime blocks are reachable and only interpreting those doesn't seem easily doable as we could use multiple comptime blocks to stitch together another call to a comptime function so it doesn't seem like an option in the short term.
The text was updated successfully, but these errors were encountered:
# Description
## Problem
Part of #5668
## Summary
Also moves the tests to a test program to avoid evaluating that
`comptime` code on each compilation (see #5806)
## Additional Context
The rest of the comptime methods involve `Path` or `Pattern` and I'd
like to handle those (or one of those) in a separate PR.
## Documentation
Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@asterite noted in #5730 that placing comptime blocks in the stdlib for testing results in us having to interpret these comptime blocks on every compilation. Considering these are test functions this is completely wasted effort as they should be ignored if we're not actively running tests on the stdlib. This will affect any library which uses comptime blocks in tests.
One solution to this would be to have some kind of
#[cfg(test)]
block similar to rust which would allow us to ignore the tests entirely when not actively running them.Performing analysis on which comptime blocks are reachable and only interpreting those doesn't seem easily doable as we could use multiple comptime blocks to stitch together another call to a comptime function so it doesn't seem like an option in the short term.
The text was updated successfully, but these errors were encountered: