<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/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-01-18T10:46:03+00:00</updated>
<entry>
<title>llvm: simplify data layout check</title>
<updated>2024-01-18T10:46:03+00:00</updated>
<author>
<name>David Wood</name>
<email>david.wood@huawei.com</email>
</author>
<published>2024-01-17T14:26:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=46652dd254bc9c413d14cec637c7f21ac6601e05'/>
<id>urn:sha1:46652dd254bc9c413d14cec637c7f21ac6601e05</id>
<content type='text'>
Don't skip the inconsistent data layout check for custom LLVMs.

With #118708, all targets will have a simple test that would trigger this
check if LLVM's data layouts do change - so data layouts would be
corrected during the LLVM upgrade. Therefore, with builtin targets, this
check won't trigger with our LLVM because each target will have been
confirmed to work. With non-builtin targets, this check is probably
useful to have because you can change the data layout in your target and
if its wrong then that could lead to bugs.

When using a custom LLVM, the same justification makes sense for
non-builtin targets as with our LLVM, the user can update their target to
match their LLVM and that's probably a good thing to do. However, with
a custom LLVM, the user cannot change the builtin target data layouts if
they don't match - though given that the compiler's data layout is used
for layout computation and a bunch of other things - you could get some
bugs because of the mismatch and probably want to know about that.

`CFG_LLVM_ROOT` was also always set during local development with
`download-ci-llvm` so this bug would never trigger locally.

Signed-off-by: David Wood &lt;david@davidtw.co&gt;
</content>
</entry>
<entry>
<title>Rename consuming chaining methods on `DiagnosticBuilder`.</title>
<updated>2024-01-09T20:40:00+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-08T22:08:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ed76b0b882d0acff9295bcd76c2b119cf83e7219'/>
<id>urn:sha1:ed76b0b882d0acff9295bcd76c2b119cf83e7219</id>
<content type='text'>
In #119606 I added them and used a `_mv` suffix, but that wasn't great.

A `with_` prefix has three different existing uses.
- Constructors, e.g. `Vec::with_capacity`.
- Wrappers that provide an environment to execute some code, e.g.
  `with_session_globals`.
- Consuming chaining methods, e.g. `Span::with_{lo,hi,ctxt}`.

The third case is exactly what we want, so this commit changes
`DiagnosticBuilder::foo_mv` to `DiagnosticBuilder::with_foo`.

Thanks to @compiler-errors for the suggestion.
</content>
</entry>
<entry>
<title>Use chaining in `DiagnosticBuilder` construction.</title>
<updated>2024-01-08T04:43:07+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-01-03T05:00:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=589591efde6c54baa8b7932ec3be6f45dc9d781f'/>
<id>urn:sha1:589591efde6c54baa8b7932ec3be6f45dc9d781f</id>
<content type='text'>
To avoid the use of a mutable local variable, and because it reads more
nicely.
</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>Improve some names.</title>
<updated>2023-12-23T02:23:28+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-20T06:12:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=824667f75357bb394c55ef3b0e2095af62e68a19'/>
<id>urn:sha1:824667f75357bb394c55ef3b0e2095af62e68a19</id>
<content type='text'>
Lots of vectors of messages called `message` or `msg`. This commit
pluralizes them.

Note that `emit_message_default` and `emit_messages_default` both
already existed, and both process a vector, so I renamed the former
`emit_messages_default_inner` because it's called by the latter.
</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>
<entry>
<title>Rename many `DiagCtxt` arguments.</title>
<updated>2023-12-18T05:06:22+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-17T23:15:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f422dca3ae8b8a8c9a99b8e6ec0899e08dc072c3'/>
<id>urn:sha1:f422dca3ae8b8a8c9a99b8e6ec0899e08dc072c3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename `Handler` as `DiagCtxt`.</title>
<updated>2023-12-18T05:06:19+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-17T10:48:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cde19c016e4608288a02f5bdec0b5330d474c26f'/>
<id>urn:sha1:cde19c016e4608288a02f5bdec0b5330d474c26f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Avoid `struct_diagnostic` where possible.</title>
<updated>2023-12-14T04:53:55+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-13T04:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7bdb227567398bed342697ea1f76f2cb34c9a7c2'/>
<id>urn:sha1:7bdb227567398bed342697ea1f76f2cb34c9a7c2</id>
<content type='text'>
It's necessary for `derive(Diagnostic)`, but is best avoided elsewhere
because there are clearer alternatives.

This required adding `Handler::struct_almost_fatal`.
</content>
</entry>
<entry>
<title>De-genericize some `IntoDiagnostic` impls.</title>
<updated>2023-12-04T07:57:42+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-03T23:11:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b7e18cabd2af625c2582ab0ce0fecc9b5437a512'/>
<id>urn:sha1:b7e18cabd2af625c2582ab0ce0fecc9b5437a512</id>
<content type='text'>
These impls are all needed for just a single `IntoDiagnostic` type, not
a family of them.

Note that `ErrorGuaranteed` is the default type parameter for
`IntoDiagnostic`.
</content>
</entry>
</feed>
