Skip to content

Commit 55653a5

Browse files
Add explanations on how arguments are split
1 parent cbb3df4 commit 55653a5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

+19
Original file line numberDiff line numberDiff line change
@@ -722,3 +722,22 @@ test tests/rustdoc-ui/doctest/rustflags.rs - Bar (line 5) ... ok
722722

723723
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
724724
```
725+
726+
The parsing of arguments works as follows: if it encounters a `"` or a `'`, it will continue
727+
until it finds the character unescaped (without a prepending `\`). If not inside a string, a
728+
whitespace character will also split arguments. Example:
729+
730+
```text
731+
"hello 'a'\" ok" how are 'you today?'
732+
```
733+
734+
will be split as follows:
735+
736+
```text
737+
[
738+
"hello 'a'\" ok",
739+
"how",
740+
"are",
741+
"you today?",
742+
]
743+
```

0 commit comments

Comments
 (0)