diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-12-13 16:19:34 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-12-13 16:19:34 +0100 |
| commit | de16ed35a326041f619de882dfcead1d02623328 (patch) | |
| tree | 6696a8db9f2a0aed257abfb426e70ca37d0a7b52 /src/librustdoc/doctest/make.rs | |
| parent | 5a6036a1802262f8cf02192b02026688d396f1d7 (diff) | |
| download | rust-de16ed35a326041f619de882dfcead1d02623328.tar.gz rust-de16ed35a326041f619de882dfcead1d02623328.zip | |
Correctly handle comments in attributes in doctests source code
Diffstat (limited to 'src/librustdoc/doctest/make.rs')
| -rw-r--r-- | src/librustdoc/doctest/make.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/doctest/make.rs b/src/librustdoc/doctest/make.rs index 3ae60938749..f484c98a0d3 100644 --- a/src/librustdoc/doctest/make.rs +++ b/src/librustdoc/doctest/make.rs @@ -520,6 +520,8 @@ fn handle_attr(mod_attr_pending: &mut String, source_info: &mut SourceInfo, edit mod_attr_pending.clear(); } else if mod_attr_pending.ends_with('\\') { mod_attr_pending.push('n'); + } else { + mod_attr_pending.push_str("\n"); } } |
