Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Make deprecation warnings compile errors#1982

Merged
thewilsonator merged 6 commits into
dlang:masterfrom
wilzbach:deprecation-error
Apr 8, 2019
Merged

Make deprecation warnings compile errors#1982
thewilsonator merged 6 commits into
dlang:masterfrom
wilzbach:deprecation-error

Conversation

@wilzbach

@wilzbach wilzbach commented Dec 2, 2017

Copy link
Copy Markdown
Contributor

This is already the way we build Phobos + Tools.
See also: dlang/phobos#5546

CC @ZombineDev @CyberShadow

@dlang-bot

dlang-bot commented Dec 2, 2017

Copy link
Copy Markdown

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
18530 regression [Reg 2.079] src/rt/tracegc.d(43): Deprecation: The delete keyword has been deprecated
19789 normal Lazy expression evaluation doesn't check parent scope for deprecations

Testing this PR locally

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

dub fetch digger
dub run digger -- build "master + druntime#1982"

@wilzbach wilzbach added the Trivial typos, formatting, comments label Dec 2, 2017
@CyberShadow

Copy link
Copy Markdown
Member

Sounds good, currently fails CI though.

@wilzbach

Copy link
Copy Markdown
Contributor Author

Sounds good, currently fails CI though.

Yeah:

src/core/time.d(4581): Deprecation: struct core.time.FracSec is deprecated - FracSec has been deprecated in favor of just using Duration for the sake of simplicity
src/core/time.d(3594): Error: template instance core.time._assertThrown!(TimeException, FracSec) error instantiating

Easy to fix.

src/core/internal/arrayop.d(147): Error: static assert  "Unary `-` not supported for type `ubyte`."

That one turns out to be rather difficult as it appears deep in the arrayop mixin :/

@wilzbach

Copy link
Copy Markdown
Contributor Author

Updated to resolve the merge conflicts and incorporate newer deprecations.
For delete dlang/dmd#8016 is required, apart from that I still haven't figured out how to fix the deprecation in arrayop.

Comment thread src/rt/tracegc.d Outdated
@wilzbach wilzbach force-pushed the deprecation-error branch 2 times, most recently from 350c467 to 2c03d72 Compare April 4, 2019 11:42
@wilzbach wilzbach force-pushed the deprecation-error branch from 2c03d72 to b39d5d1 Compare April 4, 2019 11:44
alias UT = Args[idx - 1];
enum op = Args[idx][1 .. $];
static if (is(typeof((UT a) => mixin(op ~ " a")) RT == return))
static if (is(typeof((UT a) => mixin(op ~ "cast(int) a")) RT == return))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could also have used -preview=intpromote here, but as this wouldn't be there when any user code tries to use this, I went with the "safe" approach of explicitly using the existing behavior.

@wilzbach

wilzbach commented Apr 5, 2019

Copy link
Copy Markdown
Contributor Author

@thewilsonator @JinShil FYI - this is passing and ready ;-)

@thewilsonator thewilsonator merged commit d7b99e9 into dlang:master Apr 8, 2019
@quickfur

quickfur commented Apr 8, 2019

Copy link
Copy Markdown
Member

Heads up: this PR has caused a regression in my code. Trying to reduce it to minimal case now, will post details once I reduced it.

@quickfur

quickfur commented Apr 9, 2019

Copy link
Copy Markdown
Member

Regression filed: https://issues.dlang.org/show_bug.cgi?id=19796

This PR broke array ops (arr[] = -src[];).

@wilzbach wilzbach deleted the deprecation-error branch April 9, 2019 04:36
{
auto op = arg[0] == 'u' ? arg[1 .. $] : arg;
stack[$ - 1] = op ~ stack[$ - 1];
stack[$ - 1] = op ~ "cast(int)"~ stack[$ - 1];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the culprit. Deleting "cast(int)"~ fixes the problem.

I think there's a missing check that Args contains integral types! The cast causes problems when performing array ops on double[].

@wilzbach

wilzbach commented Apr 9, 2019

Copy link
Copy Markdown
Contributor Author

Regression filed: https://issues.dlang.org/show_bug.cgi?id=19796

Thanks -> #2550

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Bug Fix Include reference to corresponding bugzilla issue Trivial typos, formatting, comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants