Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0315864

Browse files
author
Ayush Kumar Mishra
committed
Fix #! (shebang) stripping account space issue rust-lang#70528
1 parent dbf8b6b commit 0315864

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_lexer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub enum Base {
236236
/// (e.g. "#![deny(missing_docs)]").
237237
pub fn strip_shebang(input: &str) -> Option<usize> {
238238
debug_assert!(!input.is_empty());
239-
if !input.starts_with("#!") || input.starts_with("#![") {
239+
if !input.starts_with("#!") || input.starts_with("#![") || input.starts_with("#! [") {
240240
return None;
241241
}
242242
Some(input.find('\n').unwrap_or(input.len()))

0 commit comments

Comments
 (0)