Change Log: 2.111.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
List of all upcoming bug fixes and enhancements in D 2.111.0.
Compiler changes
- Copying from const(void)[] to void[] is disallowed with -preview=fixImmutableConv
If const(void)[] data contains tail const pointers, copying to void[] can subsequently violate const data:
void f(int*[] a, const int*[] b) { void[] va = a; const void[] vb = b; va[] = vb[]; // fills `a` with pointers to const *a[0] = 0; // const data mutated }
Copying vb data to va is no longer allowed with the -preview=fixImmutableConv switch.
- Import expressions are now treated as hex strings
While Import expressions are typed as string, they are also used to embed binary files. By treating them the same as hex strings, they will implicitly convert to arrays of integral types other than char.
// Formerly, a cast was required: immutable ubyte[] iconImg = cast(immutable ubyte[]) import("icon.png"); // Now, it implicitly converts to integral arrays: immutable ubyte[] iconImg = import("icon.png");
- New trait isCOMClass to detect if a type is a COM class
A COM class inherits from a possibly user defined interface called IUnknown. To detect this during compilation use the trait __traits(isCOMClass, Type). Or for during runtime use the TypeInfo_Class flag.
- bool values other than 0 or 1 are not @safe
The spec was updated (for 2.109) so that only 0 and 1 are safe values for bool. This means that reading a bool value whose underlying byte representation has other bits set is implementation-defined and should be avoided. Consequently the following are deprecated in @safe code:
- void initialization of booleans (since 2.109)
- Reading a bool field from a union (since 2.109)
- Runtime casting a dynamic array to a bool dynamic array type
- Runtime casting a bool dynamic array to a tail mutable dynamic array type
- Casting a pointer to a bool pointer type
- Casting a bool pointer to a tail mutable pointer type
List of all bug fixes and enhancements in D 2.111.0:
DMD Compiler regression fixes
- Bugzilla 10713: [REG2.063] ICE with typeof(this.nonExistingField) in method signature
- Bugzilla 20562: [dmd] Memory allocation failed (ERROR: This is a compiler bug)
- Bugzilla 20686: failed static assert using a combination of __traits and unfinished type
- Bugzilla 20730: [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation
DMD Compiler bug fixes
- Bugzilla 4101: [tdpl] DMD doesn't give error when goto skips initialization
- Bugzilla 4174: Template interface functions not allowed, making operator overloads difficult
- Bugzilla 9662: Implement RDMD test suite
- Bugzilla 10257: .tupleof loses protection information upon iteration
- Bugzilla 10370: ICE on invalid imports when module is used as package
- Bugzilla 10386: Package import feature breaks with static libraries
- Bugzilla 10574: "auto ref" fails to match when IFTI succeeds (strip to level const)
- Bugzilla 10587: __traits(getAttributes) doesn't work on incomplete templated types
- Bugzilla 10603: Refused pure attribute on the left for function pointer argument
- Bugzilla 10639: Win64: wrong optimizer codegen with struct literal with complex fields
- Bugzilla 10699: override inconsistently allowed for abstract functions
- Bugzilla 16643: CTFE internal error with null
- Bugzilla 17503: is-expression pattern in static if matches too many types
- Bugzilla 20587: _rt_loadLibrary symbol not found
- Bugzilla 20603: 'cannot use non-constant CTFE pointer in an initializer' in recursive structure with overlap
- Bugzilla 20610: const in a .tupleof loop is ignored
- Bugzilla 20621: Since DMD 2.087.0: 32 Bit Linux now uses XMM registers: SIGILL, Illegal instruction on intel Pentium III
- Bugzilla 20688: Wrong code when linking to C complex number functions
- Bugzilla 20691: Converting scope static array to scope dynamic array should be error
- Bugzilla 20812: _d_assocarrayliteralTX segfault assigning a shared associative array an AA literal
- Bugzilla 20831: __traits(getAttributes) failes to compile when used on a parameter with no name
- Bugzilla 20912: Compiler incorrectly lists non-matching overloads as matching in diagnostic
- Bugzilla 21020: named import in with block masks local symbol
- Bugzilla 21995: Struct with size uint.max or greater causes ICE
- Bugzilla 23131: With -vasm all the X87 instructions are printed wrong.
- Bugzilla 23294: [dip1000] parameter to parameter assignment leads to incorrect scope inference
- Bugzilla 23830: Azure failure for OMF: Module name not printed before struct symbol
- Bugzilla 23841: isZeroInit does not take into account unions
- Bugzilla 24153: Inliner breaks -betterC by requiring TypeInfo
- Bugzilla 24375: ImportC: .di generator outputs C expression with -> operator
- Bugzilla 24447: ImportC: extern symbols cannot have initializers
- Bugzilla 24651: Bitfield layout wrong for 48-bit field on 32-bit Linux
- Bugzilla 24663: dip1000 doesn't check slice expression implicitly converted to static array
- Bugzilla 24669: ImportC: C files are not compiled with '-i' flag
- Bugzilla 24670: importC: .di generation does not place parentheses around const struct return types
- Bugzilla 24694: [DIP1000] can escape stack pointer through struct.class.field
- Bugzilla 24701: No error produced from casted noreturn variable
- Bugzilla 24705: Arguments of synchronized method are unintentionally treated as shared with -preview=nosharedaccess
- Bugzilla 24706: Missing errors for first operand of comma expression
- Bugzilla 24707: error message has bad parameter attribute order
- Bugzilla 24733: ImportC: #pragma pack(pop) restores wrong alignment
- Bugzilla 24748: DMD can't output object files with fully qualified name, making -od overwirte each other file
- Bugzilla 24762: @nogc false positive error
- Bugzilla 24776: Struct with anonymous union has wrong isZeroInit
- Bugzilla 24803: __traits(location) is inconsistent with modules
- Bugzilla 24807: Error message missing parens for template instance
- Bugzilla 24819: Optimizer changes result of float calculations on 32-bit
- Bugzilla 24822: When passing a non-POD argument to an rvalue parameter, an unnecessary blit is done
- Bugzilla 24830: separate compilation + circular deps + templated opCmp = missing symbols
- Bugzilla 24836: struct return by hidden struct arg does not need copy to become an rvalue
- Bugzilla 24845: Compiler error when trying to assign to an AA value of an enum instance
- Bugzilla 24848: bad parser diagnostic for a partial MulExp
- Bugzilla 24855: VRP fails to prevent overflow after division
- Bugzilla 24861: Vestige of 16 bit code being accidentally generated
- Bugzilla 24871: DDoc strips indent in triple slash comments
- Bugzilla 24883: Speculative template overload error escapes with -preview=rvaluerefparam
- Bugzilla 24891: Two scope attributes emitted as part of .di generation
DMD Compiler enhancements
- Bugzilla 9811: Add static code analyzing (i.e. PVS-Studio-like diagnostic)
- Bugzilla 9997: Missed misspell suggestions for UFCS
- Bugzilla 10023: Add rtInfo (or equivalent) to ModuleInfo
- Bugzilla 18235: Group logically similar tests into the same module in the D2 testsuite
- Bugzilla 20516: [D 2.0 FAQ]
- Bugzilla 20614: CTFE supports typeid(stuff).name but not classinfo.name
- Bugzilla 20888: std.range.Cycle does not compose with const
- Bugzilla 20960: -profile=gc does not track class objects allocated with new
- Bugzilla 20982: Add a pragma to suppress deprecation messages
- Bugzilla 21564: Allow assignment syntax for instantiating mixin templates
- Bugzilla 23449: spellchecker should suggest corrections for pointer members
- Bugzilla 23812: ImportC: allow adding function attributes to imported C functions
- Bugzilla 24639: ImportC: defines of negative constants not detected for enum conversion
- Bugzilla 24645: Hidden static assert error messages if more than 20 errors
- Bugzilla 24738: Import core.interpolation suggestion
- Bugzilla 24745: Better error message when creating an associative array with the wrong syntax
- Bugzilla 24749: A clause consisting only of "throw" should be the unlikely path
Phobos bug fixes
- Bugzilla 64: Unhandled errors should go to stderr
- Bugzilla 10581: Undefined identifier "std.uni.isWhite" when passing string lambda to std.algorithm.filter
- Bugzilla 10607: DirEntry has no constructor
- Bugzilla 10647: AutoImplement should implement overridden member functions with 'override' attributes
- Bugzilla 10680: BigInt uses deprecated std.traits.unsigned
- Bugzilla 14138: std.parallelism.task breaks @safety
- Bugzilla 15315: can break immutable with std.algorithm.move
- Bugzilla 20870: std.outbuffer.printf is trusted
- Bugzilla 20872: std.array.assocArray trusts user-provided 'front' for values
- Bugzilla 20929: std.experimental.allocator.expandArray's range-based overload fails to instantiate for char and wchar arrays.
- Bugzilla 23300: std.array : array wrongly propagates scopeness of source
- Bugzilla 24667: goo.gl is going away
- Bugzilla 24685: std.stdio.File.rawRead allows reading raw pointers from files in @safe code
- Bugzilla 24704: The error message for DateTime.fromISOExtString says that valid ISO extended strings that it does not support are invalid ISO extended strings
- Bugzilla 24715: std/process: Default to libc closefrom in spawnProcessPosix
- Bugzilla 24773: Stable sort() invokes the destructor on uninitialized elements
- Bugzilla 24801: RefRange doesn’t work if range primitives are not const
- Bugzilla 24809: In some cases, stable sort assigns to unininitialized elements
- Bugzilla 24818: Tag of a single-type SumType wastes space
Phobos enhancements
- Bugzilla 10538: std.typecons.wrap should consider opDispatch
- Bugzilla 17214: std.array.Appender has an unnecessary indirection
- Bugzilla 17479: Public constructor for std.process.Pid
- Bugzilla 20330: json toString with outputrange
- Bugzilla 20889: Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
- Bugzilla 21045: std.getopt: Support blank as separator of multiple values
- Bugzilla 22293: Nullable should define opCast!bool
- Bugzilla 24524: Very slow process fork if RLIMIT_NOFILE is too high
- Bugzilla 24698: Appender needs to expose readonly property 'size_t length' without using 'data' property
- Bugzilla 24823: std.json: Allow optionally preserving the order of fields in JSON objects
- Bugzilla 24851: Some members of CustomFloat can have const this
- Bugzilla 24875: std.traits.isAggregateType does not consider enums of aggregate types to be aggregate types
Druntime bug fixes
- Bugzilla 10380: [AA] Wrong code using associative array as key type in associative array
- Bugzilla 20763: checkaction=context does not format pointers
- Bugzilla 24660: atomic_wchar_t has wrong size on Posix
- Bugzilla 24661: wctype_t and wctrans_t are platform-dependent
- Bugzilla 24835: hasElaborateAssign is true for structs where opAssign is disabled if a member variable has elaborate assignment
- Bugzilla 24864: hasElaborateDestructor incorrectly true for structs with anonymous unions
Druntime enhancements
- Bugzilla 17416: SocketOption.REUSEPORT not available on linux
- Bugzilla 19369: core.sys.posix.setjmp lacks support for Darwin
- Bugzilla 20567: GC should not start threads for parallel marking in simple programs
dlang.org bug fixes
- Bugzilla 10565: Level-5 titles are missing in Language reference
- Bugzilla 10605: Lambda grammar is not sufficient
- Bugzilla 14945: unions are missing from the ABI page
- Bugzilla 20601: [Oh No! Page Not Found]
- Bugzilla 24680: [dip1000] final auto class method infers scope but no return
- Bugzilla 24732: FAQ article is out of date on calling printf
dlang.org enhancements
- Bugzilla 19348: Struct casts should be better documented.
- Bugzilla 24659: Memory safe D page lacks information on return ref
- Bugzilla 24868: Undocumented cast from struct to static array
- Bugzilla 24876: Undocumented cast from slice to static array
- Bugzilla 24890: spec/arrays.dd should mention comparison and warn about dangling .ptr
Contributors to this release (80)
A huge thanks goes to all the awesome people who made this release possible.
- 0-v-0
- 0v0
- Adam Wilson
- Alexander Heistermann
- Amaury
- Anca Maxim
- Andrei Horodniceanu
- Andrei Rusanescu
- Andrey Penechko
- Anita Hammer
- Artha
- Ate Eskola
- bangbangsheshotmedown
- Chibisi Chima-Okereke
- Cyrodwd
- Dawson Frakes
- Denis Feklushkin
- Dennis
- Dennis Korpel
- Dennis O.
- dhawal543
- Elias Batek
- Emmanuel Ferdman
- Fares A. Bakhit
- Feldwor
- Georgy Markov
- Iain Buclaw
- Iain Sandoe
- IchorDev
- Ilya Yanok
- Inkrementator
- Jan Jurzitza
- Jeremy Baxter
- Johan Engelen
- John Colvin
- John Dougan
- Jonas Meeuws
- Jonathan M Davis
- jordan4ibanez
- João Lourenço
- Kymorphia
- liushuyu
- LunaTheFoxgirl
- Luís Ferreira
- Manu Evans
- Marcelo Silva Nascimento Mancini
- Martin Kinkelin
- Mathias Lang
- Matthew Qiu
- Max Haughton
- Mike
- Nicholas Wilson
- Nick Treleaven
- Nicolò Monaldini
- Oshlok
- Paul Backus
- Per Nordlöw
- Quirin F. Schroll
- Quirin Schroll
- Rainer Schuetze
- Razvan Nitu
- Richard (Rikki) Andrew Cattermole
- Robert burner Schadek
- Royal Simpson Pinto
- royalpinto007
- Runa
- ryuukk
- Sebastian Wilzbach
- Serg Gini
- Simen Kjærås
- Steven Schveighoffer
- Sönke Ludwig
- Teodor Dutu
- Tim Schendekehl
- tynuk
- Vladimir Panteleev
- Vladiwostok
- Walter Bright
- wolframw
- Xin Wang