File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1040,6 +1040,9 @@ Throws: `ErrnoException` if the file is not opened or the call to `fread` fails.
1040
1040
assert (buf == " \r\n\n\r\n " );
1041
1041
}
1042
1042
1043
+ // https://issues.dlang.org/show_bug.cgi?id=24685
1044
+ static assert (! __traits(compiles, (File f) @safe { int * [1 ] bar; f.rawRead(bar[]); }));
1045
+
1043
1046
// https://issues.dlang.org/show_bug.cgi?id=21729
1044
1047
@system unittest
1045
1048
{
@@ -4534,6 +4537,13 @@ private auto trustedFwrite(T)(FILE* f, const T[] obj) @trusted
4534
4537
* Convenience function that forwards to `core.stdc.stdio.fread`
4535
4538
*/
4536
4539
private auto trustedFread (T)(FILE * f, T[] obj) @trusted
4540
+ if (! imported! " std.traits" .hasIndirections! T)
4541
+ {
4542
+ return fread (obj.ptr, T.sizeof, obj.length, f);
4543
+ }
4544
+
4545
+ private auto trustedFread (T)(FILE * f, T[] obj) @system
4546
+ if (imported! " std.traits" .hasIndirections! T)
4537
4547
{
4538
4548
return fread (obj.ptr, T.sizeof, obj.length, f);
4539
4549
}
You can’t perform that action at this time.
0 commit comments