Rust Digger: 7.53% of crates have both 'edition' and 'rust-version', 11.21% have neither

Date: 2024.04.16

In the past two weeks I was struggling with the MSRV - Minimum Supported Rust Version numbers, but finally I think I got it right.

First of all I had to realized that because roughly 20% of the crates don't indicate their repository, it would be better to collect this information from the Cargo.toml file of the already released crates. For this I had to copy all the crates from Crates.io and I had to make sure that I remove the old downloads once a new version of the crate appears.

Then I had to write some code that will read the Cargo.toml file. I could not figure out how to use the source code of Cargo for this. I found the cargo_toml crate which is used by lib.rs, but it panicked on the Cargo.toml files I threw at it. This was probably due to the fact that back then I was still using the Cargo.toml files that came from the cloned repositories. I files some issues but I figured it is a good opportunity for me to understand TOML better so I wrote my own little code.

The last major issue that drove me crazy was the fact that some crates had a rust-version field that looked like this: "1.79.0". When I crated the appropriate HTML file I used set_extension that replaced the last "0" by "html" yielding a filename "1.79.html". However on the page listing all the version "1.79" was already linking to "1.79.html" which now contained the list of "1.79.0". I was totally confused for quite some time. Eventually I figured out how to set the file extension.

  • 65 crates use 2015 as "edition", 16,102 has no "edition".
  • 143,234-132,182 = 11,052 of the crates have "rust-version"
  • 10,788 crates (7.53%) has both "edition" and "rust-version"
  • 16,055 crates (11.2%) have neither.

Number of crates

There are now 143,234 crates (1,252 more than two weeks ago).

MSRV - Minimum Supported Rust Version Stats from the MSRV page

package.edition

edition count
na 16,102
2021 79,580
2018 47,270
2015 65

package.rust-version

rust-version count
na 132,182
1.79.0 2
1.79 1
1.78.0 1
1.78 19
1.77.2 3
1.77.1 13
1.77.0 30
1.77 44
1.76.0 73
1.76 126
1.75.0 220
1.75 373
1.74.1 57
1.74.0 158
1.74 258
1.73.0 140
1.73 153
1.72.1 19
1.72.0 51
1.72 167
1.71.1 88
1.71.0 53
1.71 143
1.70.0 600
1.70 806
1.69.0 53
1.69 169
1.68.2 40
1.68.1 1
1.68.0 61
1.68 92
1.67.1 73
1.67.0 140
1.67 247
1.66.1 82
1.66.0 82
1.66 190
1.65.0 326
1.65 762
1.64.0 502
1.64 403
1.63.0 127
1.63 325
1.62.1 70
1.62.0 28
1.62 142
1.61.0 157
1.61 174
1.60.0 226
1.60 554
1.6.0 1
1.6 1
1.59.0 110
1.59 132
1.58.1 50
1.58.0 64
1.58 101
1.57.0 69
1.57 147
1.56.1 186
1.56.0 242
1.56 738
1.55 4
1.54.0 6
1.54 11
1.53.0 3
1.53 28
1.52.0 1
1.52 7
1.51.0 10
1.51 20
1.50 3
1.49.0 8
1.49 14
1.48.0 14
1.48 13
1.47.0 1
1.47 13
1.46.0 40
1.46 5
1.45.2 1
1.45.0 1
1.45 5
1.44 2
1.43.1 4
1.43.0 1
1.43 3
1.42.0 7
1.42 1
1.41.1 4
1.41 1
1.40 4
1.39.0 3
1.39 7
1.38 10
1.37.0 2
1.37 6
1.36.0 4
1.36 27
1.34.2 1
1.34 4
1.33 3
1.31.0 9
1.31 46
1.30.0 1
1.30 1
1.19 1
1.17 3
1.13 1
1.1 1
1.0.0 1
1.0 4

Rust Digger Stats from the stats page

name value percentage
total 143,234 100%
No repository 27,784 19.39%
Has homepage but no repository 3,330 2.32%
No homepage and no repository 24,454 17.07%
On GitHub but no CI 56,857 39.69%
On GitLab but no CI 1,864 1.3%
Crates without owner name 21,309 14.87%
Crates without owner 11 0%
Has rustfmt.toml 15,182 10.59%
Has .rustfmt.toml 5,524 3.85%
Has both rustfmt.toml and .rustfmt.toml 35 0.02%
Has Cargo.toml in root 95,441 66.63%
Has no Cargo.toml in root 47,793 33.36%
Has errors in the released Cargo.toml file 83 0.05%
Crates without edition and without rust-version in the Cargo.toml 16,055 11.2%
Crates with both edition rust-version in the Cargo.toml 10,788 7.53%