about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-19 05:21:16 +0000
committerbors <bors@rust-lang.org>2014-06-19 05:21:16 +0000
commitf8c9aec34486f953eec0e46cb9c13cdcd20dc476 (patch)
tree2b769fe84f7b2558a2e783f6fc48568f85ed65d5 /src/rustllvm/RustWrapper.cpp
parentf05cd6e04e62651ec95a3ae66906399d7c0092a1 (diff)
parent8a8e497ae786ffc032c1e68fc23da0edcf6fa5e3 (diff)
downloadrust-f8c9aec34486f953eec0e46cb9c13cdcd20dc476.tar.gz
rust-f8c9aec34486f953eec0e46cb9c13cdcd20dc476.zip
auto merge of #14400 : kballard/rust/lexer_crlf_handling, r=cmr
The lexer already ignores CRLF in between tokens, but it doesn't
properly handle carriage returns inside strings and doc comments. Teach
it to treat CRLF as LF inside these tokens, and to disallow carriage
returns that are not followed by linefeeds. This includes handling an
escaped CRLF inside a regular string token the same way it handles an
escaped LF.

This is technically a breaking change, as bare carriage returns are no
longer allowed, and CRLF sequences are now treated as LF inside strings
and doc comments, but it's very unlikely to actually affect any
real-world code.

This change is necessary to have Rust code compile on Windows the same
way it does on Unix. The mozilla/rust repository explicitly sets eol=lf
for Rust source files, but other Rust repositories don't. Notably,
rust-http cannot be compiled on Windows without converting the CRLF line
endings back to LF.

[breaking-change]
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions