diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-01-06 00:01:59 +0100 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-01-06 00:04:25 +0100 |
| commit | ce6baa77fe0fb53166f91d38e5187618af9b164c (patch) | |
| tree | 816e66a9029cc2ab8f24c05e69333589c0930904 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 5253294d222fe725fbbae1052d110f7eaa4ae10e (diff) | |
| download | rust-ce6baa77fe0fb53166f91d38e5187618af9b164c.tar.gz rust-ce6baa77fe0fb53166f91d38e5187618af9b164c.zip | |
Clarify how Rust treats backslashes at end of line in string literals
Rust differs in that behavior from C: In C, the newline escapes are resolved
before anything else, and in Rust this depends on whether the backslash is
escaped itself.
A difference can be observed in the following two programs:
```c
#include <stdio.h>
int main()
{
printf("\\
n\n");
return 0;
}
```
```rust
fn main() {
println!("\\
n");
}
```
The first program prints two newlines, the second one prints a backslash, a
newline, the latin character n and a final newline.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
