Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge stable #8988

Merged
merged 3 commits into from Apr 26, 2024
Merged

merge stable #8988

merged 3 commits into from Apr 26, 2024

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Apr 25, 2024

  • Remove dscanner check for const/immutable variables in unit tests.
  • Work around bugzilla issue 24415 - only doesn't work with elements with a copy constructor.

jmdavis and others added 3 commits April 9, 2024 14:31
This appears to be the check which is making
dlang#8924 fail the style check with
warnings such as

std/internal/test/range.d(43:14)[warn]: Variable b is never modified and could have been declared const or immutable.

It makes no sense to require that unit tests follow such a rule, and it
is actually detrimental when tests involve stuff like copy constructors,
because then the type of the target variable matters as part of the
test.

Honestly, I think that it should probably not be checked at all, since
it's a pretty questionable requirement in many cases given how strict
D's const and immutable are, but that's more debatable, whereas this
check really makes no sense with unit tests, so I'm just disabling it
for unit tests for now. We can disable it more generally later if it
turns out that it's causing problems for normal code.
…th a copy constructor.

Since the compiler is treating the auto-generated copy-constructor for
OnlyResult as private (thus rendering it useless outside of
std.range.package), this commit adds an explicit one and makes it
public. Once the dmd bug has been fixed, the explicit copy constructor
should be removed.
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
24415 normal Can't call public function preceded by private template overload

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8988"

@ibuclaw ibuclaw merged commit 54eb95c into dlang:master Apr 26, 2024
10 checks passed
@ibuclaw ibuclaw deleted the merge_stable branch April 26, 2024 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants