<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_session/src, branch 1.84.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.84.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.84.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-11-21T10:58:36+00:00</updated>
<entry>
<title>Rollup merge of #130236 - yaahc:unstable-feature-usage, r=estebank</title>
<updated>2024-11-21T10:58:36+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-11-21T10:58:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fe5403f517617e1ecdf1cd3cd33bf205727f92c9'/>
<id>urn:sha1:fe5403f517617e1ecdf1cd3cd33bf205727f92c9</id>
<content type='text'>
unstable feature usage metrics

example output

```
test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat src/lib.rs
───────┬───────────────────────────────────────────────────────
       │ File: src/lib.rs
───────┼───────────────────────────────────────────────────────
   1   │ #![feature(unix_set_mark)]
   2   │ pub fn add(left: u64, right: u64) -&gt; u64 {
   3   │     left + right
   4   │ }
   5   │
   6   │ #[cfg(test)]
   7   │ mod tests {
   8   │     use super::*;
   9   │
  10   │     #[test]
  11   │     fn it_works() {
  12   │         let result = add(2, 2);
  13   │         assert_eq!(result, 4);
  14   │     }
  15   │ }
───────┴───────────────────────────────────────────────────────

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cargo +stage1 rustc -- -Zmetrics-dir=$PWD/metrics
   Compiling test-lib v0.1.0 (/home/yaahc/tmp/test-lib)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat metrics/unstable_feature_usage.json
───────┬─────────────────────────────────────────────────────────────────────
       │ File: metrics/unstable_feature_usage.json
───────┼─────────────────────────────────────────────────────────────────────
   1   │ {"lib_features":[{"symbol":"unix_set_mark"}],"lang_features":[]}
   ```

   related to https://github.com/rust-lang/rust/issues/129485
</content>
</entry>
<entry>
<title>unstable feature usage metrics</title>
<updated>2024-11-20T19:31:40+00:00</updated>
<author>
<name>Jane Losare-Lusby</name>
<email>jlusby@yaah.dev</email>
</author>
<published>2024-09-06T20:05:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dc97db105ac3ebefe0ab51b88a26f87ef4fec207'/>
<id>urn:sha1:dc97db105ac3ebefe0ab51b88a26f87ef4fec207</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #133023 - samestep:hir-stats-total-count, r=nnethercote</title>
<updated>2024-11-19T08:19:20+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-11-19T08:19:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f25fee3349ce48481b7721c7177a1a95fe131deb'/>
<id>urn:sha1:f25fee3349ce48481b7721c7177a1a95fe131deb</id>
<content type='text'>
Merge `-Zhir-stats` into `-Zinput-stats`

Currently `-Z hir-stats` prints the size and count of various kinds of nodes, and the total size of all the nodes it counted, but not the total count of nodes. So, before this PR:

```
$ git clone https://github.com/BurntSushi/ripgrep
$ cd ripgrep
$ cargo +nightly rustc -- -Z hir-stats
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 ...
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                 93_576
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name                Accumulated Size         Count     Item Size
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 ...
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total              2_430_648
ast-stats-2
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ...
hir-stats ----------------------------------------------------------------
hir-stats Total              3_678_512
hir-stats
```

For consistency, this PR adds a total for the count as well:

```
$ cargo +stage1 rustc -- -Z hir-stats
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 ...
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                 93_576                 1_877
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name                Accumulated Size         Count     Item Size
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 ...
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total              2_430_648                48_625
ast-stats-2
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ...
hir-stats ----------------------------------------------------------------
hir-stats Total              3_678_512                73_418
hir-stats
```

I wasn't sure if I was supposed to update `tests/ui/stats/hir-stats.stderr` to reflect this. I ran it locally, thinking it would fail, but it didn't:

```
$ ./x test tests/ui/stats
...

running 2 tests
i.

test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 17949 filtered out
```

Also: is there a reason `-Z hir-stats` and `-Z input-stats` both exist? The former seems like it should completely supercede the latter. But strangely, the two give very different numbers for node counts:

```
$ cargo +nightly rustc -- -Z input-stats
...
Lines of code:             483
Pre-expansion node count:  2386
Post-expansion node count: 63844
```

That's a 30% difference in this case. Is it intentional that these numbers are so different? I see comments for both saying that they are merely approximations and should not be expected to be correct:

https://github.com/rust-lang/rust/blob/bd0826a4521a845f36cce1b00e1dd2918ba09e90/compiler/rustc_ast_passes/src/node_count.rs#L1

https://github.com/rust-lang/rust/blob/bd0826a4521a845f36cce1b00e1dd2918ba09e90/compiler/rustc_passes/src/hir_stats.rs#L1-L3
</content>
</entry>
<entry>
<title>Overhaul the `-l` option parser (for linking to native libs)</title>
<updated>2024-11-18T04:55:12+00:00</updated>
<author>
<name>Zalathar</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2024-11-11T10:42:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=78edefea9d8e4820d7ce7c1d846f89e60fe3b81c'/>
<id>urn:sha1:78edefea9d8e4820d7ce7c1d846f89e60fe3b81c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move `-l` option parsing into its own submodule</title>
<updated>2024-11-18T04:55:12+00:00</updated>
<author>
<name>Zalathar</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2024-11-11T10:39:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=478db489b3074126862cb71cbf924402121f99cb'/>
<id>urn:sha1:478db489b3074126862cb71cbf924402121f99cb</id>
<content type='text'>
No functional change (yet).
</content>
</entry>
<entry>
<title>Merge `-Zhir-stats` into `-Zinput-stats`</title>
<updated>2024-11-15T17:46:40+00:00</updated>
<author>
<name>Sam Estep</name>
<email>sam@samestep.com</email>
</author>
<published>2024-11-14T21:12:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=090c24fbbfde43ebffb8a05e26bff4aceb98dfb8'/>
<id>urn:sha1:090c24fbbfde43ebffb8a05e26bff4aceb98dfb8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustc_metadata: Preprocess search paths for better performance</title>
<updated>2024-11-15T09:35:33+00:00</updated>
<author>
<name>Piotr Osiewicz</name>
<email>24362066+osiewicz@users.noreply.github.com</email>
</author>
<published>2024-11-11T17:34:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=42e71bb8ea2bf59fb33cf3f83a3dcf34e314f520'/>
<id>urn:sha1:42e71bb8ea2bf59fb33cf3f83a3dcf34e314f520</id>
<content type='text'>
Over in Zed we've noticed that loading crates for a large-ish workspace can take almost 200ms. We've pinned it down to how rustc searches for paths, as it performs a linear search over the list of candidate paths. In our case the candidate list had about 20k entries which we had to iterate over for each dependency being loaded.

This commit introduces a simple FilesIndex that's just a sorted Vec under the hood. Since crates are looked up by both prefix and suffix, we perform a range search on said Vec (which constraints the search space based on prefix) and follow up with a linear scan of entries with matching suffixes.
FilesIndex is also pre-filtered before any queries are performed using available target information; query prefixes/sufixes are based on the target we are compiling for, so we can remove entries that can never match up front.

Overall, this commit brings down build time for us in dev scenarios by about 6%.
100ms might not seem like much, but this is a constant cost that each of our workspace crates has to pay, even when said crate is miniscule.
</content>
</entry>
<entry>
<title>Auto merge of #132919 - matthiaskrgr:rollup-ogghyvp, r=matthiaskrgr</title>
<updated>2024-11-12T02:51:21+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2024-11-12T02:51:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=67f21277cd40cd12e69aa34089f4a20926fd6dc5'/>
<id>urn:sha1:67f21277cd40cd12e69aa34089f4a20926fd6dc5</id>
<content type='text'>
Rollup of 7 pull requests

Successful merges:

 - #120077 (Add Set entry API )
 - #132144 (Arbitrary self types v2: (unused) Receiver trait)
 - #132297 (Document some `check_expr` methods, and other misc `hir_typeck` tweaks)
 - #132820 (Add a default implementation for CodegenBackend::link)
 - #132881 (triagebot: Autolabel rustdoc book)
 - #132912 (Simplify some places that deal with generic parameter defaults)
 - #132916 (Unvacation fmease)

r? `@ghost`
`@rustbot` modify labels: rollup
</content>
</entry>
<entry>
<title>Rollup merge of #132820 - bjorn3:default_backend_link_impl, r=jieyouxu</title>
<updated>2024-11-11T20:58:32+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-11-11T20:58:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=35225d61f43b74f2ec34244e42227c7b7a6469aa'/>
<id>urn:sha1:35225d61f43b74f2ec34244e42227c7b7a6469aa</id>
<content type='text'>
Add a default implementation for CodegenBackend::link

As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.
</content>
</entry>
<entry>
<title>Remove `rustc_session::config::rustc_short_optgroups`</title>
<updated>2024-11-11T11:46:38+00:00</updated>
<author>
<name>Zalathar</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2024-11-11T02:17:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8b4701d74cc7bc1a9532716fd2bd25579102115d'/>
<id>urn:sha1:8b4701d74cc7bc1a9532716fd2bd25579102115d</id>
<content type='text'>
</content>
</entry>
</feed>
