From 031586426094f2b535e85e18d2443b792c4ba5db Mon Sep 17 00:00:00 2001 From: Ayush Kumar Mishra Date: Tue, 21 Apr 2020 11:44:00 +0530 Subject: [PATCH] Fix #! (shebang) stripping account space issue #70528 --- src/librustc_lexer/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_lexer/src/lib.rs b/src/librustc_lexer/src/lib.rs index 5ccfc1b276b..0a13783767d 100644 --- a/src/librustc_lexer/src/lib.rs +++ b/src/librustc_lexer/src/lib.rs @@ -236,7 +236,7 @@ pub enum Base { /// (e.g. "#![deny(missing_docs)]"). pub fn strip_shebang(input: &str) -> Option { debug_assert!(!input.is_empty()); - if !input.starts_with("#!") || input.starts_with("#![") { + if !input.starts_with("#!") || input.starts_with("#![") || input.starts_with("#! [") { return None; } Some(input.find('\n').unwrap_or(input.len()))