<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_middle/src/query, branch 1.60.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.60.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.60.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-02-15T23:38:59+00:00</updated>
<entry>
<title>Support pretty printing of invalid constants</title>
<updated>2022-02-15T23:38:59+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2022-02-15T12:58:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=92d20c4aaddea9507f8ad37fe37c551219153bbf'/>
<id>urn:sha1:92d20c4aaddea9507f8ad37fe37c551219153bbf</id>
<content type='text'>
Make it possible to pretty print invalid constants by introducing a
fallible variant of `destructure_const` and falling back to debug
formatting when it fails.
</content>
</entry>
<entry>
<title>Overhaul `Const`.</title>
<updated>2022-02-15T05:19:59+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-02-02T03:24:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a95fb8b150a256856aedeca7ebf30b662d2e5141'/>
<id>urn:sha1:a95fb8b150a256856aedeca7ebf30b662d2e5141</id>
<content type='text'>
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as
this:
```
pub struct Const&lt;'tcx&gt;(&amp;'tcx Interned&lt;ConstS&gt;);
```
This now matches `Ty` and `Predicate` more closely, including using
pointer-based `eq` and `hash`.

Notable changes:
- `mk_const` now takes a `ConstS`.
- `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a
  we need separate arena for it, because we can't use the `Dropless` one any
  more.
- Many `&amp;'tcx Const&lt;'tcx&gt;`/`&amp;Const&lt;'tcx&gt;` to `Const&lt;'tcx&gt;` changes
- Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes.
- Lots of tedious sigil fiddling.
</content>
</entry>
<entry>
<title>Overhaul `TyS` and `Ty`.</title>
<updated>2022-02-15T05:03:24+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-01-25T03:13:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e9a0c429c5da5a34c0469117774fe32694a0281c'/>
<id>urn:sha1:e9a0c429c5da5a34c0469117774fe32694a0281c</id>
<content type='text'>
Specifically, change `Ty` from this:
```
pub type Ty&lt;'tcx&gt; = &amp;'tcx TyS&lt;'tcx&gt;;
```
to this
```
pub struct Ty&lt;'tcx&gt;(Interned&lt;'tcx, TyS&lt;'tcx&gt;&gt;);
```
There are two benefits to this.
- It's now a first class type, so we can define methods on it. This
  means we can move a lot of methods away from `TyS`, leaving `TyS` as a
  barely-used type, which is appropriate given that it's not meant to
  be used directly.
- The uniqueness requirement is now explicit, via the `Interned` type.
  E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather
  than via `TyS`, which wasn't obvious at all.

Much of this commit is boring churn. The interesting changes are in
these files:
- compiler/rustc_middle/src/arena.rs
- compiler/rustc_middle/src/mir/visit.rs
- compiler/rustc_middle/src/ty/context.rs
- compiler/rustc_middle/src/ty/mod.rs

Specifically:
- Most mentions of `TyS` are removed. It's very much a dumb struct now;
  `Ty` has all the smarts.
- `TyS` now has `crate` visibility instead of `pub`.
- `TyS::make_for_test` is removed in favour of the static `BOOL_TY`,
  which just works better with the new structure.
- The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls
  of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned`
  (pointer-based, for the `Equal` case) and partly on `TyS`
  (contents-based, for the other cases).
- There are many tedious sigil adjustments, i.e. adding or removing `*`
  or `&amp;`. They seem to be unavoidable.
</content>
</entry>
<entry>
<title>Explain &amp;Arc.</title>
<updated>2022-02-09T19:11:30+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2022-02-01T17:46:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e1a72c29aaef3b3145296dfc9e24201b3c655768'/>
<id>urn:sha1:e1a72c29aaef3b3145296dfc9e24201b3c655768</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make FnAbiError Copy.</title>
<updated>2022-02-09T19:11:29+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2022-02-01T17:44:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4435dfec0f1180411ac85a9def504ecbf5dd82ad'/>
<id>urn:sha1:4435dfec0f1180411ac85a9def504ecbf5dd82ad</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use a slice for object_lifetime_defaults.</title>
<updated>2022-02-09T19:11:01+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2022-02-01T17:28:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e52131efad56b2c55a3ca2a09011d71f1ae358a5'/>
<id>urn:sha1:e52131efad56b2c55a3ca2a09011d71f1ae358a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use a slice in DefIdForest.</title>
<updated>2022-02-09T19:11:00+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2022-02-01T17:27:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f72f15ca2861f8635f6240b083952f3bd3b78dee'/>
<id>urn:sha1:f72f15ca2861f8635f6240b083952f3bd3b78dee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Ensure that queries only return Copy types.</title>
<updated>2022-02-09T19:07:38+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2022-01-31T18:55:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6c2ee885e635a411946329e974d6be3d94d3b715'/>
<id>urn:sha1:6c2ee885e635a411946329e974d6be3d94d3b715</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser</title>
<updated>2022-02-04T17:42:13+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2022-02-04T17:42:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2fe9a32ed209b93ddd08cab174dfffefc1409a9c'/>
<id>urn:sha1:2fe9a32ed209b93ddd08cab174dfffefc1409a9c</id>
<content type='text'>
Stabilize `-Z instrument-coverage` as `-C instrument-coverage`

(Tracking issue for `instrument-coverage`: https://github.com/rust-lang/rust/issues/79121)

This PR stabilizes support for instrumentation-based code coverage, previously provided via the `-Z instrument-coverage` option. (Continue supporting `-Z instrument-coverage` for compatibility for now, but show a deprecation warning for it.)

Many, many people have tested this support, and there are numerous reports of it working as expected.

Move the documentation from the unstable book to stable rustc documentation. Update uses and documentation to use the `-C` option.

Addressing questions raised in the tracking issue:

&gt; If/when stabilized, will the compiler flag be updated to -C instrument-coverage? (If so, the -Z variant could also be supported for some time, to ease migrations for existing users and scripts.)

This stabilization PR updates the option to `-C` and keeps the `-Z` variant to ease migration.

&gt; The Rust coverage implementation depends on (and automatically turns on) -Z symbol-mangling-version=v0. Will stabilizing this feature depend on stabilizing v0 symbol-mangling first? If so, what is the current status and timeline?

This stabilization PR depends on https://github.com/rust-lang/rust/pull/90128 , which stabilizes `-C symbol-mangling-version=v0` (but does not change the default symbol-mangling-version).

&gt; The Rust coverage implementation implements the latest version of LLVM's Coverage Mapping Format (version 4), which forces a dependency on LLVM 11 or later. A compiler error is generated if attempting to compile with coverage, and using an older version of LLVM.

Given that LLVM 13 has now been released, requiring LLVM 11 for coverage support seems like a reasonable requirement. If people don't have at least LLVM 11, nothing else breaks; they just can't use coverage support. Given that coverage support currently requires a nightly compiler and LLVM 11 or newer, allowing it on a stable compiler built with LLVM 11 or newer seems like an improvement.

The [tracking issue](https://github.com/rust-lang/rust/issues/79121) and the [issue label A-code-coverage](https://github.com/rust-lang/rust/labels/A-code-coverage) link to a few open issues related to `instrument-coverage`, but none of them seem like showstoppers. All of them seem like improvements and refinements we can make after stabilization.

The original `-Z instrument-coverage` support went through a compiler-team MCP at https://github.com/rust-lang/compiler-team/issues/278 . Based on that, `@pnkfelix` suggested that this needed a stabilization PR and a compiler-team FCP.
</content>
</entry>
<entry>
<title>Auto merge of #93312 - pierwill:map-all-local-trait-impls, r=cjgillot</title>
<updated>2022-02-02T15:36:12+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-02-02T15:36:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7cd14d2f561a61e9838546f133afcf06038d761b'/>
<id>urn:sha1:7cd14d2f561a61e9838546f133afcf06038d761b</id>
<content type='text'>
Return an indexmap in `all_local_trait_impls` query

The data structure previously used here required that `DefId` be `Ord`. As part of #90317, we do not want `DefId` to implement `Ord`.
</content>
</entry>
</feed>
