From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 1434F277810 for ; Thu, 27 Feb 2025 23:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740697297; cv=none; b=QKSeF/1gN7/hyBod4QdpbZHGF0cYLFpzzh7MeW2NMJDyYKpJA+PTbx00/LILYI11MajDePFjE9lVAG8hiPFy+MpliXZ/c5FEocc/xjdCwCx83KWtwyJaohCKSuA+OGPGTOphbDpZBQ5rEHWq0wLoz8Y8SGsTS/VM4tiPSLZudY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740697297; c=relaxed/simple; bh=T/KXETJ0TFWxdMyVLabvOPEG48vmilHHA1hKIy0LJBc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pZAdp60d58h+zIO6FbbQLjU8h18p+vCmsc0O7Qx6Kqs/WGVa6mpPXi/63NP2addCNxUPF+jg5DEnp+zR+AHtMx3YF8Tn2OUKfOyE4jbOKB6XnZmLOh/Y7/X4FxP7RifmP8Ne4VCa2HNp/T15PaqXscHskGLLFmvjmFSWAGipV3o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vhUyCRuL; arc=none smtp.client-ip=209.85.221.53 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vhUyCRuL" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-390ec449556so340172f8f.1 for ; Thu, 27 Feb 2025 15:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740697294; x=1741302094; 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=T/KXETJ0TFWxdMyVLabvOPEG48vmilHHA1hKIy0LJBc=; b=vhUyCRuLR09clL9cJVZ5pqRJNokVvM+wExR2XF583FE/Dm+2YKXm20sWOGp7e5O4Zh 69C4UPi4doikpgCx4KBvOGbjH4lh4GE4mS6aEoaA4b136QsDEemtyjsNkPZqXiEVkvj1 OR2RXmxDybInuqZBM/q8JsBiLZ3zOKahmJnEOhppiLqSLb4iwVVs6pc64+Ectnk+SZIG Ej6TKHij/lqDL82iJoK0Z57IF+6teqFzAgsTs75HeGjCNzW6YihjPLnQ+r8w5Ky1a4jI Sfs5LfS6b5yLJO12Lc/TFvOWlWmftaqRrQRu9DsqJgf7wkWY6Ng+A6wiH5jl+6Izs94M SCSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740697294; x=1741302094; 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=T/KXETJ0TFWxdMyVLabvOPEG48vmilHHA1hKIy0LJBc=; b=sk0wI0Y1IYrHAo09F6Kz4qDg5REhtaJ34kclpwAq9/wmhO4Fjrv1DdtTZVNdhzRPkK keGI2C9gtd5W2kwcRiB3Ybmfa3BcX+dUT0al4iRzdCn3D0XUUbMTBpjGvbCXsmfa8YJc iG8esxfUu/MaZv5tbbHuChMB5set0IRjt94ynnVrsAlMG58oha89JeEJveddoyGwLc1t Le/Qh6ALhlEHpcULxXESsPLYXP1G/KGKYKW4ANARjkxUBFUC2HzNIlzZV5eZJlyxu/qZ rPDy6F2PZh5c+4THUUabHrfWmzEHffpFvpM70wCEcaTi5kwktT6i7zw4kE9/u1vSkmR+ 53/w== X-Forwarded-Encrypted: i=1; AJvYcCW50kWCfdmUsSpkdZbQQwwTnPbTEXr5FYEpBRL/lO/yrYWVsmk9QK6QiKao+4yJ7RBcTATk3Y/pymp3FLC43g==@vger.kernel.org X-Gm-Message-State: AOJu0Yxi+Gj4tSORwJepgEb+bJwpbWzhaAZgFu4K3E8GlJkVhAR+gHx9 uanT+1txlz+ul04MjKW+exOaDt7AAVoxY6kIWZo1EWm3ZhrcJCUZUWGBOesxzeaBa+IPG4RMAMx upV/++mRVFAz4lz2juSOiNtzDCuMWihUIO+La X-Gm-Gg: ASbGncueIWzj0xvSBEyRy3po+0jjwWGNCeDe7XzY/u/hgarD+vY/mWLyqj+q/lWRtPR Z7975karnjR1Pky/fB9ILPmuz1AlophMYBgw87eifaUUrqmXdJ4YHatGoc4U85mOKZ4gciXLKGR i8T8uvvd6d X-Google-Smtp-Source: AGHT+IEUTU0KblbuQlyHGcIr54A0QbBhcS2oujT2neK736LGyvJHYwON23tG1rKqrRjcL4V5ye5JFgYZaKYHem62dEg= X-Received: by 2002:a05:6000:4c6:b0:38d:c44a:a64b with SMTP id ffacd0b85a97d-390eca2589amr634869f8f.48.1740697294171; Thu, 27 Feb 2025 15:01:34 -0800 (PST) Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250227-export-macro-v1-0-948775fc37aa@google.com> <20250227-export-macro-v1-4-948775fc37aa@google.com> In-Reply-To: From: Alice Ryhl Date: Fri, 28 Feb 2025 00:01:22 +0100 X-Gm-Features: AQ5f1Joq_xPPPjbC654zyWyFJjBzyt9Fu0LwYPzYOhRY-ceZYmiJ6D8fWyhkRCQ Message-ID: Subject: Re: [PATCH 4/4] panic_qr: use new #[export] macro To: Boqun Feng Cc: Greg Kroah-Hartman , Miguel Ojeda , Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Andrew Morton , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 27, 2025 at 10:29=E2=80=AFPM Boqun Feng = wrote: > > On Thu, Feb 27, 2025 at 05:02:02PM +0000, Alice Ryhl wrote: > > This validates at compile time that the signatures match what is in the > > header file. It highlights one annoyance with the compile-time check, > > which is that it can only be used with functions marked unsafe. > > > > If the function is not unsafe, then this error is emitted: > > > > error[E0308]: `if` and `else` have incompatible types > > Is there a way to improve this error message? I vaguely remember there > are ways to do customized error message. The if/else error message is super nice because it shows the two types next to each other where it's very easy to read the signatures and spot the difference. But if you want to investigate other constructs that potentially have better error messages, feel free. I'm happy to update if you find a better construct. Alice