rust/crates
bors[bot] 2ace128dd4
Merge #8560
8560: Escape characters in doc comments in macros correctly r=jonas-schievink a=ChayimFriedman2

Previously they were escaped twice, both by `.escape_default()` and the debug view of strings (`{:?}`). This leads to things like newlines or tabs in documentation comments being `\\n`, but we unescape literals only once, ending up with `\n`.

This was hard to spot because CMark unescaped them (at least for `'` and `"`), but it did not do so in code blocks.

This also was the root cause of #7781. This issue was solved by using `.escape_debug()` instead of `.escape_default()`, but the real issue remained.
We can bring the `.escape_default()` back by now, however I didn't do it because it is probably slower than `.escape_debug()` (more work to do), and also in order to change the code the least.

Example (the keyword and primitive docs are `include!()`d at https://doc.rust-lang.org/src/std/lib.rs.html#570-578, and thus originate from macro):

Before:
![image](https://user-images.githubusercontent.com/24700207/115130096-40544300-9ff5-11eb-847b-969e7034e8a4.png)

After:
![image](https://user-images.githubusercontent.com/24700207/115130143-9cb76280-9ff5-11eb-9281-323746089440.png)


Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2021-04-18 02:14:27 +00:00
..
base_db Add some more error messages to fixture failure cases 2021-04-17 21:34:14 +02:00
cfg Make ast_to_token_tree infallible 2021-04-04 01:46:45 +02:00
flycheck
hir Exclude inherent traits from flyimports 2021-04-16 11:13:17 +03:00
hir_def Fix TestDB::module_at_position with submodules 2021-04-17 03:34:05 +02:00
hir_expand Support macros in pattern position 2021-04-11 01:25:50 +02:00
hir_ty Merge #8539 2021-04-16 17:54:47 +00:00
ide Include path in unresolved-macro-call diagnostic 2021-04-16 15:48:03 +02:00
ide_assists Add some more error messages to fixture failure cases 2021-04-17 21:34:14 +02:00
ide_completion Exclude inherent traits from flyimports 2021-04-16 11:13:17 +03:00
ide_db Merge #8546 2021-04-16 21:00:55 +00:00
ide_ssr syntax: return owned string instead of leaking string 2021-03-26 18:30:59 +01:00
mbe Merge #8560 2021-04-18 02:14:27 +00:00
parser Handle extended key value attr in mbe 2021-04-17 14:31:52 +08:00
paths Clearer naming 2021-04-06 16:22:26 +03:00
proc_macro_api Trim down IPC json size 2021-03-24 15:01:37 +08:00
proc_macro_srv Fix parse u128 bug in proc-macro 2021-03-31 19:50:36 +08:00
proc_macro_test
profile internal: revive google_cpu_profile infra 2021-03-30 17:29:43 +03:00
project_model feat: avoid checking the whole project during initial loading 2021-04-12 15:29:31 +03:00
rust-analyzer change grammar 2021-04-15 19:40:07 +01:00
stdx feat: show errors from cargo metadata and initial cargo check in the status bar 2021-04-06 18:08:05 +03:00
syntax nail rowan version down 2021-04-17 09:31:54 +02:00
test_utils internal: fix flakiness of accidentally quadratic test 2021-04-13 12:56:24 +03:00
text_edit
toolchain
tt a lot of clippy::style fixes 2021-03-21 16:15:41 +01:00
vfs Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +03:00
vfs-notify