<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_errors/src, branch 1.77.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.77.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.77.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-01-30T21:25:29+00:00</updated>
<entry>
<title>Don't hash lints differently to non-lints.</title>
<updated>2024-01-30T21:25:29+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-30T05:57:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4225a1e186afe39c1ae81c5065d24287d6d49fb9'/>
<id>urn:sha1:4225a1e186afe39c1ae81c5065d24287d6d49fb9</id>
<content type='text'>
`Diagnostic::keys`, which is used for hashing and equating diagnostics,
has a surprising behaviour: it ignores children, but only for lints.
This was added in #88493 to fix some duplicated diagnostics, but it
doesn't seem necessary any more.

This commit removes the special case and only four tests have changed
output, with additional errors. And those additional errors aren't
exact duplicates, they're just similar. For example, in
src/tools/clippy/tests/ui/same_name_method.rs we currently have this
error:
```
error: method's name is the same as an existing method in a trait
  --&gt; $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --&gt; $DIR/same_name_method.rs:79:9
   |
LL |         impl T1 for S {}
   |         ^^^^^^^^^^^^^^^^
```
and with this change we also get this error:
```
error: method's name is the same as an existing method in a trait
  --&gt; $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --&gt; $DIR/same_name_method.rs:81:9
   |
LL |         impl T2 for S {}
   |         ^^^^^^^^^^^^^^^^
```
I think printing this second argument is reasonable, possibly even
preferable to hiding it. And the other cases are similar.
</content>
</entry>
<entry>
<title>Rollup merge of #118533 - chenyukang:yukang-fix-118455, r=petrochenkov</title>
<updated>2024-01-30T15:57:46+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2024-01-30T15:57:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ee2e9e1edabb7825df904c0117393059446c4462'/>
<id>urn:sha1:ee2e9e1edabb7825df904c0117393059446c4462</id>
<content type='text'>
Suppress unhelpful diagnostics for unresolved top level attributes

Fixes #118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them.

Also fixes #89566, fixes #67107.

r? `@petrochenkov`
</content>
</entry>
<entry>
<title>Remove the second lifetime from `DiagnosticArg`.</title>
<updated>2024-01-30T07:46:08+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-30T05:06:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=514a5d8d556a6e28f586551c31ad0e9c83224caf'/>
<id>urn:sha1:514a5d8d556a6e28f586551c31ad0e9c83224caf</id>
<content type='text'>
Because it's always static.

I'm surprised the compiler allowed this unused lifetime without any
complaint.
</content>
</entry>
<entry>
<title>Remove the lifetime from `DiagnosticArgName`.</title>
<updated>2024-01-30T07:46:08+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-30T05:04:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f0426b77fc1f4bc170ababce990c88565310eb26'/>
<id>urn:sha1:f0426b77fc1f4bc170ababce990c88565310eb26</id>
<content type='text'>
Because it's always 'static.
</content>
</entry>
<entry>
<title>Remove `DiagnosticArgName` from `rustc_codegen_ssa`.</title>
<updated>2024-01-30T07:46:08+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-30T04:52:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=06aa381adbd5bac561c57dc6fc0390da8ec45b69'/>
<id>urn:sha1:06aa381adbd5bac561c57dc6fc0390da8ec45b69</id>
<content type='text'>
It's identical to the one in `rustc_errors`; use that instead.

Also remove some `rustc_errors::` qualifiers.
</content>
</entry>
<entry>
<title>Remove the lifetime from `DiagnosticArgValue`.</title>
<updated>2024-01-30T07:46:06+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-30T04:27:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5350edb9e8f4e194a2cad9a41b81d97a8ed52fab'/>
<id>urn:sha1:5350edb9e8f4e194a2cad9a41b81d97a8ed52fab</id>
<content type='text'>
Because it's almost always static.

This makes `impl IntoDiagnosticArg for DiagnosticArgValue` trivial,
which is nice.

There are a few diagnostics constructed in
`compiler/rustc_mir_build/src/check_unsafety.rs` and
`compiler/rustc_mir_transform/src/errors.rs` that now need symbols
converted to `String` with `to_string` instead of `&amp;str` with `as_str`,
but that' no big deal, and worth it for the simplifications elsewhere.
</content>
</entry>
<entry>
<title>Supress unhelpful diagnostics for unresolved top level attributes</title>
<updated>2024-01-29T09:43:07+00:00</updated>
<author>
<name>yukang</name>
<email>moorekang@gmail.com</email>
</author>
<published>2024-01-27T11:09:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=492df34eea0215abb6e3e43dcdcef30df7be23f2'/>
<id>urn:sha1:492df34eea0215abb6e3e43dcdcef30df7be23f2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Stop using `String` for error codes.</title>
<updated>2024-01-28T20:41:41+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-13T23:57:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5d9dfbd08f38c2a9bc71d39de8f5c7776afe0f9e'/>
<id>urn:sha1:5d9dfbd08f38c2a9bc71d39de8f5c7776afe0f9e</id>
<content type='text'>
Error codes are integers, but `String` is used everywhere to represent
them. Gross!

This commit introduces `ErrCode`, an integral newtype for error codes,
replacing `String`. It also introduces a constant for every error code,
e.g. `E0123`, and removes the `error_code!` macro. The constants are
imported wherever used with `use rustc_errors::codes::*`.

With the old code, we have three different ways to specify an error code
at a use point:
```
error_code!(E0123)  // macro call

struct_span_code_err!(dcx, span, E0123, "msg");  // bare ident arg to macro call

\#[diag(name, code = "E0123")]  // string
struct Diag;
```

With the new code, they all use the `E0123` constant.
```
E0123  // constant

struct_span_code_err!(dcx, span, E0123, "msg");  // constant

\#[diag(name, code = E0123)]  // constant
struct Diag;
```

The commit also changes the structure of the error code definitions:
- `rustc_error_codes` now just defines a higher-order macro listing the
  used error codes and nothing else.
- Because that's now the only thing in the `rustc_error_codes` crate, I
  moved it into the `lib.rs` file and removed the `error_codes.rs` file.
- `rustc_errors` uses that macro to define everything, e.g. the error
  code constants and the `DIAGNOSTIC_TABLES`. This is in its new
  `codes.rs` file.
</content>
</entry>
<entry>
<title>Sort attributes in `compiler/rustc_errors/src/lib.rs`.</title>
<updated>2024-01-28T20:40:08+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-13T23:57:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d91d164b00d63ade539f206fb9bf8cac5c8c73e3'/>
<id>urn:sha1:d91d164b00d63ade539f206fb9bf8cac5c8c73e3</id>
<content type='text'>
As is already done in `rustc_span` and `rustc_data_structures`.
</content>
</entry>
<entry>
<title>Fix typo</title>
<updated>2024-01-26T20:01:45+00:00</updated>
<author>
<name>Urgau</name>
<email>3616612+Urgau@users.noreply.github.com</email>
</author>
<published>2024-01-26T20:01:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=93ff4a4f4806965a0ea19a0441e2e9ec8e2404f9'/>
<id>urn:sha1:93ff4a4f4806965a0ea19a0441e2e9ec8e2404f9</id>
<content type='text'>
Co-authored-by: Michael Goulet &lt;michael@errs.io&gt;</content>
</entry>
</feed>
