<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_resolve/src/diagnostics.rs, branch 1.71.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.71.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.71.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-05-24T14:20:41+00:00</updated>
<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>
<entry>
<title>Rollup merge of #111652 - clubby789:self-import-improvement, r=compiler-errors</title>
<updated>2023-05-20T06:51:00+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>99973273+Dylan-DPC@users.noreply.github.com</email>
</author>
<published>2023-05-20T06:51:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=13f3585dc6ad4332a171b3ff9a6a3c933241dbb0'/>
<id>urn:sha1:13f3585dc6ad4332a171b3ff9a6a3c933241dbb0</id>
<content type='text'>
Better diagnostic for `use Self::..`

Fixes #111627

cc `@petrochenkov,` you might have thoughts on a better way to handle this (https://github.com/rust-lang/rust/issues/63720#issuecomment-591597466)
</content>
</entry>
<entry>
<title>fix(resolve): only disambiguate binding key during define</title>
<updated>2023-05-18T01:29:48+00:00</updated>
<author>
<name>bohan</name>
<email>bohan-zhang@foxmail.com</email>
</author>
<published>2023-04-18T14:46:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b098109765f4198bdff016a856610f3425a2167'/>
<id>urn:sha1:5b098109765f4198bdff016a856610f3425a2167</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Better diagnostic for `use Self::..`</title>
<updated>2023-05-16T20:30:48+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2023-05-16T19:08:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=eaf47a30cb67bf1e802ee29bb8021b19a4df6095'/>
<id>urn:sha1:eaf47a30cb67bf1e802ee29bb8021b19a4df6095</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "Validate resolution for SelfCtor too."</title>
<updated>2023-05-14T12:48:32+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2023-05-14T12:48:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=343819d33f5c4f026bbd789f87b03f932f11b0cb'/>
<id>urn:sha1:343819d33f5c4f026bbd789f87b03f932f11b0cb</id>
<content type='text'>
This reverts commit 83453408a0ce91b9e3d3ae6e7f117b1fd28b487d.
</content>
</entry>
<entry>
<title>Improve error for `self: Box&lt;self&gt;`</title>
<updated>2023-05-11T12:21:10+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2023-05-11T11:25:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3851a4bb914f74fb3f1d7394479ad810deb653cd'/>
<id>urn:sha1:3851a4bb914f74fb3f1d7394479ad810deb653cd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>improve diagnostics and bless tests</title>
<updated>2023-05-05T20:42:54+00:00</updated>
<author>
<name>Boxy</name>
<email>supbscripter@gmail.com</email>
</author>
<published>2023-05-05T20:42:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73b3ce26ecf580aec44e45308e952753f5218e07'/>
<id>urn:sha1:73b3ce26ecf580aec44e45308e952753f5218e07</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #111020 - cjgillot:validate-self-ctor, r=petrochenkov</title>
<updated>2023-05-04T06:09:04+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-05-04T06:09:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1187ce7213dd8b7f36050e1994478dc9c7c5c451'/>
<id>urn:sha1:1187ce7213dd8b7f36050e1994478dc9c7c5c451</id>
<content type='text'>
Validate resolution for SelfCtor too.

Fixes https://github.com/rust-lang/rust/issues/89868

r? `@petrochenkov`
</content>
</entry>
<entry>
<title>Validate resolution for SelfCtor too.</title>
<updated>2023-05-03T17:55:27+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2023-04-30T16:05:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=83453408a0ce91b9e3d3ae6e7f117b1fd28b487d'/>
<id>urn:sha1:83453408a0ce91b9e3d3ae6e7f117b1fd28b487d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restrict `From&lt;S&gt;` for `{D,Subd}iagnosticMessage`.</title>
<updated>2023-05-02T22:44:39+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-04-20T03:26:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6b62f37402cb2990c7d350379238579af0360b10'/>
<id>urn:sha1:6b62f37402cb2990c7d350379238579af0360b10</id>
<content type='text'>
Currently a `{D,Subd}iagnosticMessage` can be created from any type that
impls `Into&lt;String&gt;`. That includes `&amp;str`, `String`, and `Cow&lt;'static,
str&gt;`, which are reasonable. It also includes `&amp;String`, which is pretty
weird, and results in many places making unnecessary allocations for
patterns like this:
```
self.fatal(&amp;format!(...))
```
This creates a string with `format!`, takes a reference, passes the
reference to `fatal`, which does an `into()`, which clones the
reference, doing a second allocation. Two allocations for a single
string, bleh.

This commit changes the `From` impls so that you can only create a
`{D,Subd}iagnosticMessage` from `&amp;str`, `String`, or `Cow&lt;'static,
str&gt;`. This requires changing all the places that currently create one
from a `&amp;String`. Most of these are of the `&amp;format!(...)` form
described above; each one removes an unnecessary static `&amp;`, plus an
allocation when executed. There are also a few places where the existing
use of `&amp;String` was more reasonable; these now just use `clone()` at
the call site.

As well as making the code nicer and more efficient, this is a step
towards possibly using `Cow&lt;'static, str&gt;` in
`{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing
the `From&lt;&amp;'a str&gt;` impls to `From&lt;&amp;'static str&gt;`, which is doable, but
I'm not yet sure if it's worthwhile.
</content>
</entry>
</feed>
