From: Alice Ryhl <aliceryhl@google.com>
To: Gary Guo <gary@garyguo.net>
Cc: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"kernel test robot" <lkp@intel.com>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>
Subject: Re: [linux-next:master 9676/10599] ld.lld: error: undefined symbol: rust_build_error
Date: Fri, 21 Nov 2025 14:44:43 +0000 [thread overview]
Message-ID: <aSB623GKVDR2TBc3@google.com> (raw)
In-Reply-To: <20251121143008.2f5acc33.gary@garyguo.net>
On Fri, Nov 21, 2025 at 02:30:08PM +0000, Gary Guo wrote:
> On Fri, 21 Nov 2025 15:21:45 +0100
> Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
>
> > On Fri, Nov 21, 2025 at 3:10 PM Alice Ryhl <aliceryhl@google.com> wrote:
> > >
> > > This kind of thing is why I keep saying build_error() is too fragile to
> > > be used at all.
>
> The case here I think is a perfectly fine use case of `build_error` as
> it's completely by-value and does involve references. If compiler can't
> figure out, it's either a compiler bug or a source bug.
The thing about this particular case is that it should have been
const { Bounded::<u8, 1>::from_expr(1) }
or similar.
You say that this kind of thing would be a compiler bug, but I don't
think the compiler devs folks would agree with us on that at all. I
mean, sure, it's a bug in the sense that it's a missed optimization, but
it's not a correctness bug.
If we used const eval, then suddenly it *would* easily be a compiler
bug, and by the way, it would also work reliably.
> > Adding `unsafe` blocks for things that should be able to be statically
> > known isn't great.
> >
> > `build_assert!` is just too useful, so it is best to try to understand
> > what can be done, or find an equivalent solution. Gary et al. may have
> > some input here.
I'm not advocating for adding unsafe blocks to skip bounds checks.
And, fine, there are probably a few cases where it works reliably and
has no real replacement. Such as the VTABLE_DEFAULT_ERROR check. But I
do not think bounds checks are a place where it's a good idea.
Alice
next prev parent reply other threads:[~2025-11-21 14:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 16:41 [linux-next:master 9676/10599] ld.lld: error: undefined symbol: rust_build_error kernel test robot
2025-11-21 6:13 ` Alexandre Courbot
2025-11-21 9:08 ` Alice Ryhl
2025-11-21 13:41 ` Alexandre Courbot
2025-11-21 14:10 ` Alice Ryhl
2025-11-21 14:21 ` Miguel Ojeda
2025-11-21 14:30 ` Gary Guo
2025-11-21 14:39 ` Alexandre Courbot
2025-11-21 14:44 ` Alice Ryhl [this message]
2025-11-21 15:53 ` Miguel Ojeda
2025-11-24 10:37 ` Alice Ryhl
2025-11-24 12:09 ` Alexandre Courbot
2025-11-24 14:48 ` Gary Guo
2025-12-12 1:04 ` Alice Ryhl
2025-12-13 1:50 ` Nathan Chancellor
2025-12-13 2:51 ` Miguel Ojeda
2025-11-21 15:27 ` Alexandre Courbot
2025-11-21 15:30 ` Miguel Ojeda
2025-11-22 2:12 ` Alexandre Courbot
2025-11-21 14:19 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSB623GKVDR2TBc3@google.com \
--to=aliceryhl@google.com \
--cc=acourbot@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=chenhuacai@kernel.org \
--cc=gary@garyguo.net \
--cc=kernel@xen0n.name \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.