Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Change Log: 2.094.0

previous version: 2.093.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


2.094.0 comes with 12 major changes and 128 fixed Bugzilla issues. A huge thanks goes to the 50 contributors who made 2.094.0 possible.

List of all upcoming bug fixes and enhancements in D 2.094.0.

Compiler changes

  1. 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.

  2. 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
    {
    
    }
    
  3. 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;
    }
    
  4. 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

  1. 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

  2. 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.

  3. 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");
    }
    
  4. 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

  1. 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

  1. 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.

  2. 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"
        ],
    
  3. 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

  1. Bugzilla 18412: [REG2.077.0] immutable array in library becomes null when referenced in static constructor
  2. Bugzilla 19476: explicit mixin template function call results in recursive call instead
  3. Bugzilla 20296: Segfault when using variadic D functions with extern(C++) linkage
  4. Bugzilla 20620: dmd version has -dirty suffix
  5. Bugzilla 20958: incomplete semantic analysis when generating code for function
  6. Bugzilla 20981: Runtime segfault for inlined __simd_sto
  7. Bugzilla 21063: getLinkage is wrong for forward reference extern(C++) class
  8. Bugzilla 21074: const lost in mixin
  9. Bugzilla 21088: std.meta.staticMap no longer works for typeid
  10. Bugzilla 21091: [ICE] Segmentation fault: Module::importAll(Scope*) (this=0x0, prevsc=0x0) at dmd/dmodule.d:1124
  11. Bugzilla 21095: [ICE] AssertError@dmd/expressionsem.d(5015): Assertion failure
  12. Bugzilla 21163: Scope lambda argument in struct initializer causes parsing error
  13. Bugzilla 21196: [REG 2.092] Deprecation for language feature triggered inside of deprecated block
  14. Bugzilla 21258: Tuple parameters with defaults use the first tuple element for all defaults since 2.094.0-beta.1

DMD Compiler bugs

  1. Bugzilla 2617: asm silently accepts ambiguous-sized operations
  2. Bugzilla 5570: 64 bit C ABI not followed for passing structs and complex numbers as function parameters
  3. Bugzilla 5922: inline assembler - referencing immutable variable values fails
  4. Bugzilla 6166: Named return value optimization not dealt with in inline assembler
  5. Bugzilla 6459: Inline assembler does not work well for 64 bit registers R8..R15
  6. Bugzilla 7387: call instruction does not understand $
  7. Bugzilla 10966: Optimizer generates wrong code with try-catch
  8. Bugzilla 12490: No "Error: , has no effect" Error for comma expression LHS
  9. Bugzilla 12730: lea instruction accepts subtraction of scaling register but actually adds
  10. Bugzilla 12832: asm movdqu accepts wrong operand size
  11. Bugzilla 13215: Error message with static this array assignment
  12. Bugzilla 13957: 64 bit C ABI not followed for passing structs with floating+integer types
  13. Bugzilla 14203: Return of floating point values from extern(C++) member functions does not match dmc
  14. Bugzilla 14458: very slow ubyte[] assignment (dmd doesn't use memset)
  15. Bugzilla 14872: [2.068.2] Label address in asm [x86-64]
  16. Bugzilla 15103: Improve declaration / initialization syntax error message
  17. Bugzilla 15257: __traits(compiles, …) with malformed inline asm silently ends compilation
  18. Bugzilla 15745: Inline Assembly stomped on by Profiling
  19. Bugzilla 16044: __traits(allMembers) returns empty tuple for subpackages
  20. Bugzilla 16092: AVX registers YMM0-YMM7 are inaccessible to 32-bit asm
  21. Bugzilla 16268: Wrong loop optimization in code with integer overflow
  22. Bugzilla 16317: Wrong binop evaluation/load order when optimizing
  23. Bugzilla 16400: naked variadic C function emits broken prologue
  24. Bugzilla 16857: inline assembler reverses operands of VPEXTRW instruction
  25. Bugzilla 16963: Forward reference label name resolution in asm statement
  26. Bugzilla 17351: Static const array can't be evaluated at compile time when passed as ref argument
  27. Bugzilla 17617: No RIP relative addressing available in x64 inline assembly (iasm)
  28. Bugzilla 17720: Wrong code using vector extensions with different types
  29. Bugzilla 17965: Usage of the FPU while function result already in right XMM registers
  30. Bugzilla 18373: The inline assembler parser allows strange constructs
  31. Bugzilla 18748: bt instruction with immediate offset uses 64-bit variant for 32-bit data
  32. Bugzilla 18749: bt instruction using 64-bit register for 32-bit offset
  33. Bugzilla 19179: extern(C++) small-struct by-val uses wrong ABI
  34. Bugzilla 19210: Poor error message for return function parameter that is not ref
  35. Bugzilla 19384: [Codegen] Address of stack temporary is returned
  36. Bugzilla 19729: Constructor overloads coming from mixin are not resolved
  37. Bugzilla 19846: zero size function parameter such as byte[0] causes code to not be executed
  38. Bugzilla 20017: JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection
  39. Bugzilla 20162: Sign Extension for ?: optimization done wrong
  40. Bugzilla 20363: painting XMM registers as integers leads to codegen bugs
  41. Bugzilla 20422: confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"
  42. Bugzilla 20761: __traits(isSame) for alias tuples is broken and underspecified
  43. Bugzilla 20831: __traits(getAttributes) failes to compile when used on a parameter with no name
  44. Bugzilla 20911: Documentation for test/unit is non-existant
  45. Bugzilla 20934: preview=dtorfields segfaults for disabled/extern constructors
  46. Bugzilla 20938: Cannot create const arrays mixing immutable and mutable structs with indirections
  47. Bugzilla 20963: wrong code for cast(double)anUlong
  48. Bugzilla 20995: Range violation with -preview=dip1021
  49. Bugzilla 21001: Private alias becomes public if used before declaration
  50. Bugzilla 21019: Azure pipelines Windows_VisualD win32-ldc fails with Heisenbug
  51. Bugzilla 21037: AVX code sometimes fails to set VEX prefix
  52. Bugzilla 21038: wchar and dchar string alignment should be 2 and 4, respectively
  53. Bugzilla 21040: SIMD: illegal instruction using 32-byte operations on AVX
  54. Bugzilla 21050: __traits(getOverloads) for templates returns incorrect symbol for the first overload
  55. Bugzilla 21053: Test Suite run.d is built with compiler under test, must be build with bootstrap dmd
  56. Bugzilla 21058: __traits(getOverloads) forgets "this" with third argument or if first overload is a template
  57. Bugzilla 21082: Testsuite fails on OSX (runnable/test16096.sh with asserts on)
  58. Bugzilla 21085: [glue] Only 9999 "hidden identifiers" can be generated
  59. 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.
  60. Bugzilla 21092: [ICE] Segmentation fault in ExpressionPrettyPrintVisitor::visit(CommaExp*) at dmd/hdrgen.d:2293
  61. Bugzilla 21096: [ICE] Segmentation fault in dmd.hdrgen.sizeToBuffer at dmd/hdrgen.d:3153
  62. Bugzilla 21117: When compiler segfaults running autotester, cannot tell which file it was testing
  63. Bugzilla 21120: Inconsistent mangling of __init symbol
  64. Bugzilla 21122: __traits(getAttributes) wrong scope on enums
  65. Bugzilla 21153: DWARF: DMD emits the mangled name for DW_AT_name
  66. Bugzilla 21154: DWARF: shared types are not represented
  67. Bugzilla 21164: segfault on incomplete static if
  68. Bugzilla 21181: Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles
  69. Bugzilla 21198: Inout copy constructor on union field does not prevent copy-initialization of union
  70. Bugzilla 21208: [ICE] dtoh with enums
  71. Bugzilla 21213: preview=dtorfields with strict attributes in base class constructor
  72. Bugzilla 21217: C++ header generator shouldn't emit private enums
  73. Bugzilla 21219: Invalid C++ header generated for extern(C++, [class|struct])
  74. Bugzilla 21225: preview=dtorfields inserts unnecessary dtor call in nothrow ctors

DMD Compiler enhancements

  1. Bugzilla 1995: invalid paths feed to -J option should be warned
  2. Bugzilla 12223: __traits(getMember,...) needed for aliases
  3. Bugzilla 14120: iasm is missing pause instruction
  4. Bugzilla 14697: Add support for pclmulqdq instruction to dmd's inline assembler
  5. Bugzilla 14936: Dividing by a power of 2 slow on 32bit
  6. Bugzilla 19277: storage class used in alias statement has no effect
  7. Bugzilla 19663: On x86_64 the fabs intrinsic should use SSE
  8. Bugzilla 19705: Static foreach slow for numeric ranges
  9. Bugzilla 20931: code which was executed at ctfe should be accounted for in coverage
  10. Bugzilla 20990: Optimizer should move cold branches to the end of the function
  11. Bugzilla 21060: ICE in semantic, at d/dmd/dstruct.c:1224
  12. Bugzilla 21159: DWARF: DW_AT_pure should be emitted for pure functions

Phobos regressions

  1. Bugzilla 21129: [REG2.090] std.range.only broken for reference conversions of local copies of parameters

Phobos bugs

  1. Bugzilla 7033: File.rawWrite is slow on Windows
  2. Bugzilla 12521: std.getopt does not conform to documentation
  3. Bugzilla 20370: On POSIX, std.file.copy only copies the file times at second precision
  4. Bugzilla 20765: Can't run processes with relative paths when specifying a working directory
  5. Bugzilla 20929: std.experimental.allocator.expandArray's range-based overload fails to instantiate for char and wchar arrays.
  6. Bugzilla 20949: std.range.popFront is unsafe in release mode
  7. Bugzilla 20984: Heisenbug: FreeBSD64 Phobos random test suite failure in std/process
  8. Bugzilla 21021: std.variant confused by alias this when struct larger than maxDataSize
  9. Bugzilla 21148: Semaphoreci: core.exception.AssertError@std/file.d(1929): unittest failure
  10. Bugzilla 21182: asm code is missing int ptr and so defaults to byte op
  11. Bugzilla 21183: schwartzSort does not strip const
  12. Bugzilla 21191: min should be stable: when in doubt, return the first argument
  13. Bugzilla 21199: Nullable.apply should take string expression like rest of Phobos
  14. Bugzilla 21210: std.traits : isAssignable false positive on disabled copy struct

Phobos enhancements

  1. Bugzilla 20889: Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
  2. Bugzilla 21113: std.file.thisExePath on NetBSD depends upon the /proc filesystem
  3. Bugzilla 21131: Appender with string does not process UTF input ranges properly
  4. Bugzilla 21201: let std.uuid.parseUUID accept input ranges whose elements are char or wchar, not just dchar

Druntime bugs

  1. Bugzilla 19554: [2.084.0] Confusing message - Warning: struct Foo has method toHash
  2. Bugzilla 20910: Default unittest runner reports wrong unittest count
  3. Bugzilla 21029: Remove __ArrayEq which the compiler no longer uses as of DMD PR #11212
  4. Bugzilla 21055: core.stdc.stdarg is not @nogc
  5. Bugzilla 21116: onArrayCastError is horribly unsafe

Druntime enhancements

  1. Bugzilla 21026: add core.bitop.byteswap(ushort)
  2. Bugzilla 21070: -profile=gc makes the program much slower

dlang.org bugs

  1. Bugzilla 13569: Inconsistent integer divide by zero behavior and spec
  2. 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.

previous version: 2.093.0