<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/src/debuginfo, branch 1.86.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.86.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.86.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-02-14T01:46:08+00:00</updated>
<entry>
<title>Rollup merge of #136895 - maurer:fix-enum-discr, r=nikic</title>
<updated>2025-02-14T01:46:08+00:00</updated>
<author>
<name>Jubilee</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2025-02-14T01:46:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=864eba9fb13d1f732e16a4fb1ca9846a5757f1c5'/>
<id>urn:sha1:864eba9fb13d1f732e16a4fb1ca9846a5757f1c5</id>
<content type='text'>
debuginfo: Set bitwidth appropriately in enum variant tags

Previously, we unconditionally set the bitwidth to 128-bits, the largest an enum would possibly be. Then, LLVM would cut down the constant by chopping off leading zeroes before emitting the DWARF. LLVM only supported 64-bit enumerators, so this would also have occasionally resulted in truncated data.

LLVM added support for 128-bit enumerators in llvm/llvm-project#125578

That patchset trusts the constant to describe how wide the variant tag is, so the high 64-bits of zeros are considered potentially load-bearing.

As a result, we went from emitting tags that looked like:
DW_AT_discr_value     (0xfe)

(because `dwarf::BestForm` selected `data1`)

to emitting tags that looked like:
DW_AT_discr_value	(&lt;0x10&gt; fe ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 )

This makes the `DW_AT_discr_value` encode at the bitwidth of the tag, which:
1. Is probably closer to our intentions in terms of describing the data.
2. Doesn't invoke the 128-bit support which may not be supported by all debuggers / downstream tools.
3. Will result in smaller debug information.
</content>
</entry>
<entry>
<title>debuginfo: Set bitwidth appropriately in enum variant tags</title>
<updated>2025-02-12T18:01:42+00:00</updated>
<author>
<name>Matthew Maurer</name>
<email>mmaurer@google.com</email>
</author>
<published>2025-02-12T00:37:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d82219a4fa06bfa47fc5aac64844c461905ae77d'/>
<id>urn:sha1:d82219a4fa06bfa47fc5aac64844c461905ae77d</id>
<content type='text'>
Previously, we unconditionally set the bitwidth to 128-bits, the largest
an discrimnator would possibly be. Then, LLVM would cut down the constant by
chopping off leading zeroes before emitting the DWARF. LLVM only
supported 64-bit descriminators, so this would also have occasionally
resulted in truncated data (or an assert) if more than 64-bits were
used.

LLVM added support for 128-bit enumerators in llvm/llvm-project#125578

That patchset also trusts the constant to describe how wide the variant tag is.
As a result, we went from emitting tags that looked like:
DW_AT_discr_value     (0xfe)

(`form1`)

to emitting tags that looked like:
DW_AT_discr_value	(&lt;0x10&gt; fe ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 )

This makes the `DW_AT_discr_value` encode at the bitwidth of the tag,
which:
1. Is probably closer to our intentions in terms of describing the data.
2. Doesn't invoke the 128-bit support which may not be supported by all
   debuggers / downstream tools.
3. Will result in smaller debug information.
</content>
</entry>
<entry>
<title>Document some safety constraints and use more safe wrappers</title>
<updated>2025-02-11T09:47:13+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-01-14T12:25:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dcf1e4d72b4dbda592050dcde7d7972414b05d3c'/>
<id>urn:sha1:dcf1e4d72b4dbda592050dcde7d7972414b05d3c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum</title>
<updated>2025-02-09T15:44:16+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-02-09T15:44:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=124cc92199ffa924f6b4c7cc819a85b65e0c3984'/>
<id>urn:sha1:124cc92199ffa924f6b4c7cc819a85b65e0c3984</id>
<content type='text'>
Update bootstrap compiler and rustfmt

The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same
time.
</content>
</entry>
<entry>
<title>Rollup merge of #136659 - wesleywiser:dwarf_version_lto_merge_behavior, r=jieyouxu</title>
<updated>2025-02-08T23:37:28+00:00</updated>
<author>
<name>Urgau</name>
<email>3616612+Urgau@users.noreply.github.com</email>
</author>
<published>2025-02-08T23:37:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5ec56e5fbbbef22be73a469ec5467714391f8a67'/>
<id>urn:sha1:5ec56e5fbbbef22be73a469ec5467714391f8a67</id>
<content type='text'>
Pick the max DWARF version when LTO'ing modules with different versions

Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- From observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning.
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors.
- Debuggers need to be able to handle a variety of versions within the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions.

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
adds a test to ensure no warning is printed.

Fixes #130041 which fails due to these warnings being printed

cc #103057
</content>
</entry>
<entry>
<title>Rustfmt</title>
<updated>2025-02-08T22:12:13+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-08T22:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fcae03369abb4c2cc180cd5a49e1f4440a81300'/>
<id>urn:sha1:1fcae03369abb4c2cc180cd5a49e1f4440a81300</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Pick the max DWARF version when LTO'ing modules with different versions</title>
<updated>2025-02-08T16:33:36+00:00</updated>
<author>
<name>Wesley Wiser</name>
<email>wwiser@gmail.com</email>
</author>
<published>2025-02-06T04:50:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bbc40e78226c2b4a84b44c717b5ad0983e29944c'/>
<id>urn:sha1:bbc40e78226c2b4a84b44c717b5ad0983e29944c</id>
<content type='text'>
Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- from observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors
- Debuggers need to be able to handle a variety of versions withing the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
updates the test added in the previous commit to ensure no warning is
printed.
</content>
</entry>
<entry>
<title>Rollup merge of #136640 - Zalathar:debuginfo-align-bits, r=compiler-errors</title>
<updated>2025-02-08T02:58:45+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2025-02-08T02:58:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=93b194516af4eb85d1be589d99200a624fc01696'/>
<id>urn:sha1:93b194516af4eb85d1be589d99200a624fc01696</id>
<content type='text'>
Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit

In #116096, function ZSTs were made to have debuginfo that gives them an alignment of “1”. But because alignment in LLVM debuginfo is denoted in *bits*, not bytes, this resulted in an alignment specification of 1 bit instead of 1 byte.

I don't know whether this has any practical consequences, but I noticed that a test started failing when I accidentally fixed the mistake while working on #136632, so I extracted the fix (and the test adjustment) to this PR.
</content>
</entry>
<entry>
<title>Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit</title>
<updated>2025-02-06T12:01:29+00:00</updated>
<author>
<name>Zalathar</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-02-06T12:01:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4385a9e06384238f1c6be7fe0f9646e17812f851'/>
<id>urn:sha1:4385a9e06384238f1c6be7fe0f9646e17812f851</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #136471 - safinaskar:parallel, r=SparrowLii</title>
<updated>2025-02-06T10:50:05+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-02-06T10:50:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2f92f050e83bf3312ce4ba73c31fe843ad3cbc60'/>
<id>urn:sha1:2f92f050e83bf3312ce4ba73c31fe843ad3cbc60</id>
<content type='text'>
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

This is continuation of https://github.com/rust-lang/rust/pull/132282 .

I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement.

There are other possibilities, through.

We can define `enum Lrc&lt;T&gt; { Rc(Rc&lt;T&gt;), Arc(Arc&lt;T&gt;) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase.

So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge.

cc "Parallel Rustc Front-end" ( https://github.com/rust-lang/rust/issues/113349 )

r? SparrowLii

`@rustbot` label WG-compiler-parallel
</content>
</entry>
</feed>
