All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Timur Tabi" <ttabi@nvidia.com>,
	"ojeda@kernel.org" <ojeda@kernel.org>,
	"aliceryhl@google.com" <aliceryhl@google.com>,
	"dakr@kernel.org" <dakr@kernel.org>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v3] rust: introduce sfile macro for succinct code tracing
Date: Sat, 14 Jun 2025 19:08:41 +0200	[thread overview]
Message-ID: <DAMF71ECD17E.7C58IZHG946V@kernel.org> (raw)
In-Reply-To: <922a39510eb74ebb2e463d20d7d5cc5c23316155.camel@nvidia.com>

On Fri Jun 13, 2025 at 10:06 PM CEST, Timur Tabi wrote:
> On Fri, 2025-06-13 at 14:32 -0500, Timur Tabi wrote:
>> On Tue, 2025-06-10 at 10:45 +0200, Benno Lossin wrote:
>> > > +
>> > > +        // [`.as_bytes()`] does not support non-ASCII filenames
>> > > +        assert!(FILE.is_ascii());
>> > 
>> > Also here.
>> 
>> I can't get this to work, either.  I've tried all sorts of things, none of them work:
>> 
>>         assert!(::str::is_ascii(FILE));
>>         assert!(::core::str::is_ascii(FILE));

This one should work (you still need to make the `assert` use a path
though).

>>         assert!(FILE.str::is_ascii());
>
> Never mind, I finally got it to work
>
> 	assert!(str::is_ascii(FILE));
>
> Is `str` not part of the `core` module in the kernel?  It seems there are slight differences in the
> module hierarchy in kernel vs. regular Rust.  Is there a document that shows this?

The kernel uses the usual `core` so `str` should exist. What's the error
that you get?

---
Cheers,
Benno

  reply	other threads:[~2025-06-14 17:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 22:36 [PATCH v3] rust: introduce sfile macro for succinct code tracing Timur Tabi
2025-06-10  2:33 ` John Hubbard
2025-06-10  3:40   ` Timur Tabi
2025-06-10  8:31     ` Benno Lossin
2025-06-10  8:45 ` Benno Lossin
2025-06-13 17:03   ` Timur Tabi
2025-06-13 17:57     ` Miguel Ojeda
2025-06-13 19:14       ` Timur Tabi
2025-06-13 20:08         ` Timur Tabi
2025-06-13 19:32   ` Timur Tabi
2025-06-13 20:06     ` Timur Tabi
2025-06-14 17:08       ` Benno Lossin [this message]
2025-06-16 15:37         ` Timur Tabi
2025-06-16 18:18           ` Miguel Ojeda
2025-06-13 22:46   ` Timur Tabi
2025-06-14 18:01     ` Benno Lossin
2025-06-10  8:47 ` Miguel Ojeda
2025-06-10 19:18   ` Timur Tabi
2025-06-10 19:29     ` 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=DAMF71ECD17E.7C58IZHG946V@kernel.org \
    --to=lossin@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=ttabi@nvidia.com \
    /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.