From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED394345724 for ; Thu, 11 Jun 2026 23:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781218887; cv=none; b=Bt+BzMVWTzBl50+6ApDwff4kcV+DWDbVbDOyw/3S+Ou4Tq3+HFryJsX8AlmPDeXWeWc1NhNp67evQWROW2TtElYWlnJp6wbyf7XunJAMkx+vap+IL5mV8kmJ5w3KIJRA6fcIiME+26i1BGn1Tx+kiF3zt0EPoyG8bQX6bQj794M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781218887; c=relaxed/simple; bh=DelHHAMFWxAl0SNZO1xnCbGRWq+KNLmV2brrXT7LscM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=oaTJVZR3BcfLAc5j7jWZaaD3oyktlRKmvfhW21W/2UYHorZKal7nS/5RSRknuXbSKxLcwTyKliXyBRPbhYi0vbc2l3hsO2mMmO/VTddOCCc8sz4OVklqCXmr0JQcui7+6F0swOWENHkU9D511ryF1a7Iu1gs+1eCCe5c2SpnUN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VJbW+8ub; arc=none smtp.client-ip=209.85.218.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VJbW+8ub" Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-bf381078ac8so32701966b.3 for ; Thu, 11 Jun 2026 16:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781218883; x=1781823683; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DOuq4y6WifNPAq57DakxdC7yB0GZEzCwPY3FwSzdtuM=; b=VJbW+8ubk2W2NiEQL4SY/3V6f6kdBQpJu7xu0SDtA1Pw+7UmGt7jSIGKpmg97gOu/0 ZOb0qNbNRWymZttyDATBPmh6t7gzOB0dSc04ojmC2acBt/+zrIaNs4Z8PYsieRFTsJFT RTajhmce9Mvgw1gAMjoVrgcduXDvvzoPMVdRY9BFFAVKfFztLgjRJk/wQy6/w9L7i3H4 oAI2uA99kizqLQwBhFIwVLwr6uGDbg3XOnN/OvYELMUToXid8BWBkODYTKivxszsV25R a4O8jZSEwSax92/zBeCbpB239gq5lCKVzZ7D/JLrbGeSIeshBXJBDhrQ1QjXUH42hyly MnRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781218883; x=1781823683; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DOuq4y6WifNPAq57DakxdC7yB0GZEzCwPY3FwSzdtuM=; b=Lz8uUxu3oIgp3ZNS2M0InCOT1t8T+q3g/5fDasFB1iNg7sYHGze+ESF+JyTIkj/rrN m04cfYcjzquBA0K7y4C6TAmcO+4h3ARDEQ5Am+0l0cNPimHS7EnHbFf5CAcOKBUZ8zL3 DPs1uE5Zfzrh/TQbmMx+mOgEUbBCS+B4cfU+ridVBfyaKTX7NLfQ8BnlDBm0/hGki/XH TlW4RMYtvquVAs7YmbVbZpQsNGhn+Nft9nF1bi2PMgg6s490N5QKuXzfQHSRml39cTqz Il5HwIuDlfRC9qLk4fLOGCBRJNUYt3QpYo14S59d3QQhkicMjRzbi7IYg/4REkDewYQt b8nA== X-Forwarded-Encrypted: i=1; AFNElJ9u1NzZUdpWAlGijpRV3+Ja3kqtlnqu5jvVfna5X0UbLwRvC3BcSTk9SWVVJsjplTJeBAHz0bevED7qYbg=@vger.kernel.org X-Gm-Message-State: AOJu0YzyLFcGNKLagIFaj2hUMg5YXSjujom5fBXbfp+vu85XcHVRLwDF RtFMHA5YXIrIAPYB5u3Td+wPDBZ/0MN73rDtHnPumm6vyUvAYAzf1w1/Xk+n+9GITEnFMhjXI2o Zvlfkolqtf5ManMz7aQ== X-Received: from ejbla25.prod.google.com ([2002:a17:906:ad99:b0:bec:f3f6:bfe9]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:9994:b0:bf0:b39:dcc8 with SMTP id a640c23a62f3a-bfe29227d51mr1961766b.26.1781218883029; Thu, 11 Jun 2026 16:01:23 -0700 (PDT) Date: Thu, 11 Jun 2026 23:01:21 +0000 In-Reply-To: <20260611190555.2298991-1-gary@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260611190555.2298991-1-gary@kernel.org> Message-ID: Subject: Re: [PATCH] rust: bitfield: mark `Debug` impl as `#[inline]` From: Alice Ryhl To: Gary Guo Cc: Alexandre Courbot , Yury Norov , Miguel Ojeda , Boqun Feng , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Thu, Jun 11, 2026 at 08:05:54PM +0100, Gary Guo wrote: > From: Gary Guo > > A `Debug` impl is for debugging and is normally not used, and therefore > should ideally not be code-generated unless used. However, Rust has no way > of knowing if a dependent crate is going to use the trait impl or not, so > unless it is marked as `#[inline]`, it will be code-generated in the > defining crate (as it is not generic). > > Mark the impl generated by bitfield macro `#[inline]`, so they do not stay > in the binary unless used. > > This reduces nova-core.o .text by 17% (from 151922 bytes to 125676 bytes). > > Signed-off-by: Gary Guo Reviewed-by: Alice Ryhl