forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#73596 - petrochenkov:shebang2, r=Mark-Simulacrum
rustc_lexer: Simplify shebang parsing once more Fixes rust-lang#73250 (beta regression) Treat any line starting with `!#` as a shebang candidate, not only lines with something non-whitespace. This way we no longer need to define what `is_whitespace` means ([Linux shebang whitespace](https://github.com/torvalds/linux/blob/master/fs/binfmt_script.c), ASCII whitespace, Rust lexer whitespace, etc), which is nice. This change makes some invalid Rust code valid (see the regression above), but still never interprets a fragment of valid Rust code as a shebang. (This PR also removes one duplicate test.)
- Loading branch information
Showing
4 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! | ||
|
||
// check-pass | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! | ||
|
||
// check-pass | ||
// ignore-tidy-end-whitespace | ||
fn main() {} |
This file was deleted.
Oops, something went wrong.