about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-04-21 11:44:00 +0530
committerAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-04-21 11:44:00 +0530
commit031586426094f2b535e85e18d2443b792c4ba5db (patch)
tree0e4b9f174a0c6eeb4b65e8896c2c74b865565c8f /src
parentdbf8b6bf116c7bece2987ff4bd2792f008a6ee77 (diff)
downloadrust-031586426094f2b535e85e18d2443b792c4ba5db.tar.gz
rust-031586426094f2b535e85e18d2443b792c4ba5db.zip
Fix #! (shebang) stripping account space issue #70528
Diffstat (limited to 'src')
-rw-r--r--src/librustc_lexer/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
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<usize> {
     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()))