rustc_lexer: Optimize shebang detection slightly

This commit is contained in:
Vadim Petrochenkov 2020-05-29 21:51:46 +03:00
parent 96dd4690c3
commit 21755b58c9
3 changed files with 32 additions and 19 deletions

View file

@ -0,0 +1,6 @@
#!///bin/bash
[allow(unused_variables)]
//~^^ ERROR expected `[`, found doc comment
// Doc comment is misinterpreted as a whitespace (regular comment) during shebang detection.
// Even if it wasn't, it would still result in an error, just a different one.

View file

@ -0,0 +1,8 @@
error: expected `[`, found doc comment `///bin/bash`
--> $DIR/shebang-doc-comment.rs:1:3
|
LL | #!///bin/bash
| ^^^^^^^^^^^ expected `[`
error: aborting due to previous error