From 0c87ca709a5386eaebc900ae9aca4ab585e1facc Mon Sep 17 00:00:00 2001 From: Walter Bright Date: Tue, 7 Jun 2016 00:02:23 -0700 Subject: [PATCH] fix Issue 6333 - The 'capacity' function is not pure/nothrow/@safe --- src/object.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/object.d b/src/object.d index 75ef67013d7..a00a87623a9 100644 --- a/src/object.d +++ b/src/object.d @@ -2943,12 +2943,12 @@ private * * Note: The capacity of a slice may be impacted by operations on other slices. */ -@property size_t capacity(T)(T[] arr) pure nothrow +@property size_t capacity(T)(T[] arr) pure nothrow @trusted { return _d_arraysetcapacity(typeid(T[]), 0, cast(void *)&arr); } /// -unittest +@safe unittest { //Static array slice: no capacity int[4] sarray = [1, 2, 3, 4];