Bug 22289 – Can't `std.algorithm.mutation: copy` a `scope` string into an an `Appender` with DIP1000

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-08T01:50:30Z
Last change time
2024-12-01T16:39:19Z
Keywords
industry, safe
Assigned to
No Owner
Creator
Mathias LANG
Moved to GitHub: phobos#10475 →

Comments

Comment #0 by pro.mathias.lang — 2021-09-08T01:50:30Z
``` import std.algorithm.mutation : copy; import std.array : Appender; void issueXXX (scope const char[] data) @safe { Appender!string buffer; copy(data, buffer); } ``` Expected: Compiles Actual result when compiled with `-preview=dip1000`: ``` onlineapp.d(7): Error: scope variable `data` assigned to non-scope parameter `source` calling std.algorithm.mutation.copy!(const(char)[], Appender!string).copy ``` This affects https://github.com/dlang-community/D-YAML
Comment #1 by robert.schadek — 2024-12-01T16:39:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10475 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB