https://issues.dlang.org/show_bug.cgi?id=21583

Berni44 <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Berni44 <[email protected]> ---
The reason is the cast() here:

emplaceRef!(Unqual!T)(bigData[len], cast() item);

found in std.array:

https://github.com/dlang/phobos/blob/a1ee4fd4fd02529f5849e317fe9eccb8280f4b37/std/array.d#L3466

(Error: cast from `const(Block)` to `Block` not allowed in safe code)



If it is replaced by 

emplaceRef!(Unqual!T)(bigData[len], () @trusted { return cast() item; }() );

the example works. But I'm not sure if I want to trust that cast...

--

Reply via email to