From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119775 invoked by alias); 30 Oct 2016 02:53:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 119397 invoked by uid 89); 30 Oct 2016 02:52:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=wind, H*r:4.86_1, H*F:U*tom, tom@tromey.com X-HELO: gproxy5-pub.mail.unifiedlayer.com Received: from gproxy5-pub.mail.unifiedlayer.com (HELO gproxy5-pub.mail.unifiedlayer.com) (67.222.38.55) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Sun, 30 Oct 2016 02:52:28 +0000 Received: (qmail 1922 invoked by uid 0); 30 Oct 2016 02:52:26 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy5.mail.unifiedlayer.com with SMTP; 30 Oct 2016 02:52:26 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id 1esP1u00S2f2jeq01esSWN; Sat, 29 Oct 2016 20:52:26 -0600 X-Authority-Analysis: v=2.1 cv=IecUBwaa c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=zstS-IiYAAAA:8 a=IDgHdYLSUs0uqEP-IGIA:9 a=XUSUaItw8G8A:10 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:58512 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1c0gER-0005sx-CH; Sat, 29 Oct 2016 20:52:23 -0600 From: Tom Tromey To: Tom Tromey Cc: Manish Goregaokar , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix handling of discriminantless univariant enums in Rust References: <87pomiwo1z.fsf@tromey.com> Date: Sun, 30 Oct 2016 02:53:00 -0000 In-Reply-To: <87pomiwo1z.fsf@tromey.com> (Tom Tromey's message of "Sat, 29 Oct 2016 20:47:20 -0600") Message-ID: <87lgx6wntm.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1c0gER-0005sx-CH X-Source-Sender: 174-16-143-211.hlrn.qwest.net (bapiya) [174.16.143.211]:58512 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00842.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> Also, I suspect this will wind up doing the wrong thing in the Tom> STRUCTOP_ANONYMOUS case in rust_evaluate_subexp. In particular I wonder Tom> if an additional "print univariant.0.a" test will work correctly? Oh duh, I see that this isn't a correct counter-example. What about just "print univariant.a"? It seems to me that this will hit this: start = disr.is_encoded ? 0 : 1; ... choosing 1 here, but: for (i = start; i < TYPE_NFIELDS (variant_type); i++) ... failing this because TYPE_NFIELDS == 1; and then: if (i == TYPE_NFIELDS (variant_type)) /* We didn't find it. */ error(_("Could not find field %s of struct variant %s"), Tom