Message ID | 20240130121026.807464-67-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1189877dyb; Tue, 30 Jan 2024 04:40:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGmLOCYkZHrGAyiSxvUCMofpBzjOp3t4v7jwZ0M92bQUQJO61qqNTB+WLVkpJqE2KhpkGZ X-Received: by 2002:a05:6902:1022:b0:dc2:3f75:1f79 with SMTP id x2-20020a056902102200b00dc23f751f79mr5161985ybt.23.1706618450876; Tue, 30 Jan 2024 04:40:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706618450; cv=pass; d=google.com; s=arc-20160816; b=Z3pYLoTZWfjuNyEdzSApx25cTetePkJuE3S+jFb0p3eGXdWkhMNXHocTlvSGySdGxa E6Uk1X8jfKvInXFHXtQzgwXFFaRcgtPAdVDw8RgpMo8++fn9DdoaV4jrMnfkeQlToDNz nenh165hn6LFSb0/E8pL6himG9er9nYEs1mwEuNKxEYZSlw9uMSGqMamMvOMEkumMCf0 5PE0eNXoF4HWlIo/FwI87Pah8l5ESCa5ICgT7mGwtMk+BS0RnYoWGTzUejnAmLRWFqB3 TwgxPDAy08xmRYaxzYpdrg/PphfG99KTuaMGgjrhH3VLDjtCstEm+fZ2ojhGUBaNiJ57 lsJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=qT4BM4QggUDd/mriRzEn6ZypenFxQPkGzA1q4EIkPuc=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=GXrUNxEzIFTyyaz4gtpy7/Cp8QhSej9aXgnRublGm4p801R0Pi+SSw3r53SrRI35q/ cGMWYIT93dMsCfDJPLew3UZLIRJIkQRttdhrjNL8pjA6xg5Ys2/SxxtXvqQyRM1qjMPV w/CMAm8HHTV95lKDfa90QSTlDhkfC4x9ABaj/taAo46BT4Xc6F3UqSpjPaZZm6OMf2ZZ ZTWmGtSATqPSigVIj8Pi6u79DFiqzVzHp0RsXpJ2oASJKPsJsd7RPVwcEKnBbB+FWQpy 1UGqfz67XczL2AUd6vEVryCPP9J78ZkuMnKQqWG9vsi36D7Z/ryIkuLUd/T9i12A2ybE GQFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=EOd50Tvq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g21-20020a05620a40d500b0078392e98a00si10713778qko.453.2024.01.30.04.40.50 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=EOd50Tvq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FD86386F824 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 12:40:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 6A8173857C79 for <gcc-patches@gcc.gnu.org>; Tue, 30 Jan 2024 12:11:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A8173857C79 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A8173857C79 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616727; cv=none; b=dF7E3I1DXLi7insR0InPAqP537hsXf4JWTKxAlkBh/Bh9vl4wsUkxkB3SWsvGfBAtcqCDvOZp0VRLN5ofu5qsSDLlhC42jDzmacllZbaoJNQ/XqP3LD4k6J7yvzz1K+Mqed002lVmD+7YdV7CYwkuwjuUOrCRiZp6EXGh+skKF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616727; c=relaxed/simple; bh=eq7IBo/lpEMkBfsicakGZ41Mgu3FWfx1YuVMjP7ZaRo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Al9EKP9np8BlN59m04tAxPFT3ibG052jnHQ41Y8jeqWFCFOzzb3Dgqx9dYzVQFbKyf2Xyuq5oJbTDVrvp7O5EA6VEjYUlZF8DN9BOb40DJZbmaJHJ2qk8BlZkteBju1oGYf37lyJzHPcM7xIB++UGG4OBlegrkRgdmXR1MUv95o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ae4eb360aso2240350f8f.0 for <gcc-patches@gcc.gnu.org>; Tue, 30 Jan 2024 04:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616697; x=1707221497; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=qT4BM4QggUDd/mriRzEn6ZypenFxQPkGzA1q4EIkPuc=; b=EOd50TvqRH19pdWB2FgV3eDcPTXQnU9iLSUfLG/lJWmMt4L1rSBHT6sqcVTmasylDc jsYYB0AkWQ1Ti6QxfHqeQiI2ceIwmEq9qC35BEEASuFErpqriUNeRtcHHYjYqxnbB8u1 +LPCaSGIbz7alc6cPPV77xsCh44LAKmNNJg7EKDFARCQuHn58PRMPio/2ebzqN8BBQCm ZFinDPqHkhSdLDggsuTSjLARK4U9knoZ1SjhPJteom6WmfOpEBZzN7pIKvbypJVnUeVG avi3tytqroyd0pI3rpE6iul6SCvH9L5/Q1oXJOBiIOnqX2iQ+e9H7QT3jQNn+2K7kND9 +7yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616697; x=1707221497; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qT4BM4QggUDd/mriRzEn6ZypenFxQPkGzA1q4EIkPuc=; b=UFdlMZMQuPQmzcH6o+MPLhmJcnQqWGTXWt9+ZF/7NuwV2QySXL6aYempuo9F7YhpsO XfFGCGN5TYSWxrrzZwgOH/V4qLhh1ass4rnn38wIIe9Q2OAdD3mg8nI8UJthWY+DYKAh UYD/IxRei2jjcfmr9AAOrAs/gPMrXP4wZeLztw813wELYjQXtYJCpLpqQ0xdTyvUwy6S 79h67cQ0goGa43T4L1dfW3rvHmBEMs8brnWtjAKbmJt50hqNQBlg/efS0sElCdmRnqzG zJ65JrCnms3Hv4VnP3N37BaDN1q3Lt0utEsRxNpMiLw+h+/CX6R66ipordopGfjiQ8eT EPLw== X-Gm-Message-State: AOJu0YyxSganSIOpB+7tn7DQXOGEJyTCoNt8pXWYVPZWF+tgsPt7KNak CVzkzlKzCwgR0sLRIfRepsNh60I83Kf5f/OVH0iMmgVky9j2U7OBGSiucoJTTQhG9TDhTCvsmuy Yrw== X-Received: by 2002:a5d:60ca:0:b0:337:c93d:d815 with SMTP id x10-20020a5d60ca000000b00337c93dd815mr5382324wrt.35.1706616697071; Tue, 30 Jan 2024 04:11:37 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:36 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> Subject: [COMMITTED 064/101] gccrs: Add a regression test for function body check Date: Tue, 30 Jan 2024 13:07:20 +0100 Message-ID: <20240130121026.807464-67-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789519148639421202 X-GMAIL-MSGID: 1789519148639421202 |
Series |
[COMMITTED,001/101] gccrs: Add visibility to trait item
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Jan. 30, 2024, 12:07 p.m. UTC
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> Function body check emit an error message when a required function body is missing. gcc/testsuite/ChangeLog: * rust/compile/functions_without_body.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> --- .../rust/compile/functions_without_body.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 gcc/testsuite/rust/compile/functions_without_body.rs
diff --git a/gcc/testsuite/rust/compile/functions_without_body.rs b/gcc/testsuite/rust/compile/functions_without_body.rs new file mode 100644 index 00000000000..36ddea52161 --- /dev/null +++ b/gcc/testsuite/rust/compile/functions_without_body.rs @@ -0,0 +1,21 @@ +struct MyStruct; + +trait X {} + +fn test_a(); +// { dg-error "free function without a body" "" { target *-*-* } .-1 } + +impl MyStruct { + fn test_b<T>() + // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 } + where + T: Copy; + + fn test_c<T>(); + // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 } +} + +impl X for MyStruct { + fn test_d(); + // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 } +}