From nobody Sat Apr 5 01:35:23 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738939228; cv=none; d=zohomail.com; s=zohoarc; b=OGfjT3MHME9Fn6lKD0VC7vFzWST1DfCZclR7POIB48q+R+z/0ErRMHgli0caKK0qDJ5d/zTNWA2Zq5hz3CnukURahUyXp7bBQkyPMxkRhlJxx/RI8uFrs4x5+PFkm2oZp5HN4RhaR3JTvwDKka0WD4QD03PcB/zda3Nqls6cEsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738939228; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=V4vYN424Zst0W94i5JbD8fyChMDv/Dgup2Y4cOwoh0g=; b=hxwNmrfKxRGOoiIIqFKUtRpqKWpvAT9AWSGKs6jaTDg3MVX54wtf/cna13fv7AY+8duitb6kxHWnkUIYdu4Cqg347IV3w0+0oNr7CHuOomOxiVK7Wr/HFpd+RTH6yaq17hYbq71BDjoUMKao9RFUk6GkVJG/RoP6lH+REc26vFY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173893922809062.77828765595177; Fri, 7 Feb 2025 06:40:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tgPWX-0004ih-RI; Fri, 07 Feb 2025 09:40:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgPWV-0004fg-QH for qemu-devel@nongnu.org; Fri, 07 Feb 2025 09:40:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgPWU-0004ij-7E for qemu-devel@nongnu.org; Fri, 07 Feb 2025 09:40:03 -0500 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-v5KpEZ_jMHKZLKmD_XlubQ-1; Fri, 07 Feb 2025 09:39:58 -0500 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5dcd3120b24so2478264a12.1 for ; Fri, 07 Feb 2025 06:39:58 -0800 (PST) Received: from [192.168.10.3] ([151.62.97.55]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dcf1b7ae65sm2549015a12.17.2025.02.07.06.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 06:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738939200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V4vYN424Zst0W94i5JbD8fyChMDv/Dgup2Y4cOwoh0g=; b=UuBTZ2tCzuKPF/4DhLQyHzGWoB26uvcc3seTmN/+420KY1YGgq90bTJQ9RsaZXPx+Y0FBd CT9prboE03VjWFjTg52ccL6W5lWBOuVppT4T/A7oaPPt/q90i/sdhMT1i7cCxBKEL/X6lk inyI5OJcmYOXFhvVGgzsRi6vzD+h10M= X-MC-Unique: v5KpEZ_jMHKZLKmD_XlubQ-1 X-Mimecast-MFC-AGG-ID: v5KpEZ_jMHKZLKmD_XlubQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738939196; x=1739543996; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V4vYN424Zst0W94i5JbD8fyChMDv/Dgup2Y4cOwoh0g=; b=Dh8B8zO303DKs8WqMg6x8BASldV3Dj0d+SgIbunf50V46BZD2vhzCicAyKfwvtWXvt 2Z3WTAUWu7ZdIq4/A98o9vskND+opo51spU3NjesjuwWJpJKt8UDfuj6hhAm7a0ZnFyK hJeaJb55/NuX/M8pHX85WNyc8PaE42qW6HcjmsWfCyW6qyX9sU5400/oX5d9NX0tUc9N ehvBh3wkwLk44N3HWRSJNqvDCF1rQrUqtm/9s65gHppHjANJ2lifuVXeA5oF6TtefpCb dmLhpxYgrPBXz/fi5joylxzCaO2vvB0j7jngQmNE9Rx6NWLi6vcIU0p5DEoB9HHqD79o khHg== X-Gm-Message-State: AOJu0YxDuhySjNTUOxEcpAs1beJ0iQLVZfOp/vvxWvYM0XRogLYEcNFK 0bWvrDO6alWC5PGY6NlXEy6LBDACFrSvrtV+/FXvUbk5zKKIAvqzySvlZ2oLX3kK7ExB8dzpu7k RjLJdx2uar6Z4Jr44zrB3R9UskT16NKAT85rVVWTouyyNOFz81ur4rEvtjhgQ+Ch8lQMD9GEFZ2 j4OVEH0w3bsGjTWsORmmL8dOPd6/3MOff2qJY5IoM= X-Gm-Gg: ASbGncsBAzANtfI46qmRlhLhzroJadSfOWctFhDijr6t64I4etiWS0y35dFHrvPyH50 SE2mWzAeTd8gwndRIV5u1rNPFAtu176cMKk8WDnCb/yHwNXw9cjIJBJAbEjC4EEMU9Mki2OIcbP iofOJS+f+pwR4OsREyE/2a4pwboQsp27sLruqLyoFOZRlwY/AcYJJGbESQfG+QT7pQhd4yyQEUw cmpg3qABk05ZPP5pdNZaVDl05p09UeIBgeAY78QqeD+/S5/tYvCUXBOb/DAsw7HsHA61JHav1S/ 0/ABDw== X-Received: by 2002:a05:6402:e8a:b0:5dc:a44f:6ec4 with SMTP id 4fb4d7f45d1cf-5de45018934mr4660815a12.13.1738939196228; Fri, 07 Feb 2025 06:39:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFt8z6hhClcKw+IkdWrfCzLuzskC5ay1gUIrxBvWYM48W9IW9cCggo44xDh4DzYCVksEsc9MA== X-Received: by 2002:a05:6402:e8a:b0:5dc:a44f:6ec4 with SMTP id 4fb4d7f45d1cf-5de45018934mr4660768a12.13.1738939195756; Fri, 07 Feb 2025 06:39:55 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, qemu-rust@nongnu.org Subject: [PATCH] rust: restrict missing_const_for_fn to qemu_api crate Date: Fri, 7 Feb 2025 15:39:52 +0100 Message-ID: <20250207143952.2486587-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738939230488019100 Content-Type: text/plain; charset="utf-8" missing_const_for_fn is not necessarily useful or good. For example in a private API you can always add const later, and in a public API it can be unnecessarily restrictive to annotate everything with const (blocking further improvements to the API). Nevertheless, QEMU turns it on because qemu_api uses const quite aggressively and therefore it can be handy to have as much as possible annotated with const. Outside qemu_api though, not so much: devices are self contained consumers and if there is nothing that could use their functions in const contexts that were not anticipated. Since missing_const_for_fn can be a bit noisy and trigger on trivial functions that no one would ever call in const context, do not turn it on everywhere and only keep it in qemu_api as a special case. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- rust/Cargo.toml | 1 - rust/qemu-api/src/lib.rs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 5b6b6ca4382..5b0cb559286 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -52,7 +52,6 @@ empty_structs_with_brackets =3D "deny" ignored_unit_patterns =3D "deny" implicit_clone =3D "deny" macro_use_imports =3D "deny" -missing_const_for_fn =3D "deny" missing_safety_doc =3D "deny" multiple_crate_versions =3D "deny" mut_mut =3D "deny" diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs index bfb6c6d6e42..20134d75ce5 100644 --- a/rust/qemu-api/src/lib.rs +++ b/rust/qemu-api/src/lib.rs @@ -4,6 +4,8 @@ =20 #![cfg_attr(not(MESON), doc =3D include_str!("../README.md"))] =20 +#![deny(clippy::missing_const_for_fn)] + #[rustfmt::skip] pub mod bindings; =20 --=20 2.48.1