rust/compiler/rustc_session/src
bors 6dab6dc5fc Auto merge of #112697 - tgross35:explain-markdown, r=oli-obk
Add simple markdown formatting to `rustc --explain` output

This is a second attempt at #104540, which is #63128 without dependencies.

This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`)

<img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee">

After this patch, sample output from the same file:

<img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9">

This also obeys the `--color always/auto/never` command option. Behavior:

- If pager is available and supports color, print with formatting to the pager
- If pager is not available or fails print with formatting to stdout - otherwise without formatting
- Follow `--color always/never` if suppied
- If everything fails, just print plain text to stdout

r? `@oli-obk`
cc `@estebank`
(since the two of you were involved in the previous discussion)
2023-07-05 06:18:46 +00:00
..
config Change process spawning to inherit the parent's signal mask by default 2022-10-20 14:53:38 -07:00
cgu_reuse_tracker.rs Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
code_stats.rs Tweak the sort of vtable sizes 2023-06-13 12:39:59 +00:00
config.rs Auto merge of #112697 - tgross35:explain-markdown, r=oli-obk 2023-07-05 06:18:46 +00:00
cstore.rs Remove MetadataRef type alias 2023-05-16 11:55:47 +00:00
errors.rs linker: Report linker flavors incompatible with the current target 2023-05-29 19:58:11 +03:00
filesearch.rs bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
lib.rs Collect VTable stats & add -Zprint-vtable-sizes 2023-06-12 15:58:35 +00:00
options.rs Auto merge of #112697 - tgross35:explain-markdown, r=oli-obk 2023-07-05 06:18:46 +00:00
output.rs Write to stdout if - is given as output file 2023-06-06 17:53:29 -04:00
parse.rs Simplify some conditions 2023-06-27 07:40:47 +00:00
search_paths.rs Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
session.rs Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
utils.rs Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholk 2023-03-23 19:55:45 +01:00