[phobos] Silent failure of std.container unittests
Andrei Alexandrescu
andrei at erdani.com
Fri Jul 16 12:19:33 PDT 2010
That's a bug in the compiler that I reported. I'll get back to you guys
with std.container.
Andrei
Sean Kelly wrote:
> I'd guess this code is pre- at disable. Not sure what the correct fix is for std.container though, since it seems reasonable for .tupleof to perform a copy.
>
> On Jul 13, 2010, at 11:59 PM, Lars Tandle Kyllingstad wrote:
>
>> Thanks, Sean, that was the clue I needed. I reran the unittests,
>> compiling against an earlier version of druntime, and it turns out that
>> the failing assert is in line 1255 of container.d. That's the postblit
>> constructor of Array.Payload, which is defined simply as
>>
>> this(this)
>> {
>> assert(0);
>> }
>>
>> So, firstly: Why is the constructor defined like this? If it is meant
>> to disable copying of Array.Payload, isn't that what @disable is for?
>>
>> Moving on, I did try to @disable the postblit constructor in order to
>> track down why it's called. Then the error changes to
>>
>> std/exception.d(407): Error: struct
>> std.container.Array!(uint).Array.Payload is not copyable
>> because it is annotated with @disable
>>
>> Line 407 of exception.d is inside pointsTo(), and contains
>>
>> foreach (i, subobj; source.tupleof)
>>
>> typeof(source) is Tuple!(Payload,"_backend",ulong,"_length"), and it
>> would seem that taking .tupleof on this type attempts a copy of Payload.
>>
>> -Lars
>>
>>
>>
>> On Tue, 2010-07-13 at 07:23 -0700, Sean Kelly wrote:
>>> If a unittest throws an exception the test is marked as failed and you'll see an errorlevel 1 after the tests complete. I didn't report the exception because unittest output is often parsed to accumulate results, but this could easily be changed.
>>>
>>> Sent from my iPhone
>>>
>>> On Jul 12, 2010, at 6:55 AM, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
>>>
>>>> When running 'make unittest' on the latest revision of Phobos, it just
>>>> fails on/after std.container, without any sensible error message:
>>>>
>>>> Testing generated/posix/debug/unittest/std/container
>>>> make[1]: *** [generated/posix/debug/unittest/std/container] Error 1
>>>> make: *** [unittest] Error 2
>>>>
>>>> Anyone else seeing this?
>>>>
>>>> -Lars
>>>>
>>>> _______________________________________________
>>>> phobos mailing list
>>>> phobos at puremagic.com
>>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>> _______________________________________________
>>> phobos mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list