[ 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 <dan...@scratchpost.org> 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