Skip to content

byLine and byLineCopy should be safe #10605

@0xEAB

Description

@0xEAB

(@MartinNowak) commented on 2017-12-21T17:01:39Z

std.stdio.File.byLine:

Should be @safe as the internally used buffer is GC allocated, thus unexpected mutation of an escaped line is possible, but cannot cause a memory corruption.

@safe function 'foo' cannot call @system function 'std.stdio.File.byLine!(char, char).byLine'
@safe function 'foo' cannot call @system destructor 'std.stdio.File.ByLine!(char, char).ByLine.~this'

std.stdio.File.byLineCopy:

obviously

@safe function 'foo' cannot call @system function 'std.stdio.File.byLineCopy!(char, immutable(char)).byLineCopy'
@safe function 'foo' cannot call @system destructor 'std.stdio.File.ByLineCopy!(immutable(char), char).ByLineCopy.~this'

From: #10273

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions