Change Log: 2.085.0
Download D nightlies
To be released
This changelog has been automatically generated from all commits in master since the last release.
- The full-text messages are assembled from the changelog/ directories of the respective repositories: dmd, druntime, phobos, tools, dlang.org, installer, and dub.
- See the DLang-Bot documentation for details on referencing Bugzilla. The DAutoTest PR preview doesn't include the Bugzilla changelog.
- The pending changelog can be generated locally by setting up dlang.org and running the pending_changelog target:
make -f posix.mak pending_changelog
Compiler changes
- Aliases can be created directly from a __trait.
- Added -check switch to turn on and off each category of runtime checks.
- Add -checkaction=D|C|halt compiler switch.
- -color and -color=on will now always output colorized console output
- The code generated by mixin statements can now be saved with -mixin
- Deprecate invalid binary literals
- Deprecated extern(Pascal) linkage
- The deprecation phase for fully qualified names that bypassed private imports is finished
- Templates are now mangled correctly on POSIX
- Added __c_wchar_t as a correct mangling type for C's wchar_t
Runtime changes
Library changes
List of all upcoming bug fixes and enhancements in D 2.085.0.
Compiler changes
- Aliases can be created directly from a __trait.
Aliases can be created directly from the traits that return symbol(s) or tuples. This includes getMember, allMembers, derivedMembers, parent, getOverloads, getVirtualFunctions, getVirtualMethods, getUnitTests, getAttributes and finally getAliasThis. Previously an AliasSeq was necessary in order to alias their return. Now the grammar allows to write shorter declarations:
struct Foo { static int a; } alias oldWay = AliasSeq!(__traits(getMember, Foo, "a"))[0]; alias newWay = __traits(getMember, Foo, "a");
To permit this it was more interesting to include __trait in the basic types rather than just changing the alias syntax. So additionally, wherever a type appears a __trait can be used, for example in a variable declaration:
struct Foo { static struct Bar {} } const(__traits(getMember, Foo, "Bar")) fooBar; static assert(is(typeof(fooBar) == const(Foo.Bar)));
- Added -check switch to turn on and off each category of runtime checks.
Option("check=[assert|bounds|in|invariant|out|switch][=[on|off]]", `Overrides default, -boundscheck, -release and -unittest options to enable or disable specific checks.
- assert: assertion checking
- bounds: array bounds
- in: in contracts
- invariant: class/struct invariants
- out: out contracts
- switch: switch default
- on or not specified: specified check is enabled.
- off: specified check is disabled.
- Add -checkaction=D|C|halt compiler switch.
It covers action taken when an assert fails, a bounds check fails, or a final switch error happens. D means the usual D behavior of throwing an Error, C means call the C runtime library assert failure function, and halt means halt the program execution.
The halt is the main addition here, it enables very lightweight assert's.
- -color and -color=on will now always output colorized console output
Before this release -color wouldn't output colorized console output if the terminal detection failed. With this release, a new option auto is introduced for -color=<value> which will continue to be the default:
- auto: enable colorized output if a tty is detected (default)
- on: always use colored output.
- off: never use colored output.
Hence, it is now possible to use -color (a shortcut for -color=on) to force DMD to emit colorized console output. For example, this will now use colorized console output:
> echo $(echo "test" | dmd -color - 2>&1) __stdin.d(2): Error: no identifier for declarator test
- The code generated by mixin statements can now be saved with -mixin
This is useful to debug errors in compilation and provides source for debuggers to show when requested.
- Deprecate invalid binary literals
Prior to this release, binary literals without any digits after the prefix 0b were considered valid. This has now been deprecated.
auto foo = 0b; // deprecated auto bar = 0b_; // deprecated auto baz = 0b0; // conforming equivalent
- Deprecated extern(Pascal) linkage
This linkage is completely unused, being an heritage from a few decades ago. Additionally, it's only supported by DMD and cause mangling ambiguity.
- The deprecation phase for fully qualified names that bypassed private imports is finished
// a.d import std.stdio;
// b.d import a; void main() { std.stdio.writefln("foo"); // deprecation before patch, now errors }
In order to compile the example successfully, public needs to be added to the import located in a.d : public import std.stdio; or import std.stdio; needs to be added to b.d.
- Templates are now mangled correctly on POSIX
Before this version, anything including extern(C++) templates was not correctly mangled on OSX, Linux, and FreeBSD, leading to linker errors.
- Added __c_wchar_t as a correct mangling type for C's wchar_t
This allows code interfacing with C++ that uses wchar_t to link correctly. It replaces wchar (Windows) and dchar (Posix) as the memory type for the DRuntime alias wchar_t.
Runtime changes
- Added core.stdcpp.array.
Added core.stdcpp.array, which links against C++ std::array
- Add D header file core.sys.darwin.crt_externs for libc/crt_externs.h on Darwin.
Add D header file core.sys.darwin.crt_externs for libc/crt_externs.h on Darwin.
- Added initialize template argument to object.destroy().
object.destroy() now receives an initialize argument to specify whether to re-initialize the object after destruction.
- Added core.stdcpp.string_view.
Added core.stdcpp.string_view, which links against C++ std::string_view
Library changes
- Add overload std.random.unpredictableSeed!UIntType
std.random.unpredictableSeed now has an overloaded version std.random.unpredictableSeed!UIntType that can be used to produce seeds of any unsigned type UIntType.
import std.random : unpredictableSeed; auto a = unpredictableSeed!uint; static assert(is(typeof(a) == uint)); auto b = unpredictableSeed!ulong; static assert(is(typeof(b) == ulong)); // The old syntax still works. uint c = unpredictableSeed;
Additionally the implementation quality of unpredictableSeed has been improved, speeding it up and eliminating an obvious pattern in the high bit. (Bear in mind that unpredictableSeed is still not cryptographically secure.)
List of all bug fixes and enhancements in D 2.085.0:
DMD Compiler regressions
- Bugzilla 16214: [REG2.069] ICE: Assertion `fd->semanticRun == PASSsemantic3done' failed.
- Bugzilla 16652: [Reg 2.071] returned rvalue destroyed too early
- Bugzilla 17518: [Reg 2.063] confusing error message with inout constructor/ctor
- Bugzilla 18372: REG(2.072): error missing line number: Error: undefined identifier __va_list_tag
- Bugzilla 19494: [REG 2.080.0][objc] interface main.NSObject.Class conflicts with interface main.NSObject.Class
- Bugzilla 19499: __c_long_double has exact match with double
- Bugzilla 19523: "undefined identifier" causes DMD crash
- Bugzilla 19618: Incorrect conversion of function returning typeof(null) to function returning an associative array
- Bugzilla 19639: Initializing static array with slice enum of different length crashes the compiler
- Bugzilla 19652: [REG2.084] alias this chain no longer works
- Bugzilla 19654: [REG master] cannot have final methods in objc interfaces
- Bugzilla 19672: Function uses the stack to read a static array parameter but it is passed in the registers
- Bugzilla 19685: Nested aggregate overlaps not detected
DMD Compiler bugs
- Bugzilla 12001: __traits(isSame) does not work with the basic types
- Bugzilla 16098: align(32) not respected for stack variables
- Bugzilla 17090: dmd -transition=? needs quoting => make it -transition=help
- Bugzilla 17181: Local imports in templates should be added to imported modules list of module that instantiated it
- Bugzilla 18545: Casting away const with cast() triggers alias this, but returns the supertype anyway
- Bugzilla 19223: core.simd __vector.array compiler crash
- Bugzilla 19224: core.simd __vector.array "__r2.length cannot be evaluated at compile time"
- Bugzilla 19549: -check=in=off doesn't work
- Bugzilla 19551: corrupt ELF library when using pragma(crt_constructor)
- Bugzilla 19574: DMD crashes with templated structs in two identical extern(C++, "") blocks
- Bugzilla 19607: [ICE] dmd/e2ir.d(117): Invalid type mTYconst|TYstruct
- Bugzilla 19608: [ICE] dmd/backend/cod1.d(3826): Assertion `0' failed.
- Bugzilla 19609: [ICE] dmd/expression.d(2790): Segmentation fault
- Bugzilla 19627: [CTFE][SIMD] Error: cannot cast int to int[4]
- Bugzilla 19628: [CTFE][SIMD] ICE indexing vector array
- Bugzilla 19630: [CTFE][SIMD] Error: cannot determine length of vector slice at compile time
- Bugzilla 19676: Destructor not called for returned temporary that was cast to void
- Bugzilla 19687: Wrong error for overloaded opDispatch + UFCS with non-existing function
- Bugzilla 19699: [2.085.0-beta.2] Obj-C segfault - in objc_glue.getClassName
DMD Compiler enhancements
- Bugzilla 16360: DMD fails to inline functions that contain a type
- Bugzilla 19097: Extend Return Scope Semantics
- Bugzilla 19543: Shared object "libstdc++.so.6" not found, required by "dmd"
- Bugzilla 19552: -transition is non-intuitive to use - the flag should list options by default
Phobos bugs
- Bugzilla 18519: freebsd 11 + phobos + curl, timing out
- Bugzilla 18913: Cannot move static array of non-copyable type
- Bugzilla 19532: chunkBy assert error involving non-forward input ranges.
- Bugzilla 19572: std.array.Appender.put invokes struct constructor via cast
- Bugzilla 19580: [non-DMD] std.random seed bootstrap: don't count on reading an uninitialized variable being treated as an ordinary read
- Bugzilla 19644: std.range.takeOne opSlice asserts incorrectly when operating on non-forward input range
- Bugzilla 19647: std.range.takeOne opSlice incorrect for empty slice of non-forward input range
Phobos enhancements
- Bugzilla 19453: Remove unnecessary error checks in std.datetime.systime.currStdTime()
- Bugzilla 19526: make std.typecons.RefCounted work in betterC
Druntime bugs
- Bugzilla 11393: [GC] GC realloc and free don't ignore interior pointers
- Bugzilla 11446: [GC] GC realloc doesn't ignore non-GC owned pointers
- Bugzilla 12843: Unit tests fail when GC is compiled with SENTINEL
- Bugzilla 15393: Debug versions in GC code doesn't compile.
- Bugzilla 17431: GCBits should be @nogc to prevent deadlocks
- Bugzilla 19281: GC mishandles allocations >= 4GB
- Bugzilla 19522: [GC] GC.query/addrOf/sizeOf fail for freed memory
- Bugzilla 19562: core.internal.hash.hashOf array of pointers or delegates should be @safe
- Bugzilla 19568: hashOf should not unnecessarily call a struct's fields' postblits & dtors in CTFE
- Bugzilla 19571: Incorrect definition of DTM_FIRST in core.sys.windows.commctrl
- Bugzilla 19582: Make core.internal.convert.toUbyte in CTFE for arrays work with reference type elements and not call postblits/dtors
- Bugzilla 19593: dstrcmp with -profile causes stack overflow
Druntime enhancements
- Bugzilla 16377: Make --DRT GC profile information available outside of GC destruction
- Bugzilla 19128: argument to alloca may be too large
- Bugzilla 19455: GC wastes too much memory
- Bugzilla 19524: Make core.checkedint work in betterC
dlang.org bugs
- Bugzilla 19592: Rule for IdentifierList is wrong
Contributors to this release (50)
A huge thanks goes to all the awesome people who made this release possible.
- 0xEAB
- Andrei Alexandrescu
- Andrej Mitrovic
- Arun Chandrasekaran
- Basile Burg
- Bastiaan Veelo
- BBasile
- Cameron Ross
- David Gileadi
- Eduard Staniloiu
- FeepingCreature
- Flying-Toast
- H. S. Teoh
- hatf0
- Hiroki Noda
- Iain Buclaw
- Jacob Carlborg
- Jacob Jensen
- Joakim Noah
- Johan Engelen
- Johannes Pfau
- John
- Jon Degenhardt
- Jonathan Marler
- jsatellite
- kinke
- look-at-me
- Manu Evans
- Martin Nowak
- Mathias Lang
- Mathis Beer
- Maya Rashish
- MetaLang
- Mike Parker
- Márcio Martins
- Nathan Sashihara
- Nicholas Lindsay Wilson
- Nicholas Wilson
- Petar Kirov
- Radu Racariu
- Rainer Schuetze
- Razvan Nitu
- Ryan Boggs
- Sebastian Wilzbach
- Stefan Koch
- Steven Schveighoffer
- Thomas Mader
- Vladimir Panteleev
- Walter Bright
- سليمان السهمي (Soolaïman Sahmi)