Change Log: 2.094.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
Runtime changes
Installer changes
Dub changes
List of all upcoming bug fixes and enhancements in D 2.094.0.
Compiler changes
- Add new builtin __traits(isCopyable, T) for some type T
Changing Phobos' std.traits.isCopyable to make use of this new builtin trait will reduce memory usage and, in turn, improve the performance of the compiler checking whether a type is copyable or not.
- Properly check interface implementations
In previous releases the check to verify that a class implements all methods of the interfaces it implements was performed late in the compilation phase. This caused the check to not be performed when code generation was skipped (compiling with the -o- flag).
In this release the check has been moved to an earlier phase of the compilation, causing errors to be reported even when the -o- flag is used. This can cause some breakage if a piece of code has only been compiled with the -o- flag.
The compiler will now properly report an error for the following code when the -o- flag is used:
interface Foo { void foo(); } class Bar : Foo { }
- Allow initialization of shared variables.
Shared variables can now be initialized when the -preview=nosharedaccess switch is used.
void test() { shared int x; shared int y = 3; }
- Add -vtemplates switch to collect and list template statistics
Template instantiations can consume lots of time and memory. By passing the -vtemplates switch to the compiler, the compiler will collect and print statistics about template usage in the code being compiled.
For each template that was instantiated, a list of how many times it is instantiated, and how many of those instantiations are unique, is printed.
Runtime changes
- add exit_group to core.sys.linux.unistd
add exit_group to core.sys.linux.unistd, exits all threads in a process, present since linux 2.5.35
- Added module core.sys.darwin.mach.nlist and core.sys.darwin.mach.stab
Those modules contains bindings for the 64 bits part of Mac OSX's <mach-o/nlish.h> and <mach-o/stab.h>, respectively, and can be used by users wishing to inspect binary data of Mach-O object files.
- Deprecated object.selector
The public import of selector in the module object has been deprecated. Please explicitly import selector instead using: import core.attribute : selector;
The following code has been deprecated:
extern (Objective-C) extern class NSObject { static NSObject alloc() @selector("alloc"); }
Replace with:
import core.attribute : selector; extern (Objective-C) extern class NSObject { static NSObject alloc() @selector("alloc"); }
- Memory releated GC options can now be specified with higher accuracy
Memory-related GC options stored in bytes instead of megabytes to provide fine-tune GC on low memory devices.
Added ability to use suffixes B, K, M or G:
extern(C) __gshared string[] rt_options = [ "gcopt=minPoolSize:4K maxPoolSize:2M incPoolSize:8K" ];
Values without suffix treated as megabytes.
Installer changes
- The install script now also works on the Windows command prompt.
The official D version manager (install.sh, documented at dlang.org/install.html) used to require a POSIX environment. On Windows, prior to this release, this meant running the script and the compilers that it installed from within a POSIX terminal emulator as provided by MSYS2 or Cygwin. With this release it is now possible to install and activate compilers from the Windows command prompt directly.
Assuming an MSYS2 installation is present in C:\msys64, necessary decompression tools can be installed from the Windows command prompt:
C:\msys64\usr\bin\pacman.exe --sync unzip p7zip
The following will invoke the script directly from dlang.org and install the latest dmd compiler in the %USERPROFILE%\dlang folder:
C:\msys64\usr\bin\curl.exe https://dlang.org/install.sh | \msys64\usr\bin\bash.exe -s
This process will end with a message showing the location of activate.bat, which can be used to add the installed compiler to your PATH.
The script itself will also be installed locally. This will show you its other uses:
C:\msys64\usr\bin\bash.exe %USERPROFILE%\dlang\install.sh --help
Dub changes
- Builds dynamicLibrary targets as dynamic libraries instead of static libraries.
Dub will no longer build dynamicLibrary targetType's as staticLibrary.
Except for x86_omf. This has been disabled due to numerous issues that will lead this to not doing what is expected of it.
No compiler or linker flags have been added at this time, you will need to specify the relevant flag to get the compiler to link dynamically against Phobos.
- The $DUB_BUILD_PATH variable was added
The $DUB_BUILD_PATH variable is now defined inside the postBuildCommands section. It contains the absolute path in which the package was built, and can be used to copy by-products of the build process to their intended locations.
For example, if an executable exports symbols, you will want to make the resulting import library and symbols export file available somewhere. That can be done with a dub.json section like this:
"postBuildCommands-windows": [ "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.lib $PACKAGE_DIR\\lib" "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.exp $PACKAGE_DIR\\lib" ],
- Command environment variable substitution changed
Now users can use the documented predefined variables inside custom command directives without the need for a wrapper shell script.
Before this would have failed:
"preBuildCommands": ["$DC -run foo.d"]
unless DC was defined as environment variable outside DUB.
It was before possible to run a script that used the $DC environment variable or on POSIX escape the $ with $$DC to make the shell substitute the variable. These workarounds are no longer needed now.
API change: none of the different command directives are no longer substituted with the process environment variables. You now access the raw commands as provided by the user in the recipe. dub describe has been adjusted and now also processes the predefined environment variables as well as the process environment variables.
List of all bug fixes and enhancements in D 2.094.0:
DMD Compiler regressions
- Bugzilla 18412: [REG2.077.0] immutable array in library becomes null when referenced in static constructor
- Bugzilla 19476: explicit mixin template function call results in recursive call instead
- Bugzilla 20296: Segfault when using variadic D functions with extern(C++) linkage
- Bugzilla 20620: dmd version has -dirty suffix
- Bugzilla 20958: incomplete semantic analysis when generating code for function
- Bugzilla 20981: Runtime segfault for inlined __simd_sto
- Bugzilla 21063: getLinkage is wrong for forward reference extern(C++) class
- Bugzilla 21074: const lost in mixin
- Bugzilla 21088: std.meta.staticMap no longer works for typeid
- Bugzilla 21091: [ICE] Segmentation fault: Module::importAll(Scope*) (this=0x0, prevsc=0x0) at dmd/dmodule.d:1124
- Bugzilla 21095: [ICE] AssertError@dmd/expressionsem.d(5015): Assertion failure
- Bugzilla 21163: Scope lambda argument in struct initializer causes parsing error
- Bugzilla 21196: [REG 2.092] Deprecation for language feature triggered inside of deprecated block
- Bugzilla 21258: Tuple parameters with defaults use the first tuple element for all defaults since 2.094.0-beta.1
DMD Compiler bugs
- Bugzilla 2617: asm silently accepts ambiguous-sized operations
- Bugzilla 5570: 64 bit C ABI not followed for passing structs and complex numbers as function parameters
- Bugzilla 5922: inline assembler - referencing immutable variable values fails
- Bugzilla 6166: Named return value optimization not dealt with in inline assembler
- Bugzilla 6459: Inline assembler does not work well for 64 bit registers R8..R15
- Bugzilla 7387: call instruction does not understand $
- Bugzilla 10966: Optimizer generates wrong code with try-catch
- Bugzilla 12490: No "Error: , has no effect" Error for comma expression LHS
- Bugzilla 12730: lea instruction accepts subtraction of scaling register but actually adds
- Bugzilla 12832: asm movdqu accepts wrong operand size
- Bugzilla 13215: Error message with static this array assignment
- Bugzilla 13957: 64 bit C ABI not followed for passing structs with floating+integer types
- Bugzilla 14203: Return of floating point values from extern(C++) member functions does not match dmc
- Bugzilla 14458: very slow ubyte[] assignment (dmd doesn't use memset)
- Bugzilla 14872: [2.068.2] Label address in asm [x86-64]
- Bugzilla 15103: Improve declaration / initialization syntax error message
- Bugzilla 15257: __traits(compiles, …) with malformed inline asm silently ends compilation
- Bugzilla 15745: Inline Assembly stomped on by Profiling
- Bugzilla 16044: __traits(allMembers) returns empty tuple for subpackages
- Bugzilla 16092: AVX registers YMM0-YMM7 are inaccessible to 32-bit asm
- Bugzilla 16268: Wrong loop optimization in code with integer overflow
- Bugzilla 16317: Wrong binop evaluation/load order when optimizing
- Bugzilla 16400: naked variadic C function emits broken prologue
- Bugzilla 16857: inline assembler reverses operands of VPEXTRW instruction
- Bugzilla 16963: Forward reference label name resolution in asm statement
- Bugzilla 17351: Static const array can't be evaluated at compile time when passed as ref argument
- Bugzilla 17617: No RIP relative addressing available in x64 inline assembly (iasm)
- Bugzilla 17720: Wrong code using vector extensions with different types
- Bugzilla 17965: Usage of the FPU while function result already in right XMM registers
- Bugzilla 18373: The inline assembler parser allows strange constructs
- Bugzilla 18748: bt instruction with immediate offset uses 64-bit variant for 32-bit data
- Bugzilla 18749: bt instruction using 64-bit register for 32-bit offset
- Bugzilla 19179: extern(C++) small-struct by-val uses wrong ABI
- Bugzilla 19210: Poor error message for return function parameter that is not ref
- Bugzilla 19384: [Codegen] Address of stack temporary is returned
- Bugzilla 19729: Constructor overloads coming from mixin are not resolved
- Bugzilla 19846: zero size function parameter such as byte[0] causes code to not be executed
- Bugzilla 20017: JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection
- Bugzilla 20162: Sign Extension for ?: optimization done wrong
- Bugzilla 20363: painting XMM registers as integers leads to codegen bugs
- Bugzilla 20422: confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"
- Bugzilla 20761: __traits(isSame) for alias tuples is broken and underspecified
- Bugzilla 20831: __traits(getAttributes) failes to compile when used on a parameter with no name
- Bugzilla 20911: Documentation for test/unit is non-existant
- Bugzilla 20934: preview=dtorfields segfaults for disabled/extern constructors
- Bugzilla 20938: Cannot create const arrays mixing immutable and mutable structs with indirections
- Bugzilla 20963: wrong code for cast(double)anUlong
- Bugzilla 20995: Range violation with -preview=dip1021
- Bugzilla 21001: Private alias becomes public if used before declaration
- Bugzilla 21019: Azure pipelines Windows_VisualD win32-ldc fails with Heisenbug
- Bugzilla 21037: AVX code sometimes fails to set VEX prefix
- Bugzilla 21038: wchar and dchar string alignment should be 2 and 4, respectively
- Bugzilla 21040: SIMD: illegal instruction using 32-byte operations on AVX
- Bugzilla 21050: __traits(getOverloads) for templates returns incorrect symbol for the first overload
- Bugzilla 21053: Test Suite run.d is built with compiler under test, must be build with bootstrap dmd
- Bugzilla 21058: __traits(getOverloads) forgets "this" with third argument or if first overload is a template
- Bugzilla 21082: Testsuite fails on OSX (runnable/test16096.sh with asserts on)
- Bugzilla 21085: [glue] Only 9999 "hidden identifiers" can be generated
- Bugzilla 21089: With vm.overcommit_memory=0, DMD can't link if it uses more than half the total (ram+swap) memory in the system.
- Bugzilla 21092: [ICE] Segmentation fault in ExpressionPrettyPrintVisitor::visit(CommaExp*) at dmd/hdrgen.d:2293
- Bugzilla 21096: [ICE] Segmentation fault in dmd.hdrgen.sizeToBuffer at dmd/hdrgen.d:3153
- Bugzilla 21117: When compiler segfaults running autotester, cannot tell which file it was testing
- Bugzilla 21120: Inconsistent mangling of __init symbol
- Bugzilla 21122: __traits(getAttributes) wrong scope on enums
- Bugzilla 21153: DWARF: DMD emits the mangled name for DW_AT_name
- Bugzilla 21154: DWARF: shared types are not represented
- Bugzilla 21164: segfault on incomplete static if
- Bugzilla 21181: Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles
- Bugzilla 21198: Inout copy constructor on union field does not prevent copy-initialization of union
- Bugzilla 21208: [ICE] dtoh with enums
- Bugzilla 21213: preview=dtorfields with strict attributes in base class constructor
- Bugzilla 21217: C++ header generator shouldn't emit private enums
- Bugzilla 21219: Invalid C++ header generated for extern(C++, [class|struct])
- Bugzilla 21225: preview=dtorfields inserts unnecessary dtor call in nothrow ctors
DMD Compiler enhancements
- Bugzilla 1995: invalid paths feed to -J option should be warned
- Bugzilla 12223: __traits(getMember,...) needed for aliases
- Bugzilla 14120: iasm is missing pause instruction
- Bugzilla 14697: Add support for pclmulqdq instruction to dmd's inline assembler
- Bugzilla 14936: Dividing by a power of 2 slow on 32bit
- Bugzilla 19277: storage class used in alias statement has no effect
- Bugzilla 19663: On x86_64 the fabs intrinsic should use SSE
- Bugzilla 19705: Static foreach slow for numeric ranges
- Bugzilla 20931: code which was executed at ctfe should be accounted for in coverage
- Bugzilla 20990: Optimizer should move cold branches to the end of the function
- Bugzilla 21060: ICE in semantic, at d/dmd/dstruct.c:1224
- Bugzilla 21159: DWARF: DW_AT_pure should be emitted for pure functions
Phobos regressions
- Bugzilla 21129: [REG2.090] std.range.only broken for reference conversions of local copies of parameters
Phobos bugs
- Bugzilla 7033: File.rawWrite is slow on Windows
- Bugzilla 12521: std.getopt does not conform to documentation
- Bugzilla 20370: On POSIX, std.file.copy only copies the file times at second precision
- Bugzilla 20765: Can't run processes with relative paths when specifying a working directory
- Bugzilla 20929: std.experimental.allocator.expandArray's range-based overload fails to instantiate for char and wchar arrays.
- Bugzilla 20949: std.range.popFront is unsafe in release mode
- Bugzilla 20984: Heisenbug: FreeBSD64 Phobos random test suite failure in std/process
- Bugzilla 21021: std.variant confused by alias this when struct larger than maxDataSize
- Bugzilla 21148: Semaphoreci: core.exception.AssertError@std/file.d(1929): unittest failure
- Bugzilla 21182: asm code is missing int ptr and so defaults to byte op
- Bugzilla 21183: schwartzSort does not strip const
- Bugzilla 21191: min should be stable: when in doubt, return the first argument
- Bugzilla 21199: Nullable.apply should take string expression like rest of Phobos
- Bugzilla 21210: std.traits : isAssignable false positive on disabled copy struct
Phobos enhancements
- Bugzilla 20889: Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
- Bugzilla 21113: std.file.thisExePath on NetBSD depends upon the /proc filesystem
- Bugzilla 21131: Appender with string does not process UTF input ranges properly
- Bugzilla 21201: let std.uuid.parseUUID accept input ranges whose elements are char or wchar, not just dchar
Druntime bugs
- Bugzilla 19554: [2.084.0] Confusing message - Warning: struct Foo has method toHash
- Bugzilla 20910: Default unittest runner reports wrong unittest count
- Bugzilla 21029: Remove __ArrayEq which the compiler no longer uses as of DMD PR #11212
- Bugzilla 21055: core.stdc.stdarg is not @nogc
- Bugzilla 21116: onArrayCastError is horribly unsafe
Druntime enhancements
- Bugzilla 21026: add core.bitop.byteswap(ushort)
- Bugzilla 21070: -profile=gc makes the program much slower
dlang.org bugs
- Bugzilla 13569: Inconsistent integer divide by zero behavior and spec
- Bugzilla 21059: install.sh: posix_terminal returns false on Linux Mint 20
Contributors to this release (50)
A huge thanks goes to all the awesome people who made this release possible.
- Adam D. Ruppe
- Adela Vais
- aG0aep6G
- Andrei Alexandrescu
- Andrej Mitrovic
- Andrey Zherikov
- Anton Oks
- Bastiaan Veelo
- Boris Carvajal
- canopyofstars
- Denis Feklushkin
- dkorpel
- Euan Torano
- Florian
- H. S. Teoh
- Harry Gillanders
- Iain Buclaw
- Jacob Carlborg
- John Colvin
- Lance Bachmeier
- Lucien Perregaux
- Luhrel
- Mark
- Markus Laker
- Martin Kinkelin
- Martin Nowak
- Mathias Lang
- Mathis Beer
- Mike Parker
- MoonlightSentinel
- Nathan Sashihara
- Nicholas Wilson
- Nick Treleaven
- Nils Lankila
- nordlow
- Olivier Léobal
- Paul Backus
- Per Nordlöw
- Rainer Schuetze
- Razvan Nitu
- Richard Manthorpe
- Sebastian Wilzbach
- Simen Kjærås
- Stefan Koch
- Steven Schveighoffer
- Tim Schendekehl
- Vlad Nastase
- Vladimir Panteleev
- Walter Bright
- سليمان السهمي (Suleyman Sahmi)