Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5514216rdb; Wed, 13 Dec 2023 10:44:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUL1Rz5v0SMZexn5JL6jxxJi1R3K6XmQEyJrVZOkCJ4yN4m2cF3iE/6kLYT7HWRPqKFiCI X-Received: by 2002:a05:6358:d585:b0:170:6ed7:391e with SMTP id ms5-20020a056358d58500b001706ed7391emr3210463rwb.6.1702493087604; Wed, 13 Dec 2023 10:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702493087; cv=none; d=google.com; s=arc-20160816; b=oB+nSU66LL1N9QS1saso0WeIeiartuZahhZ6YWQ/vj3sSf2W1Y8cU3R2Q1vlq1YkgL TctsKSDbvPvO1hKf6zN66FeP2fLw6+dO8gXiit6CzmZZOxLBJzyhhqMiWgUuixb4hdaw 17csbWx7UBCEf+z+xpFhPt24qnzdpihRhl/HdqXV4jEOXWfk+vcf9La8IwhBJ22/9ez1 plDMAHsjYjr+WtojsdCBgU4pxVeMbR3q2U0RwXcYioCQ15fSocj1+ToSB4opTNXmihak EkiH7Tc8ww3+VuvTaHT/PatYJ9d8ykuY1zABco64aVnNsloo4gRIw2NLMBfFTM3WTXMM OGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=o89+rTPkyZ2u4xqSnh8fhH0cKv+jKXfmZsjDkxKQnFo=; fh=8U6KScOodOXthNwhvOC6MxgC3Cuj/xWnFinZk/6GdV4=; b=Su9aaUTDp4n91Kp+afz62zxX8fVeZo34FCP33I8vKJf/oRUQZYPLGusjbEnVKWsfOD eN+z7XjyDB8bzZpi5VnLxp/xyWWXPXzot059bGQwxIfXiC0bCQZ8Pphd4UeYYKf+69MV VRi8HDJq2iyk9ItWTcpWnOaVPOv42HBRiwYMLks/qa2YH//ZpCs2NoWpAPw06F6oqPQ1 WcvDK46EL5vMPam81tWWOlb2EtNm8KpSERm0bCoK2/+cVP+wm51cd20cKKBzRoWStASY WBX6RLiN8ygCetA0cS2Pmz9aJCxfSRfvP2wHIbQBckN2cPpxKnKvzxC4ZWgrLzl4aMY5 3SqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LTVsUC0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id 199-20020a6301d0000000b0057745d87b53si9773655pgb.686.2023.12.13.10.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LTVsUC0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2E4A081C2029; Wed, 13 Dec 2023 10:44:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjLMSoa (ORCPT + 99 others); Wed, 13 Dec 2023 13:44:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjLMSo3 (ORCPT ); Wed, 13 Dec 2023 13:44:29 -0500 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CEACF2; Wed, 13 Dec 2023 10:44:35 -0800 (PST) Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-dae7cc31151so6916327276.3; Wed, 13 Dec 2023 10:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702493074; x=1703097874; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o89+rTPkyZ2u4xqSnh8fhH0cKv+jKXfmZsjDkxKQnFo=; b=LTVsUC0ADO27O2dqOjerWAWK3PuyUFgtZg8TJo1kCcEmJaa1nYDkyRG4GFMP/mLxwt YxNfnRAjmmhGcL3W5vXxgfx4JnlFrNwgCYGOroBLBQawGB9S72jUKOPvf5GawFH8XTVF SD9k+87O7doWFMZN/je9PpeWDF+UWt/MdHGB46De/HaRHHAmRvdviJOsqqx2AXKtqASI EnKpCXOdQ7WaGTZ3jRKbC0EzGfg6QGJkR8FdHaiwxlHFh6gED7Mw6gzq4BUktNf79E7k ovy1j68lr+P+sCbfCM0gWQbMYasWrxqG2gWag86L5DdIXCUQHPzvVpr2hY7tdvOBf0W/ IBsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702493074; x=1703097874; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o89+rTPkyZ2u4xqSnh8fhH0cKv+jKXfmZsjDkxKQnFo=; b=hK7pSSdZCLnRXh1agnXa0KfFEpmg2HpC7pHRpbzYzN/EPWpNmE87nW/0M4vSWxFYJG 2H6+Y12hKf7w9iVHqkROiote/hDLfBlc1GxDkdecLGRxXih3rLAxU+kaHPV6bvPhAn/V oJ9khTNUiob1dSmXsP2n6I7ym7aHduwVwcfXhoq+7COUgg3SprjgRWL2H8gRHo5TtuBS jtBDL/lvqotYm+wcdXCGtclutEDlpPdmhgVPuDzYN9T/l++Z9v57RNW8iwiRraC4L/5I oj76iSv637ri7Nlc991Lcwk0zBSDPrGVAJ4wCDcid3pl3BpxSRmsAJnViptiSn3Wn0Jh VibA== X-Gm-Message-State: AOJu0YyKDcGd7bQtjvYqiJooj5C1Y3vB6YVyFmfXt+LixteNbBnnF0Tf /w5UcXxTceHYHSPJKSoPIfDFbXF+zv/7Akl3sXc= X-Received: by 2002:a05:6902:1b04:b0:dbc:bcc7:2580 with SMTP id eh4-20020a0569021b0400b00dbcbcc72580mr2460332ybb.56.1702493074534; Wed, 13 Dec 2023 10:44:34 -0800 (PST) MIME-Version: 1.0 References: <20231118013959.37384-1-tmgross@umich.edu> In-Reply-To: <20231118013959.37384-1-tmgross@umich.edu> From: Miguel Ojeda Date: Wed, 13 Dec 2023 19:44:23 +0100 Message-ID: Subject: Re: [PATCH v2] rust: macros: update 'paste!' macro to accept string literals To: Trevor Gross Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Martin Rodriguez Reboredo , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, FUJITA Tomonori , Vincenzo Palazzo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 10:44:45 -0800 (PST) On Sat, Nov 18, 2023 at 2:43=E2=80=AFAM Trevor Gross wr= ote: > > Enable combining identifiers with literals in the 'paste!' macro. This > allows combining user-specified strings with affixes to create > namespaced identifiers. > > This sample code: > > macro_rules! m { > ($name:lit) =3D> { > paste!(struct [<_some_ $name _struct_>] {}) > } > } > > m!("foo_bar"); > > Would previously cause a compilation error. It will now generate: > > struct _some_foo_bar_struct_ {} > > Signed-off-by: Trevor Gross > Reviewed-by: Martin Rodriguez Reboredo > Reviewed-by: Vincenzo Palazzo > Reviewed-by: Alice Ryhl > Reviewed-by: Benno Lossin > Reviewed-by: Gary Guo Applied to `rust-next` (with an added `:` before the example since that is our usual convention). Thanks everyone! Cheers, Miguel