Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port cargo from toml-rs to toml_edit #10086

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Port cargo from toml-rs to toml_edit #10086

merged 1 commit into from
Jan 20, 2022

Conversation

epage
Copy link
Contributor

@epage epage commented Nov 16, 2021

Benefits:

TODO

@rust-highfive
Copy link

r? @Eh2406

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 16, 2021
@epage
Copy link
Contributor Author

epage commented Nov 16, 2021

Oh, if I knew highfive looks at drafts, I might not have created this.

@gilescope
Copy link
Contributor

gilescope commented Nov 22, 2021

Does toml_edit still have a way to do spanned so we can (one day) get Cargo.toml line numbers? I tried it with toml-rs but got stuck with 4 layers of serde... ( #9752 )

@epage
Copy link
Contributor Author

epage commented Nov 23, 2021

Does toml_edit still have a way to do spanned so we can (one day) get Cargo.toml line numbers? I tried it with toml-rs but got stuck with 4 layers of serde... ( #9752 )

I saw references to spans in toml-rs but never saw what they were used for, so I assumed it was an implementation detail.

Mind creating an issue in the toml_edit repo with details of what you would find useful in dealing with this or what works or doesn't work with toml-rs's version?

@est31
Copy link
Member

est31 commented Nov 25, 2021

Spans are useful for creating nice errors that quote the actual toml, similar to how rustc is creating errors that quote your rust source code. Also, they are useful for IDEs so that not the entire file is underlined if there is an error. One step towards such errors is cargo creating span information. #7548

@jonhoo
Copy link
Contributor

jonhoo commented Dec 16, 2021

Some additional anecdotal data for why this might be worth pushing on. Here's cargo-llvm-lines run against a library that links against Cargo:

  Lines          Copies        Function name
  -----          ------        -------------
  448018 (100%)  10087 (100%)  (TOTAL)
   25227 (5.6%)      5 (0.0%)  <cargo::util::toml::_::<impl serde::de::Deserialize for cargo::util::toml::TomlProject>::deserialize::__Visitor as serde::de::Visitor>::visit_map
   12136 (2.7%)     34 (0.3%)  <toml::de::MapVisitor as serde::de::MapAccess>::next_value_seed
   11721 (2.6%)      6 (0.1%)  <cargo::util::toml::_::<impl serde::de::Deserialize for cargo::util::toml::TomlProfile>::deserialize::__Visitor as serde::de::Visitor>::visit_map
   10582 (2.4%)      5 (0.0%)  <cargo::util::toml::_::<impl serde::de::Deserialize for cargo::util::toml::TomlTarget>::deserialize::__Visitor as serde::de::Visitor>::visit_map
   10218 (2.3%)     59 (0.6%)  <toml::de::SpannedDeserializer<T> as serde::de::MapAccess>::next_value_seed
    9269 (2.1%)     12 (0.1%)  <toml::de::MapVisitor as serde::de::MapAccess>::next_key_seed
    9140 (2.0%)     25 (0.2%)  <toml::de::ValueDeserializer as serde::de::Deserializer>::deserialize_any
    7245 (1.6%)      2 (0.0%)  <cargo::util::toml::_::<impl serde::de::Deserialize for cargo::util::toml::TomlManifest>::deserialize::__Visitor as serde::de::Visitor>::visit_map
    6717 (1.5%)      3 (0.0%)  <cargo::util::toml::_::<impl serde::de::Deserialize for cargo::util::toml::DetailedTomlDependency<P>>::deserialize::__Visitor<P> as serde::de::Visitor>::visit_map
    6467 (1.4%)     19 (0.2%)  <toml::de::MapVisitor as serde::de::SeqAccess>::next_element_seed

It'd be interesting to see if the move to toml_edit could help with all that.

@epage
Copy link
Contributor Author

epage commented Dec 31, 2021

Tests are now passing for me locally. While I still need to dig into performance, I'd appreciate feedback on what is acceptable or not for user-visible changes.

Good

  • We now include a newline before [dependencies.bar] in published toml files
  • We skip empty [dev-dependencies] in published toml files

Unsure

  • toml_edit has a limited form of showing where in a line the error came from
  • Errors for a line with just a key now report both a . and = as next possible character
  • Error messages only reported unexpected character (Unexpected "b") and not token (Unexpected identifier)

Remaining not greats

@alexcrichton
Copy link
Member

The changes to the tests here all look quite reasonable to me. While there could be small nits about one way or another in a few places overall I think all the substance is still there which is largely what matters.

@epage
Copy link
Contributor Author

epage commented Jan 6, 2022

Performance looks to be a wash to around 5% slow down. Its hard to tell exactly because most of the change is within the margin of error on my laptop

  • rustc 1.57
  • Linux
  • Plugged in
  • Didn't close all apps but did stop music and things
  • Runs varied for both master and this branch by about 5%

So onto my last run of this branch compared to my last master run

85f7bfd61ea4fee08ec68c468762e886b2aebec6          
resolve_ws/cargo        time:   [30.337 ms 30.411 ms 30.502 ms]                              
                        change: [-3.5217% -2.6600% -1.8773%] (p = 0.00 < 0.05)
                        Performance has improved.    
Found 5 outliers among 100 measurements (5.00%)                                                                                                    
  1 (1.00%) high mild                                                                                                                              
  4 (4.00%) high severe                                                                                                                            
Benchmarking resolve_ws/diem: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 25.3s, or reduce sample count to 10.
resolve_ws/diem         time:   [254.70 ms 255.38 ms 256.17 ms]                             
                        change: [-2.4359% -1.7454% -1.0574%] (p = 0.00 < 0.05)                  
                        Performance has improved.                                                                                                  
Found 2 outliers among 100 measurements (2.00%)                                                                                                    
  1 (1.00%) high mild                                                    
  1 (1.00%) high severe                                                  
resolve_ws/empty        time:   [247.70 us 249.18 us 250.78 us]                              
                        change: [+4.6698% +5.5148% +6.4177%] (p = 0.00 < 0.05)                                                                     
                        Performance has regressed.                                                                                                 
Found 5 outliers among 100 measurements (5.00%)                                                                                                    
  4 (4.00%) high mild                                                    
  1 (1.00%) high severe                                                  
Benchmarking resolve_ws/gecko-dev: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 20.9s, or reduce sample count to 20.
resolve_ws/gecko-dev    time:   [206.65 ms 207.81 ms 209.03 ms]                                   
                        change: [+4.7307% +5.5707% +6.4154%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild                                                    
Benchmarking resolve_ws/rust: Warming up for 3.0000 s                                                                                              
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 15.8s, or reduce sample count to 30.
resolve_ws/rust         time:   [154.89 ms 155.65 ms 156.43 ms]                             
                        change: [+3.9641% +4.8089% +5.6012%] (p = 0.00 < 0.05)
                        Performance has regressed.                       
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild                                                                                                                              
Benchmarking resolve_ws/servo: Warming up for 3.0000 s         
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 37.8s, or reduce sample count to 10.
resolve_ws/servo        time:   [383.39 ms 385.20 ms 387.04 ms]                              
                        change: [+2.3391% +3.0466% +3.8055%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
Benchmarking resolve_ws/substrate: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 39.8s, or reduce sample count to 10.
resolve_ws/substrate    time:   [392.95 ms 394.53 ms 396.16 ms]                                  
                        change: [+5.8655% +6.4134% +7.0062%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
Benchmarking resolve_ws/tikv: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 25.0s, or reduce sample count to 20.
resolve_ws/tikv         time:   [247.03 ms 248.35 ms 249.73 ms]                             
                        change: [+6.3043% +6.9944% +7.7274%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
resolve_ws/toml-rs      time:   [4.1845 ms 4.2097 ms 4.2380 ms]                                 
                        change: [+11.882% +12.879% +13.816%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

85f7bfd61ea4fee08ec68c468762e886b2aebec6
feature_resolver/cargo  time:   [516.88 us 519.76 us 522.81 us]                                    
                        change: [+4.2772% +5.0601% +5.8259%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
feature_resolver/diem   time:   [6.4566 ms 6.5098 ms 6.5634 ms]                                   
                        change: [+2.9215% +3.8941% +4.9640%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
feature_resolver/empty  time:   [2.9904 us 3.0063 us 3.0238 us]                                     
                        change: [+5.4619% +6.3317% +7.2605%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
feature_resolver/gecko-dev                                                                                                                         
                        time:   [3.3601 ms 3.3777 ms 3.3957 ms]
                        change: [+4.4394% +5.3523% +6.2079%] (p = 0.00 < 0.05)                                               
                        Performance has regressed.                                                                                                 
Found 1 outliers among 100 measurements (1.00%)                                                                                                    
  1 (1.00%) high mild                                                    
feature_resolver/rust   time:   [3.7609 ms 3.7908 ms 3.8233 ms]                                    
                        change: [+4.2661% +5.2651% +6.2767%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)           
  3 (3.00%) high mild                                                                                                                              
  1 (1.00%) high severe                                                                                                                            
feature_resolver/servo  time:   [4.8117 ms 4.8450 ms 4.8810 ms]                                    
                        change: [+2.7391% +4.0271% +5.1739%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe                                                  
feature_resolver/substrate                                                                                                   
                        time:   [25.665 ms 25.833 ms 26.028 ms]                                                                                    
                        change: [+6.3875% +7.3589% +8.2665%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe                                                                                                                            
feature_resolver/tikv   time:   [7.3014 ms 7.3603 ms 7.4201 ms]                                  
                        change: [+4.6716% +5.6024% +6.5760%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
feature_resolver/toml-rs                                                                              
                        time:   [30.400 us 30.562 us 30.736 us]                                                                                    
                        change: [+4.9207% +5.5802% +6.1710%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

@epage epage marked this pull request as ready for review January 6, 2022 17:53
@epage
Copy link
Contributor Author

epage commented Jan 7, 2022

@Eh2406 if we're comfortable with these performance numbers, then this is ready for review

(unsure if the change away from draft status pings people)

@bors
Copy link
Collaborator

bors commented Jan 20, 2022

📌 Commit 320c279 has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2022
@bors
Copy link
Collaborator

bors commented Jan 20, 2022

⌛ Testing commit 320c279 with merge bb96b3a...

@bors
Copy link
Collaborator

bors commented Jan 20, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing bb96b3a to master...

@bors bors merged commit bb96b3a into rust-lang:master Jan 20, 2022
@epage epage deleted the toml branch January 20, 2022 13:44
@rfcbot rfcbot added finished-final-comment-period FCP complete to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Jan 23, 2022
@ehuss ehuss mentioned this pull request Jan 25, 2022
bors added a commit that referenced this pull request Jan 25, 2022
Sync toml_edit versions

I missed in the review of #10086 that the toml_edit versions weren't in sync everywhere.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2022
Update cargo

9 commits in 95bb3c92bf516017e812e7f1c14c2dea3845b30e..1c034752de0df744fcd7788fcbca158830b8bf85
2022-01-18 17:39:35 +0000 to 2022-01-25 22:36:53 +0000
- Sync toml_edit versions (rust-lang/cargo#10329)
- Check --config for dotted keys only (rust-lang/cargo#10176)
- Remove deprecated --host arg for search and publish cmds (rust-lang/cargo#10327)
- doc: it's valid to use OUT_DIR for intermediate artifacts (rust-lang/cargo#10326)
- Use local git info for version. (rust-lang/cargo#10323)
- Fix documenting with undocumented dependencies. (rust-lang/cargo#10324)
- do not compile test for bins flagged as `test = false` (rust-lang/cargo#10305)
- Port cargo from toml-rs to toml_edit (rust-lang/cargo#10086)
- Fix new::git_default_branch with different default (rust-lang/cargo#10306)
@ehuss ehuss added this to the 1.60.0 milestone Feb 14, 2022
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Apr 15, 2022
Pkgsrc changes:
 * Bump available bootstraps to 1.59.0.
 * Delete one patch which no longer applies,
   adjust another.

Upstream changes:

Version 1.60.0 (2022-04-07)
==========================

Language
--------
- [Stabilize `#[cfg(panic = "...")]` for either `"unwind"` or `"abort"`.]
  [93658]
- [Stabilize `#[cfg(target_has_atomic = "...")]` for each integer
  size and `"ptr"`.][93824]

Compiler
--------
- [Enable combining `+crt-static` and `relocation-model=pic` on
  `x86_64-unknown-linux-gnu`][86374]
- [Fixes wrong `unreachable_pub` lints on nested and glob public
  reexport][87487]
- [Stabilize `-Z instrument-coverage` as `-C instrument-coverage`][90132]
- [Stabilize `-Z print-link-args` as `--print link-args`][91606]
- [Add new Tier 3 target `mips64-openwrt-linux-musl`\*][92300]
- [Add new Tier 3 target `armv7-unknown-linux-uclibceabi` (softfloat)\*][92383]
- [Fix invalid removal of newlines from doc comments][92357]
- [Add kernel target for RustyHermit][92670]
- [Deny mixing bin crate type with lib crate types][92933]
- [Make rustc use `RUST_BACKTRACE=full` by default][93566]
- [Upgrade to LLVM 14][93577]

\* Refer to Rust's [platform support page][platform-support-doc] for more
   information on Rust's tiered platform support.

Libraries
---------
- [Guarantee call order for `sort_by_cached_key`][89621]
- [Improve `Duration::try_from_secs_f32`/`f64` accuracy by directly
  processing exponent and mantissa][90247]
- [Make `Instant::{duration_since, elapsed, sub}` saturating][89926]
- [Remove non-monotonic clocks workarounds in `Instant::now`][89926]
- [Make `BuildHasherDefault`, `iter::Empty` and `future::Pending`
  covariant][92630]

Stabilized APIs
---------------
- [`Arc::new_cyclic`][arc_new_cyclic]
- [`Rc::new_cyclic`][rc_new_cyclic]
- [`slice::EscapeAscii`][slice_escape_ascii]
- [`<[u8]>::escape_ascii`][slice_u8_escape_ascii]
- [`u8::escape_ascii`][u8_escape_ascii]
- [`Vec::spare_capacity_mut`][vec_spare_capacity_mut]
- [`MaybeUninit::assume_init_drop`][assume_init_drop]
- [`MaybeUninit::assume_init_read`][assume_init_read]
- [`i8::abs_diff`][i8_abs_diff]
- [`i16::abs_diff`][i16_abs_diff]
- [`i32::abs_diff`][i32_abs_diff]
- [`i64::abs_diff`][i64_abs_diff]
- [`i128::abs_diff`][i128_abs_diff]
- [`isize::abs_diff`][isize_abs_diff]
- [`u8::abs_diff`][u8_abs_diff]
- [`u16::abs_diff`][u16_abs_diff]
- [`u32::abs_diff`][u32_abs_diff]
- [`u64::abs_diff`][u64_abs_diff]
- [`u128::abs_diff`][u128_abs_diff]
- [`usize::abs_diff`][usize_abs_diff]
- [`Display for io::ErrorKind`][display_error_kind]
- [`From<u8> for ExitCode`][from_u8_exit_code]
- [`Not for !` (the "never" type)][not_never]
- [_Op_`Assign<$t> for Wrapping<$t>`][wrapping_assign_ops]
- [`arch::is_aarch64_feature_detected!`][is_aarch64_feature_detected]

Cargo
-----
- [Port cargo from `toml-rs` to `toml_edit`][cargo/10086]
- [Stabilize `-Ztimings` as `--timings`][cargo/10245]
- [Stabilize namespaced and weak dependency features.][cargo/10269]
- [Accept more `cargo:rustc-link-arg-*` types from build script
  output.][cargo/10274]
- [cargo-new should not add ignore rule on Cargo.lock inside
  subdirs][cargo/10379]

Misc
----
- [Ship docs on Tier 2 platforms by reusing the closest Tier 1
  platform docs][92800]
- [Drop rustc-docs from complete profile][93742]
- [bootstrap: tidy up flag handling for llvm build][93918]

Compatibility Notes
-------------------
- [Remove compiler-rt linking hack on Android][83822]
- [Mitigations for platforms with non-monotonic clocks have been removed from
  `Instant::now`][89926]. On platforms that don't provide monotonic clocks, an
  instant is not guaranteed to be greater than an earlier instant anymore.
- [`Instant::{duration_since, elapsed, sub}` do not panic anymore on underflow,
  saturating to `0` instead][89926]. In the real world the panic happened mostly
  on platforms with buggy monotonic clock implementations rather than catching
  programming errors like reversing the start and end times. Such programming
  errors will now results in `0` rather than a panic.
- In a future release we're planning to increase the baseline requirements for
  the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love
  your feedback in [PR #95026][95026].

Internal Changes
----------------

These changes provide no direct user facing benefits, but represent
significant improvements to the internals and overall performance
of rustc and related tools.

- [Switch all libraries to the 2021 edition][92068]

[83822]: rust-lang/rust#83822
[86374]: rust-lang/rust#86374
[87487]: rust-lang/rust#87487
[89621]: rust-lang/rust#89621
[89926]: rust-lang/rust#89926
[90132]: rust-lang/rust#90132
[90247]: rust-lang/rust#90247
[91606]: rust-lang/rust#91606
[92068]: rust-lang/rust#92068
[92300]: rust-lang/rust#92300
[92357]: rust-lang/rust#92357
[92383]: rust-lang/rust#92383
[92630]: rust-lang/rust#92630
[92670]: rust-lang/rust#92670
[92800]: rust-lang/rust#92800
[92933]: rust-lang/rust#92933
[93566]: rust-lang/rust#93566
[93577]: rust-lang/rust#93577
[93658]: rust-lang/rust#93658
[93742]: rust-lang/rust#93742
[93824]: rust-lang/rust#93824
[93918]: rust-lang/rust#93918
[95026]: rust-lang/rust#95026

[cargo/10086]: rust-lang/cargo#10086
[cargo/10245]: rust-lang/cargo#10245
[cargo/10269]: rust-lang/cargo#10269
[cargo/10274]: rust-lang/cargo#10274
[cargo/10379]: rust-lang/cargo#10379

[arc_new_cyclic]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_cyclic
[rc_new_cyclic]: https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_cyclic
[slice_escape_ascii]: https://doc.rust-lang.org/stable/std/slice/struct.EscapeAscii.html
[slice_u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.escape_ascii
[u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.escape_ascii
[vec_spare_capacity_mut]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.spare_capacity_mut
[assume_init_drop]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_drop
[assume_init_read]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_read
[i8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.abs_diff
[i16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.abs_diff
[i32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.abs_diff
[i64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.abs_diff
[i128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.abs_diff
[isize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.abs_diff
[u8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.abs_diff
[u16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.abs_diff
[u32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.abs_diff
[u64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.abs_diff
[u128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.abs_diff
[usize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.abs_diff
[display_error_kind]: https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#impl-Display
[from_u8_exit_code]: https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html#impl-From%3Cu8%3E
[not_never]: https://doc.rust-lang.org/stable/std/primitive.never.html#impl-Not
[wrapping_assign_ops]: https://doc.rust-lang.org/stable/std/num/struct.Wrapping.html#trait-implementations
[is_aarch64_feature_detected]: https://doc.rust-lang.org/stable/std/arch/macro.is_aarch64_feature_detected.html
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 25, 2022
Pkgsrc changes:
 * Bump available bootstraps to 1.59.0.
 * Adjust line number in patches which had non-zero offsets.

Upstream changes:

Version 1.60.0 (2022-04-07)
===========================

Language
--------
- [Stabilize `#[cfg(panic = "...")]` for either `"unwind"` or `"abort"`.]
  [93658]
- [Stabilize `#[cfg(target_has_atomic = "...")]` for each integer
  size and `"ptr"`.][93824]

Compiler
--------
- [Enable combining `+crt-static` and `relocation-model=pic` on
  `x86_64-unknown-linux-gnu`][86374]
- [Fixes wrong `unreachable_pub` lints on nested and glob public
  reexport][87487]
- [Stabilize `-Z instrument-coverage` as `-C instrument-coverage`][90132]
- [Stabilize `-Z print-link-args` as `--print link-args`][91606]
- [Add new Tier 3 target `mips64-openwrt-linux-musl`\*][92300]
- [Add new Tier 3 target `armv7-unknown-linux-uclibceabi` (softfloat)\*][92383]
- [Fix invalid removal of newlines from doc comments][92357]
- [Add kernel target for RustyHermit][92670]
- [Deny mixing bin crate type with lib crate types][92933]
- [Make rustc use `RUST_BACKTRACE=full` by default][93566]
- [Upgrade to LLVM 14][93577]

\* Refer to Rust's [platform support page][platform-support-doc] for more
   information on Rust's tiered platform support.

Libraries
---------
- [Guarantee call order for `sort_by_cached_key`][89621]
- [Improve `Duration::try_from_secs_f32`/`f64` accuracy by directly
  processing exponent and mantissa][90247]
- [Make `Instant::{duration_since, elapsed, sub}` saturating][89926]
- [Remove non-monotonic clocks workarounds in `Instant::now`][89926]
- [Make `BuildHasherDefault`, `iter::Empty` and `future::Pending`
  covariant][92630]

Stabilized APIs
---------------
- [`Arc::new_cyclic`][arc_new_cyclic]
- [`Rc::new_cyclic`][rc_new_cyclic]
- [`slice::EscapeAscii`][slice_escape_ascii]
- [`<[u8]>::escape_ascii`][slice_u8_escape_ascii]
- [`u8::escape_ascii`][u8_escape_ascii]
- [`Vec::spare_capacity_mut`][vec_spare_capacity_mut]
- [`MaybeUninit::assume_init_drop`][assume_init_drop]
- [`MaybeUninit::assume_init_read`][assume_init_read]
- [`i8::abs_diff`][i8_abs_diff]
- [`i16::abs_diff`][i16_abs_diff]
- [`i32::abs_diff`][i32_abs_diff]
- [`i64::abs_diff`][i64_abs_diff]
- [`i128::abs_diff`][i128_abs_diff]
- [`isize::abs_diff`][isize_abs_diff]
- [`u8::abs_diff`][u8_abs_diff]
- [`u16::abs_diff`][u16_abs_diff]
- [`u32::abs_diff`][u32_abs_diff]
- [`u64::abs_diff`][u64_abs_diff]
- [`u128::abs_diff`][u128_abs_diff]
- [`usize::abs_diff`][usize_abs_diff]
- [`Display for io::ErrorKind`][display_error_kind]
- [`From<u8> for ExitCode`][from_u8_exit_code]
- [`Not for !` (the "never" type)][not_never]
- [_Op_`Assign<$t> for Wrapping<$t>`][wrapping_assign_ops]
- [`arch::is_aarch64_feature_detected!`][is_aarch64_feature_detected]

Cargo
-----
- [Port cargo from `toml-rs` to `toml_edit`][cargo/10086]
- [Stabilize `-Ztimings` as `--timings`][cargo/10245]
- [Stabilize namespaced and weak dependency features.][cargo/10269]
- [Accept more `cargo:rustc-link-arg-*` types from build script
  output.][cargo/10274]
- [cargo-new should not add ignore rule on Cargo.lock inside
  subdirs][cargo/10379]

Misc
----
- [Ship docs on Tier 2 platforms by reusing the closest Tier 1
  platform docs][92800]
- [Drop rustc-docs from complete profile][93742]
- [bootstrap: tidy up flag handling for llvm build][93918]

Compatibility Notes
-------------------
- [Remove compiler-rt linking hack on Android][83822]
- [Mitigations for platforms with non-monotonic clocks have been removed from
  `Instant::now`][89926]. On platforms that don't provide monotonic clocks, an
  instant is not guaranteed to be greater than an earlier instant anymore.
- [`Instant::{duration_since, elapsed, sub}` do not panic anymore on underflow,
  saturating to `0` instead][89926]. In the real world the panic happened mostly
  on platforms with buggy monotonic clock implementations rather than catching
  programming errors like reversing the start and end times. Such programming
  errors will now results in `0` rather than a panic.
- In a future release we're planning to increase the baseline requirements for
  the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love
  your feedback in [PR #95026][95026].

Internal Changes
----------------

These changes provide no direct user facing benefits, but represent
significant improvements to the internals and overall performance
of rustc and related tools.

- [Switch all libraries to the 2021 edition][92068]

[83822]: rust-lang/rust#83822
[86374]: rust-lang/rust#86374
[87487]: rust-lang/rust#87487
[89621]: rust-lang/rust#89621
[89926]: rust-lang/rust#89926
[90132]: rust-lang/rust#90132
[90247]: rust-lang/rust#90247
[91606]: rust-lang/rust#91606
[92068]: rust-lang/rust#92068
[92300]: rust-lang/rust#92300
[92357]: rust-lang/rust#92357
[92383]: rust-lang/rust#92383
[92630]: rust-lang/rust#92630
[92670]: rust-lang/rust#92670
[92800]: rust-lang/rust#92800
[92933]: rust-lang/rust#92933
[93566]: rust-lang/rust#93566
[93577]: rust-lang/rust#93577
[93658]: rust-lang/rust#93658
[93742]: rust-lang/rust#93742
[93824]: rust-lang/rust#93824
[93918]: rust-lang/rust#93918
[95026]: rust-lang/rust#95026

[cargo/10086]: rust-lang/cargo#10086
[cargo/10245]: rust-lang/cargo#10245
[cargo/10269]: rust-lang/cargo#10269
[cargo/10274]: rust-lang/cargo#10274
[cargo/10379]: rust-lang/cargo#10379

[arc_new_cyclic]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_cyclic
[rc_new_cyclic]: https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_cyclic
[slice_escape_ascii]: https://doc.rust-lang.org/stable/std/slice/struct.EscapeAscii.html
[slice_u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.escape_ascii
[u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.escape_ascii
[vec_spare_capacity_mut]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.spare_capacity_mut
[assume_init_drop]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_drop
[assume_init_read]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_read
[i8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.abs_diff
[i16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.abs_diff
[i32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.abs_diff
[i64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.abs_diff
[i128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.abs_diff
[isize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.abs_diff
[u8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.abs_diff
[u16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.abs_diff
[u32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.abs_diff
[u64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.abs_diff
[u128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.abs_diff
[usize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.abs_diff
[display_error_kind]: https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#impl-Display
[from_u8_exit_code]: https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html#impl-From%3Cu8%3E
[not_never]: https://doc.rust-lang.org/stable/std/primitive.never.html#impl-Not
[wrapping_assign_ops]: https://doc.rust-lang.org/stable/std/num/struct.Wrapping.html#trait-implementations
[is_aarch64_feature_detected]: https://doc.rust-lang.org/stable/std/arch/macro.is_aarch64_feature_detected.html
epage added a commit to epage/toml_edit that referenced this pull request Sep 23, 2022
`toml_edit` won't be able to support these.  For example,
cargo moved away from these in rust-lang/cargo#9932 to prepare for
rust-lang/cargo#10086
epage added a commit to epage/toml_edit that referenced this pull request Sep 23, 2022
`toml_edit` won't be able to support these.  For example,
cargo moved away from these in rust-lang/cargo#9932 to prepare for
rust-lang/cargo#10086

This is prep for toml-rs#340
epage added a commit to epage/toml_edit that referenced this pull request Dec 14, 2022
`toml_edit` won't be able to support these.  For example,
cargo moved away from these in rust-lang/cargo#9932 to prepare for
rust-lang/cargo#10086

This is prep for toml-rs#340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge FCP with intent to merge finished-final-comment-period FCP complete S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-cargo Team: Cargo to-announce
Projects
None yet
Development

Successfully merging this pull request may close these issues.