<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_const_eval/src/errors.rs, branch 1.77.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.77.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.77.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-03-15T01:12:40+00:00</updated>
<entry>
<title>downgrade mutable-ptr-in-final-value from hard-error to future-incompat lint to address issue 121610.</title>
<updated>2024-03-15T01:12:40+00:00</updated>
<author>
<name>Felix S. Klock II</name>
<email>pnkfelix@pnkfx.org</email>
</author>
<published>2024-03-08T16:24:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=25d3cbb10ec281014b4842540923cbe217eebb97'/>
<id>urn:sha1:25d3cbb10ec281014b4842540923cbe217eebb97</id>
<content type='text'>
(cherry picked from commit a8549b4152566d8fbd34c097236df1db3d9afd3c)
</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>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>Auto merge of #119627 - oli-obk:const_prop_lint_n̵o̵n̵sense, r=cjgillot</title>
<updated>2024-01-25T03:16:07+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2024-01-25T03:16:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=68411c955458ffbc98649d6dd057c4be3b187f38'/>
<id>urn:sha1:68411c955458ffbc98649d6dd057c4be3b187f38</id>
<content type='text'>
Remove all ConstPropNonsense

We track all locals and projections on them ourselves within the const propagator and only use the InterpCx to actually do some low level operations or read from constants (via `OpTy` we get for said constants).

This helps moving the const prop lint out from the normal pipeline and running it just based on borrowck information. This in turn allows us to make progress on https://github.com/rust-lang/rust/pull/108730#issuecomment-1875557745

there are various follow up cleanups that can be done after this PR (e.g. not matching on Rvalue twice and doing binop checks twice), but lets try landing this one first.

r? `@RalfJung`
</content>
</entry>
<entry>
<title>const prop nonsense eliminated</title>
<updated>2024-01-23T16:34:43+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2024-01-05T17:31:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1f398abcb6e11ea0dfe8e647a87fa2763005f89a'/>
<id>urn:sha1:1f398abcb6e11ea0dfe8e647a87fa2763005f89a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>raw pointers are not references</title>
<updated>2024-01-22T08:28:00+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2023-12-17T10:24:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0288a0bfa0f038350aaae224b6cdd7e440ea8408'/>
<id>urn:sha1:0288a0bfa0f038350aaae224b6cdd7e440ea8408</id>
<content type='text'>
</content>
</entry>
<entry>
<title>const-eval interner: from-scratch rewrite using mutability information from provenance rather than types</title>
<updated>2024-01-22T08:28:00+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2023-12-16T15:24:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2f1a8e2d7a641a398e9e02c8c99e80f6e44dce87'/>
<id>urn:sha1:2f1a8e2d7a641a398e9e02c8c99e80f6e44dce87</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename some `Diagnostic` setters.</title>
<updated>2024-01-03T08:40:20+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-23T22:08:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=505c1371d070ba6c9e15db7d331f2d6a2b167b68'/>
<id>urn:sha1:505c1371d070ba6c9e15db7d331f2d6a2b167b68</id>
<content type='text'>
`Diagnostic` has 40 methods that return `&amp;mut Self` and could be
considered setters. Four of them have a `set_` prefix. This doesn't seem
necessary for a type that implements the builder pattern. This commit
removes the `set_` prefixes on those four methods.
</content>
</entry>
<entry>
<title>Remove `Session` methods that duplicate `DiagCtxt` methods.</title>
<updated>2023-12-23T21:05:28+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-18T11:21:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=99472c7049783605444ab888a97059d0cce93a12'/>
<id>urn:sha1:99472c7049783605444ab888a97059d0cce93a12</id>
<content type='text'>
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
</content>
</entry>
<entry>
<title>Add `level` arg to `into_diagnostic`.</title>
<updated>2023-12-18T22:19:25+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-18T03:12:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e7724a2e319f112ee6a97999976d8225b009456e'/>
<id>urn:sha1:e7724a2e319f112ee6a97999976d8225b009456e</id>
<content type='text'>
And make all hand-written `IntoDiagnostic` impls generic, by using
`DiagnosticBuilder::new(dcx, level, ...)` instead of e.g.
`dcx.struct_err(...)`.

This means the `create_*` functions are the source of the error level.
This change will let us remove `struct_diagnostic`.

Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`,
it's necessary to pass diagnostics tests now that it's used in
`into_diagnostic` functions.
</content>
</entry>
</feed>
