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

previous version: 2.092.1 – next version: 2.093.1

Download D 2.093.0
released Jul 07, 2020

2.093.0 comes with 11 major changes and 58 fixed Bugzilla issues. A huge thanks goes to the 54 contributors who made 2.093.0 possible.

List of all bug fixes and enhancements in D 2.093.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. Dub root package target environment variables added

    Environment variables DUB_ROOT_PACKAGE_TARGET_TYPE, DUB_ROOT_PACKAGE_TARGET_PATH and DUB_ROOT_PACKAGE_TARGET_NAME have been added and exposed.

  2. Improved CLI extensibility

    The code from the runDubCommandLine was moved to some other structs. The new CommandLineHandler structure takes care of the CLI state and commands, which allows DUB commands to be extended in other projects.

    The CommandArgs class now has new hasAppArgs and appArgs methods which allows you to get the app arguments. In addition, the extractAllRemainingArgs method will return all unused arguments and the app arguments.


List of all bug fixes and enhancements in D 2.093.0:

DMD Compiler regressions

  1. Bugzilla 19550: [REG 2.078] Massive compiler backend slowdown
  2. Bugzilla 20014: [REG 2.084] -transition=all, -preview=all, -revert=all is invalid
  3. Bugzilla 20833: Template members prevent __traits(getOverloads) from working properly

DMD Compiler bugs

  1. Bugzilla 11292: Cannot re-initialize a const field in postblit
  2. Bugzilla 12504: Wrong 'cannot cover index range' error message
  3. Bugzilla 15235: inline asm: silent ICE (segfault) in asm_add_exp()
  4. Bugzilla 16971: Misleading error messages "break is not inside scope(exit) bodies" "continue is not inside scope(exit) bodies"
  5. Bugzilla 20183: Assigning statement scope of struct literal or temporary to variable with longer lifetime
  6. Bugzilla 20410: ReplaceTypeUnless replaces enums with their basetype
  7. Bugzilla 20709: Segmentation fault when importing nonexistent type
  8. Bugzilla 20719: Self referential struct definition causes stack overflow
  9. Bugzilla 20747: @live tracking of non-pointer owners not done
  10. Bugzilla 20771: va_arg doesn't work for structs with postblits
  11. Bugzilla 20772: va_arg doesn't work for structs with copy constructors
  12. Bugzilla 20775: Missing fail compilation test for passing types that need destruction
  13. Bugzilla 20780: Function parameter UDA not accepted in nested function declarations
  14. Bugzilla 20789: is(T: U) doesn't exclude deprecated alias calls with -de
  15. Bugzilla 20800: Error: cannot implicitly convert expression with bad diagnostic.
  16. Bugzilla 20824: error messages generated by dmd build script can be prefixed with a non-standard "ERROR:"
  17. Bugzilla 20825: the filename of the error messages generated by dmd build.d script miss the "src/" part of the path
  18. Bugzilla 20840: No deprecation when using template from deprecated selective import
  19. Bugzilla 20842: Structs with disabled default/copy ctors can't be initialized
  20. Bugzilla 20861: Interface implementations are not checked when code gen is skipped
  21. Bugzilla 20903: seg fault on long signed divide overflow
  22. Bugzilla 20906: unnecessary divide-by-zero errors when constant folding short circuits
  23. Bugzilla 20909: .offsetof fails on forward reference of field
  24. Bugzilla 20915: __traits(allMembers) results include custom version identifiers, which is unusable
  25. Bugzilla 20923: Redefinition of 'size_t' is affecting TypeStruct functions
  26. Bugzilla 20989: Checking array.ptr causes safety error with -checkaction=context

DMD Compiler enhancements

  1. Bugzilla 20791: extern(C++ ) should allow a trailing comma
  2. Bugzilla 20796: protection attribute package(x.y) does not bind to one of ancestor packages of module x.y when declared in x/y/package.d

Phobos regressions

  1. Bugzilla 20943: std.algorithm.setops.cartesianProduct fails for ranges with @system popFront

Phobos bugs

  1. Bugzilla 9298: some std.math functions not implemented for Win64
  2. Bugzilla 20426: doesPointTo with void[N] fails
  3. Bugzilla 20751: SortedRange with ref predicate parameters fails
  4. Bugzilla 20782: std.conv.to can't convert string to const enum
  5. Bugzilla 20783: std.string.lastIndexOf doesn't work correctly in CTFE
  6. Bugzilla 20836: std.math: reorder declarations from most visible to least
  7. Bugzilla 20850: Can't assign enum of Tuple
  8. Bugzilla 20874: std.json.assign requires '@safe' and 'pure'
  9. Bugzilla 20928: Overloaded opIndex confuses MapResult

Phobos enhancements

  1. Bugzilla 19525: Duration is not usable with zero-arg std.algorithm.sum
  2. Bugzilla 20496: chunkby should support ref predicates
  3. Bugzilla 20869: std.algorithm.mutation : move is overly trusting of opPostMove
  4. Bugzilla 20887: Improve speed of std.digest.digest!(Hash, Range) on non-array ranges

Druntime bugs

  1. Bugzilla 18011: core.sys.condition cannot be used as shared
  2. Bugzilla 20760: checkaction=context doesnt print floating point numbers correctly
  3. Bugzilla 20763: checkaction=context does not format pointers
  4. Bugzilla 20767: [DIP1014] __move_post_blt must only recursively call itself on a struct's fields not all members
  5. Bugzilla 20768: [DIP1014] __move_post_blt must recursively call itself on static arrays whose elements are structs or static arrays that recursively contain structs
  6. Bugzilla 20852: core.sys.posix.sys.wait missing definitions on FreeBSD

Druntime enhancements

  1. Bugzilla 20746: Change LCG in garbage collector treap to use full 64 bits of state instead of 48
  2. Bugzilla 20787: Add module core.sys.darwin.sys.attr with getattrlist, setattrlist, searchfs, and related definitions
  3. Bugzilla 20844: DMD compiler should take care of data alignment, after seeing the 'cas' call
  4. Bugzilla 20859: Add overloads of core.sync.rwmutex.ReadWriteMutex.Reader/Writer.tryLock that take a timeout duration

dlang.org enhancements

  1. Bugzilla 20882: Outdated examples in the documentation (std.stdio)

Tools enhancements

  1. Bugzilla 13345: rdmd --eval doesn't support args

Installer bugs

  1. Bugzilla 20826: CI breakage: create_dmd_release attempts to copy the complete dmd repo.

Contributors to this release (54)

A huge thanks goes to all the awesome people who made this release possible.

previous version: 2.092.1 – next version: 2.093.1