<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_errors/src, branch 1.72.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.72.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.72.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-07-03T20:04:18+00:00</updated>
<entry>
<title>Add a simple markdown parser for formatting `rustc --explain`</title>
<updated>2023-07-03T20:04:18+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2022-12-19T18:09:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6a1c10bd85442f52f1d55d51005481cfa5cb40b5'/>
<id>urn:sha1:6a1c10bd85442f52f1d55d51005481cfa5cb40b5</id>
<content type='text'>
Currently, the output of `rustc --explain foo` displays the raw markdown in a
pager. This is acceptable, but using actual formatting makes it easier to
understand.

This patch consists of three major components:

1.  A markdown parser. This is an extremely simple non-backtracking recursive
    implementation that requires normalization of the final token stream
2.  A utility to write the token stream to an output buffer
3.  Configuration within rustc_driver_impl to invoke this combination for
    `--explain`. Like the current implementation, it first attempts to print to
    a pager with a fallback colorized terminal, and standard print as a last
    resort.

    If color is disabled, or if the output does not support it, or if printing
    with color fails, it will write the raw markdown (which matches current
    behavior).

    Pagers known to support color are: `less` (with `-r`), `bat` (aka `catbat`),
    and `delta`.

The markdown parser does not support the entire markdown specification, but
should support the following with reasonable accuracy:

-   Headings, including formatting
-   Comments
-   Code, inline and fenced block (no indented block)
-   Strong, emphasis, and strikethrough formatted text
-   Links, anchor, inline, and reference-style
-   Horizontal rules
-   Unordered and ordered list items, including formatting

This parser and writer should be reusable by other systems if ever needed.
</content>
</entry>
<entry>
<title>s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList</title>
<updated>2023-06-14T07:28:54+00:00</updated>
<author>
<name>The 8472</name>
<email>git@infinite-source.de</email>
</author>
<published>2023-04-08T22:37:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=114d5f221c135e3267fbb966e2f0e582361cd8cb'/>
<id>urn:sha1:114d5f221c135e3267fbb966e2f0e582361cd8cb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Respect `RUST_BACKTRACE` for delayed bugs</title>
<updated>2023-06-06T19:24:33+00:00</updated>
<author>
<name>Nilstrieb</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-06-06T19:24:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=70980929b480d6c13e23d79ad8de2ff0afbce60c'/>
<id>urn:sha1:70980929b480d6c13e23d79ad8de2ff0afbce60c</id>
<content type='text'>
Sometimes, especially with MIR validation, the backtraces from delayed
bugs are noise and make it harder to look at them. Respect the
environment variable and don't print it when the user doesn't want it.
</content>
</entry>
<entry>
<title>Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errors</title>
<updated>2023-06-02T07:57:21+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-06-02T07:57:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8ebf04225d358efe77b822081cebef657f88d35b'/>
<id>urn:sha1:8ebf04225d358efe77b822081cebef657f88d35b</id>
<content type='text'>
Rollup of 7 pull requests

Successful merges:

 - #111670 (Require that const param tys implement `ConstParamTy`)
 - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…)
 - #112030 (Migrate `item_trait_alias` to Askama)
 - #112150 (Support 128-bit atomics on all x86_64 Apple targets)
 - #112174 (Fix broken link)
 - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.)
 - #112193 (Check tuple elements are `Sized` in `offset_of`)

Failed merges:

 - #112071 (Group rfcs tests)

r? `@ghost`
`@rustbot` modify labels: rollup
</content>
</entry>
<entry>
<title>Remove adt_const_params usage from compiler</title>
<updated>2023-06-01T18:21:42+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-05-19T22:04:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97bacbab57128725887c3c9600bb0ad83ca42e50'/>
<id>urn:sha1:97bacbab57128725887c3c9600bb0ad83ca42e50</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use translatable diagnostics in `rustc_const_eval`</title>
<updated>2023-06-01T14:45:18+00:00</updated>
<author>
<name>Deadbeef</name>
<email>ent3rm4n@gmail.com</email>
</author>
<published>2023-05-17T10:30:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4f83717cf768adb0b0dfe23b8eecf2b259eec354'/>
<id>urn:sha1:4f83717cf768adb0b0dfe23b8eecf2b259eec354</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `Cow` in `{D,Subd}iagnosticMessage`.</title>
<updated>2023-05-28T23:23:43+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-04T00:55:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=781111ef3591e4355c115593c4d75964b85555d6'/>
<id>urn:sha1:781111ef3591e4355c115593c4d75964b85555d6</id>
<content type='text'>
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment:
```
// FIXME(davidtwco): can a `Cow&lt;'static, str&gt;` be used here?
```
This commit answers that question in the affirmative. It's not the most
compelling change ever, but it might be worth merging.

This requires changing the `impl&lt;'a&gt; From&lt;&amp;'a str&gt;` impls to `impl
From&lt;&amp;'static str&gt;`, which involves a bunch of knock-on changes that
require/result in call sites being a little more precise about exactly
what kind of string they use to create errors, and not just `&amp;str`. This
will result in fewer unnecessary allocations, though this will not have
any notable perf effects given that these are error paths.

Note that I was lazy within Clippy, using `to_string` in a few places to
preserve the existing string imprecision. I could have used `impl
Into&lt;{D,Subd}iagnosticMessage&gt;` in various places as is done in the
compiler, but that would have required changes to *many* call sites
(mostly changing `&amp;format("...")` to `format!("...")`) which didn't seem
worthwhile.
</content>
</entry>
<entry>
<title>Remove ExpnKind::Inlined.</title>
<updated>2023-05-25T16:43:14+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2023-05-24T20:26:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0919ec3eccfc06534dcf392b91b616a70d0bf8b1'/>
<id>urn:sha1:0919ec3eccfc06534dcf392b91b616a70d0bf8b1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `is_some_and`/`is_ok_and` in less obvious spots</title>
<updated>2023-05-24T14:33:43+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2023-05-24T14:33:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=307799a711826294bc2b3e562cd87bf1e2ff28b4'/>
<id>urn:sha1:307799a711826294bc2b3e562cd87bf1e2ff28b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `Option::is_some_and` and `Result::is_ok_and` in the compiler</title>
<updated>2023-05-24T14:20:41+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2023-05-24T14:19:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fb0f74a8c9e8b8f488ec5894d5d314caebf4c662'/>
<id>urn:sha1:fb0f74a8c9e8b8f488ec5894d5d314caebf4c662</id>
<content type='text'>
</content>
</entry>
</feed>
