about summary refs log tree commit diff
path: root/src/test/ui/parser/shebang
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-93/+0
2020-09-02lexer: Tiny improvement to shebang detectionVadim Petrochenkov-8/+5
Lexer now discerns between regular comments and doc comments, so use that. The change only affects the choice of reported errors.
2020-06-26rustc_lexer: Simplify shebang parsing once moreVadim Petrochenkov-0/+9
2020-05-29rustc_lexer: Optimize shebang detection slightlyVadim Petrochenkov-0/+14
2020-05-25Fix bug in shebang handlingRussell Cohen-0/+73
Shebang handling was too agressive in stripping out the first line in cases where it is actually _not_ a shebang, but instead, valid rust (#70528). This is a second attempt at resolving this issue (the first attempt was flawed, for, among other reasons, causing an ICE in certain cases (#71372, #71471). The behavior is now codified by a number of UI tests, but simply: For the first line to be a shebang, the following must all be true: 1. The line must start with `#!` 2. The line must contain a non whitespace character after `#!` 3. The next character in the file, ignoring comments & whitespace must not be `[` I believe this is a strict superset of what we used to allow, so perhaps a crater run is unnecessary, but probably not a terrible idea.