Re: [PATCH] .gitignore: ignore rustc long type txt files
From: Miguel Ojeda
Date: Thu May 28 2026 - 07:55:02 EST
On Thu, May 21, 2026 at 12:29 PM Manos Pitsidianakis
<manos@xxxxxxxxxxxxxx> wrote:
>
> When rustc prints an error containing a long type that doesn't fit in a
> line, it will write the whole thing in a .txt file and print messages
> like:
>
> note: the full type name has been written to
> 'path/to/subsystem/module_name.long-type-11621316855315349594.txt
>
> Long types like core::result::Result<core::pin::Pin<Box<_, Kmalloc,
> kernel::error::Error>: pin_init::PinInit<Box<_, Kmalloc>, _> are common
> during development, so add a gitignore entry.
>
> Signed-off-by: Manos Pitsidianakis <manos@xxxxxxxxxxxxxx>
Cc'ing Nathan, Nicolas and Kbuild -- I considered whether deleting
these in e.g. `distclean`. They are only error artifacts, i.e. the
build system doesn't create these intentionally -- they come from the
Rust compiler in a minority of error cases (where type names are
long).
So end users shouldn't see them anyway, so I am not sure what the policy is.
In any case, putting these in `.gitignore` shouldn't hurt, and they
are definitely not intended to be committed, so it makes sense
regardless of the cleaning. Thus I will commit it with these notes
unless someone shouts:
[ Depending on the compiler version and the kind of error, there are
two possible spellings -- copying them here for reference:
= note: the full name for the type has been written to
'...long-type-...txt'
= note: the full type name has been written to '...long-type-...txt'
- Miguel ]
[ Moved the lines closer to the existing rust-analyzer one. - Miguel ]
I also wondered about `--verbose` (which probably we don't want to
enable unconditionally) and `-Zwrite-long-types-to-disk=no` (which
could be possible as a nice middle ground if kernel developers prefer
to avoid the files unconditionally -- I asked upstream out of
curiosity if that or something similar is intended to be stable at
some point).
Thanks!
Cheers,
Miguel