You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
! on the first line of Rust files is generally treated as a shebang comment. This does not appear to be the case if the first line is a valid inner attribute, e.g. this:
#![crate_id="abc"];fnmain(){}
creates an executable named 'abc'. While unlikely, '[crate_id="abc"];' is a valid program name. Either way, it's simpler to be consistent about this rule (and it makes the job easier for syntax highlighting).
I note that this was added deliberately by #13037 but I think it is a mistake, as per above.
The text was updated successfully, but these errors were encountered:
The parser intentionally ignores shebang comments for parsing (lines starting with # are not normally a comment), but it assumes that if the first line tokenizes to #![ that it's actually an inner attribute. There's lots of discussion in #2569 about shebangs.
! on the first line of Rust files is generally treated as a shebang comment. This does not appear to be the case if the first line is a valid inner attribute, e.g. this:
creates an executable named 'abc'. While unlikely, '[crate_id="abc"];' is a valid program name. Either way, it's simpler to be consistent about this rule (and it makes the job easier for syntax highlighting).
I note that this was added deliberately by #13037 but I think it is a mistake, as per above.
The text was updated successfully, but these errors were encountered: