void main() @nogc { import std.algorithm: enumerate; int[1] arr; auto r = arr[].enumerate; } DMD 2.067alpha gives: test.d(4,19): Error: @nogc function 'D main' cannot call non-@nogc function 'std.range.enumerate!(uint, int[]).enumerate'
A possible solution is to replace this: auto enumerate(Enumerator = size_t, Range)(Range range, Enumerator start = 0) if (isIntegral!Enumerator && isInputRange!Range) ... if (overflow || result > Enumerator.max) throw new RangeError("overflow in `start + range.length`"); } } ... With this: auto enumerate(Enumerator = size_t, Range)(Range range, Enumerator start = 0) @nogc if (isIntegral!Enumerator && isInputRange!Range) ... if (overflow || result > Enumerator.max) { static immutable err = new RangeError("overflow in `start + range.length`"); throw err; } } } ... But I don't know if immutable errors are really correct.