guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch-shebang and Rust - Change on core-updates?


From: Andreas Rottmann
Subject: Re: patch-shebang and Rust - Change on core-updates?
Date: Tue, 21 Jan 2020 00:24:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

[ Note that this is my first post on this list, and I'm posting via
  gmane, so if I'm messing something up, please let me know, either
  on-list, or in private, whichever you deem more appropriate ]

Danny Milosavljevic <address@hidden> writes:

> Hi,
>
> Rust uses #![...] for something that is definitely not a shebang
> (file-wide feature tests).
>
Just some background info regarding Rust syntax:

These are attributes applied to the enclosing file, common examples
including #![feature(...)] to enable nightly-only features,
#![deny(unsafe_code)], to deny the use of `unsafe` in the codebase
(crate), and more. As those need to be placed before any actual code,
and it is common for Rust files to not have preceding comments,
encountering those at the very start of the file, where a shebang could
occur, is indeed bound to be (and stay) a common occurence.

> Currently, our patch-shebang[1] emits a lot of warnings because of those.
>
> Should we change patch-shebang to ignore lines starting with "#![" ?
>
Note that Rust is not the only language that has a construct conflicting
with the sheebang pattern as described, e.g. #!r6rs or #!case-fold in
Scheme; there might be others as well. Wouldn't "#!/" work to detect
sheebangs reliably? Are there legitimate sheebangs that do not use an
absolute file name?

Regards, Rotty




reply via email to

[Prev in Thread] Current Thread [Next in Thread]