rust/compiler
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
..
rustc
rustc_abi Auto merge of #112062 - lukas-code:unsized-layout, r=wesleywiser 2023-06-13 22:34:59 +00:00
rustc_apfloat
rustc_arena Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
rustc_ast Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_ast_lowering Do not generate lifetime_mapping for RPIT no in_trait 2023-06-29 14:26:28 -03:00
rustc_ast_passes Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr 2023-06-27 21:31:47 +00:00
rustc_ast_pretty Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Auto merge of #112882 - DrMeepster:new_un_derefer, r=oli-obk 2023-07-03 02:46:39 +00:00
rustc_builtin_macros fix typo 2023-06-28 10:52:48 +08:00
rustc_codegen_cranelift Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk 2023-06-30 00:35:19 +00:00
rustc_codegen_gcc Auto merge of #112814 - antoyo:sync-cg_gcc-2023-06-19, r=bjorn3 2023-06-22 02:11:08 +00:00
rustc_codegen_llvm Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
rustc_codegen_ssa Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
rustc_const_eval Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillot 2023-07-02 07:43:36 +00:00
rustc_data_structures Upgrade to indexmap 2.0.0 2023-07-03 13:51:54 -07:00
rustc_driver Downgrade rustix 2023-07-02 21:02:31 +02:00
rustc_driver_impl Add a simple markdown parser for formatting rustc --explain 2023-07-03 16:04:18 -04:00
rustc_error_codes Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
rustc_error_messages Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
rustc_errors Add a simple markdown parser for formatting rustc --explain 2023-07-03 16:04:18 -04:00
rustc_expand Rollup merge of #111571 - jhpratt:proc-macro-span, r=m-ou-se 2023-06-28 18:28:46 +05:30
rustc_feature Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_fluent_macro Fix diagnostics with errors 2023-05-26 10:44:18 +00:00
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
rustc_hir_analysis Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_hir_pretty hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
rustc_hir_typeck Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_incremental Applied nits 2023-06-11 22:45:04 -04:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_interface Remove chalk from the compiler 2023-07-03 21:40:04 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnr 2023-07-04 09:09:09 +00:00
rustc_lint_defs Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_llvm Add rustc option to output LLVM optimization remarks to YAML files 2023-07-02 13:41:36 +02:00
rustc_log Downgrade tracing and syn 2023-07-02 21:02:31 +02:00
rustc_macros Downgrade tracing and syn 2023-07-02 21:02:31 +02:00
rustc_metadata Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorino 2023-07-04 04:24:24 +00:00
rustc_middle Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_mir_build Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_mir_dataflow Merge un_derefer into MovePathLookup 2023-06-29 22:14:27 -07:00
rustc_mir_transform Auto merge of #112882 - DrMeepster:new_un_derefer, r=oli-obk 2023-07-03 02:46:39 +00:00
rustc_monomorphize Tweak thread names for CGU processing. 2023-06-26 09:14:45 +10:00
rustc_parse Detect extra space in keyword for better hint 2023-07-04 18:13:31 +08:00
rustc_parse_format Fix typos in compiler 2023-04-10 22:02:52 +02:00
rustc_passes Put LayoutError behind reference to shrink result 2023-07-01 21:16:25 +02:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy remove TypeWellFormedFromEnv 2023-07-03 21:40:04 +00:00
rustc_query_impl Avoid calling queries during query stack printing 2023-06-27 16:12:07 +02:00
rustc_query_system Rollup merge of #112333 - Zoxc:try_collect_active_jobs-deadlock, r=cjgillot 2023-06-08 12:36:18 +02:00
rustc_resolve Auto merge of #112917 - chenyukang:yukang-fix-112590, r=estebank 2023-07-04 02:01:24 +00:00
rustc_serialize Upgrade to indexmap 2.0.0 2023-07-03 13:51:54 -07:00
rustc_session Auto merge of #112697 - tgross35:explain-markdown, r=oli-obk 2023-07-05 06:18:46 +00:00
rustc_smir Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures 2023-07-02 07:48:41 +08:00
rustc_span Upgrade to indexmap 2.0.0 2023-07-03 13:51:54 -07:00
rustc_symbol_mangling nit 2023-07-04 15:11:12 +01:00
rustc_target abi: avoid ice for non-ffi-safe fn ptrs 2023-07-03 13:40:20 +01:00
rustc_trait_selection Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwU 2023-07-05 03:50:36 +00:00
rustc_traits remove TypeWellFormedFromEnv 2023-07-03 21:40:04 +00:00
rustc_transmute Put LayoutError behind reference to shrink result 2023-07-01 21:16:25 +02:00
rustc_ty_utils Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
rustc_type_ir Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00