Bug 20015 – [REG 2.086] Deprecated -preview, -revert, and -transition options not documented
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-30T19:52:01Z
Last change time
2022-03-27T02:24:24Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2019-06-30T19:52:01Z
Caused by PR/9636, commit 625c75a1b3a620ac884e89be778e2528f66f2d47
In generateFeatureUsage(), printing help information is skipped, despite the documented fields being explicitly set to true.
I'd expect that instead, the words "[DEPRECATED]" would appear in big letters next to the option.
For context, you can see the bug introduced from this specific part of the patch series for PR/9636:
diff --git a/src/dmd/cli.d b/src/dmd/cli.d
index 7234816cd..d0d6668f8 100644
--- a/src/dmd/cli.d
+++ b/src/dmd/cli.d
@@ -671,10 +671,11 @@ dmd -cov -unittest myprog.d
string paramName; // internal transition parameter name
string helpText; // detailed description of the feature
bool documented = true; // whether this option should be shown in the documentation
+ bool deprecated_; /// whether the feature is still in use
}
/// Returns all available transitions
@@ -682,7 +686,7 @@ dmd -cov -unittest myprog.d
Feature("field", "vfield",
"list all non-mutable fields which occupy an object instance"),
Feature("checkimports", "check10378",
- "give deprecation messages about 10378 anomalies"),
+ "give deprecation messages about 10378 anomalies", true, true),
Feature("complex", "vcomplex",
"give deprecation messages about all usages of complex or imaginary types"),
Feature("tls", "vtls",
@@ -694,7 +698,7 @@ dmd -cov -unittest myprog.d
/// Returns all available reverts
static immutable reverts = [
Feature("dip25", "noDIP25", "revert DIP25 changes https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP25.md"),
- Feature("import", "bug10378", "revert to single phase name lookup"),
+ Feature("import", "bug10378", "revert to single phase name lookup", true, true),
];
/// Returns all available previews
@@ -777,6 +781,8 @@ struct CLIUsage
"list information on all " ~ description)] ~ features;
foreach (t; allTransitions)
{
+ if (t.deprecated_)
+ continue;
if (!t.documented)
continue;
buf ~= " =";