Skip to content

Commit

Permalink
Allow building deprecated modules without deprecation warnings
Browse files Browse the repository at this point in the history
The compiler issues a deprecation warning only on a
"non-deprecated" -> "deprecated" transition.  As such, building or
testing Dub packages which have deprecated modules when a
dub_test_root.d file needs to be generated will cause deprecation
warnings.

This in turn makes it impossible to use `buildRequirements
"disallowDeprecations"` in this situation.

Fix this by simply making the auto-generated root
module (dub_test_root) deprecated. As it is the compiler's entry
point, the module itself will not cause a deprecation warning, and it
importing deprecating modules will not cause deprecation warnings (as
there is no longer a transition of deprecation state).
  • Loading branch information
CyberShadow committed May 30, 2023
1 parent 8d87794 commit 90f2a0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/dub/project.d
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ final class SelectedVersions {

/// The template code from which the test runner is generated
private immutable TestRunnerTemplate = q{
module dub_test_root;
deprecated module dub_test_root;

import std.typetuple;

Expand Down

0 comments on commit 90f2a0c

Please sign in to comment.