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

Implement version of normalize_erasing_regions that allows for normalization failure #91255

Merged
merged 7 commits into from Dec 1, 2021

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Nov 26, 2021

Fixes #59324
Fixes #67684
Fixes #69398
Fixes #71113
Fixes #82079
Fixes #85103
Fixes #88856
Fixes #91231
Fixes #91234

Previously we called normalize_erasing_regions inside layout_of. normalize_erasing_regions assumes that the normalization succeeds. Since some layout_of calls happen before typecheck has finished, we introduce a new variant that allows for returning an error.

@rust-highfive
Copy link
Collaborator

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(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 26, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Nov 26, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 26, 2021
@bors
Copy link
Contributor

bors commented Nov 26, 2021

⌛ Trying commit 11f105cd6e9635ae233a61121bdf330f1b040582 with merge 7cd727ea460dd27fc8f52e430e9cd2301eec1439...

@rust-log-analyzer

This comment has been minimized.

@@ -493,7 +493,7 @@ impl dyn MachineStopType {
}

#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(InterpError<'_>, 64);
static_assert_size!(InterpError<'_>, 88);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even care about the size of this type? We care about InterpErrorInfo but that is a Box so it is independent of the size of InterpError.

So I think I would favor removing this assertion, it might just lead someone to unnecessarily introduce another unnecessary Box indirection.

@jackh726
Copy link
Member

This is great :) does this fix the test in #82039?

@camelid
Copy link
Member

camelid commented Nov 26, 2021

Does this fix #91231 as well, since it's very similar to #91234 (which this is marked as fixing)?

query try_normalize_generic_arg_after_erasing_regions(
goal: ParamEnvAnd<'tcx, GenericArg<'tcx>>
) -> Result<GenericArg<'tcx>, NoSolution> {
desc { "trying to normalize `{}`", goal.value }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just make these two "normalizing {}", so the error outputs are nicer

@@ -208,16 +210,24 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> {
LayoutError::SizeOverflow(ty) => {
write!(f, "values of the type `{}` are too big for the current architecture", ty)
}
LayoutError::NormalizationFailure(t, e) => write!(
f,
"unable to determine layout for `{}` because `{}` cannot be normalized",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is never actually emitted? Makes me wonder if we actually need to keep track of what we couldn't normalize.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I noticed that too and was debating whether we need the type, but think that it makes sense to output the type for which normalization fails here. There are a couple other issues which triggered this ICE (but not through layout_of and which have yet to be fixed (although I think the new function would make that fairly straightforward)), and we might need this type information there.

I also added another test for issue 85103 which emits this error.

@@ -229,7 +239,14 @@ fn layout_of<'tcx>(
ty::tls::enter_context(&icx, |_| {
let param_env = param_env.with_reveal_all_normalized(tcx);
let unnormalized_ty = ty;
let ty = tcx.normalize_erasing_regions(param_env, ty);

let ty = match tcx.try_normalize_erasing_regions(param_env, ty) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this deserves a comment on why failing to fully normalize is valid here. I would potentially imagine that by the time we need to know layout, we should have all the information to normalize (though I'm not sure, this might not be true)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to have two different versions of layout_of. Currently most of the calls of that function happen after typecheck and normalization is always guaranteed to succeed, but there are some calls in typecheck and some lints that use it. Does it makes sense to have one version which requires normalization to succeed and another in which it can fail?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good question! In #82039, IIRC we were basically coming to the conclusion that we shouldn't be trying to get the layout of things until after typechecking. So, I think splitting out layout_of into two version is a decent intermediate step to "audit", in some way, incorrect behavior.

I think this would be better as a followup. Can you add a FIXME or file an issue?

@camelid
Copy link
Member

camelid commented Nov 26, 2021

Does this fix #85103? (cc #85485)

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 26, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 26, 2021
@camelid
Copy link
Member

camelid commented Nov 26, 2021

You'll need to update rustdoc:

error[E0004]: non-exhaustive patterns: `Err(NormalizationFailure(_, _))` not covered
681
    --> src/librustdoc/html/render/print_item.rs:1705:11
682
     |
683
1705 |     match tcx.layout_of(param_env.and(ty)) {
684
     |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Err(NormalizationFailure(_, _))` not covered
685
     |
686
    ::: /checkout/library/core/src/result.rs:512:5
687
     |
688
512  |     Err(#[stable(feature = "rust1", since = "1.0.0")] E),
689
     |     --- not covered
690
     |
691
     = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
692
     = note: the matched value is of type `Result<TyAndLayout<&TyS>, rustc_middle::ty::layout::LayoutError>`
693

@b-naber
Copy link
Contributor Author

b-naber commented Nov 26, 2021

@jackh726 The test in #82039 is not fixed by this, since I only used try_normalize_erasing_regions in layout_of. There are a couple of other calls of normalize_erasing_regions which are used before normalization is guaranteed to succeed. I can change those to use this new function.

@camelid The two issues you mentioned are fixed by this PR, added tests.

@b-naber
Copy link
Contributor Author

b-naber commented Nov 26, 2021

Can anybody request another another timer run once CI passes, please?

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 26, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Nov 26, 2021

⌛ Trying commit ce0e6f8c86311589ecc6df277b37bbe236e0e8ca with merge 3393f73e33f01001d1dbe2362ae0d7311dba2447...

@camelid camelid added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 26, 2021
@b-naber
Copy link
Contributor Author

b-naber commented Dec 1, 2021

@bors r=jackh276

@bors
Copy link
Contributor

bors commented Dec 1, 2021

📌 Commit 6952470 has been approved by jackh276

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 1, 2021
@bors
Copy link
Contributor

bors commented Dec 1, 2021

⌛ Testing commit 6952470 with merge f04a2f4...

@bors
Copy link
Contributor

bors commented Dec 1, 2021

☀️ Test successful - checks-actions
Approved by: jackh276
Pushing f04a2f4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 1, 2021
@bors bors merged commit f04a2f4 into rust-lang:master Dec 1, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 1, 2021
@jyn514
Copy link
Member

jyn514 commented Dec 1, 2021

Ooh, I wonder if this could be used for #82692 :)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f04a2f4): comparison url.

Summary: This change led to small relevant regressions 😿 in compiler performance.

  • Small regression in instruction counts (up to 0.9% on incr-full builds of ctfe-stress-4)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 1, 2021
Add tests for `normalize-docs` overflow errors

`@b-naber` do you understand why using `try_normalize_erasing_regions` doesn't silence these cycle errors? Rustdoc isn't emitting them, rustc is aborting before returning an error, even though the function has `try_` in the name.

cc rust-lang#82692, rust-lang#91255
@b-naber b-naber deleted the normalization-ice branch December 2, 2021 09:16
@rylev
Copy link
Member

rylev commented Dec 7, 2021

@b-naber @jackh726 as you can see this PR yielded some performance regressions (albeit not huge ones and mostly in stress tests. Looking at the self profiling info, nothing jumped out at me. A run of cachegrind may be in order, but I unfortunately don't have time to do that right now. Any thoughts on potential causes of the regressions?

@b-naber
Copy link
Contributor Author

b-naber commented Dec 7, 2021

@rylev performance regression might be due to the fact that we don't cache normalize_erasing_regions queries in functions that now use th try version. We might be able to improve this by implementing normalize_erasing_regions in terms of try_normalize_erasing_regions. I can implement this tomorrow.

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 17, 2021
…ns-queries, r=jackh726

Implement normalize_erasing_regions queries in terms of 'try' version

Attempt to lessen performance regression caused by rust-lang#91255

r? `@jackh726`
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Jan 22, 2022
Pkgsrc changes:
 * Bump available bootstraps to 1.57.0.
 * For some reason, the vendor/libc checksums don't need fixing.
 * Bump required external LLVM to 12.0, according to upstream change log.
 * Adapt the Darwin linker patch.

(For some reason I've not figured out yet, cargo is a lot more
verbose while building, echoes the rustc invocation.)

Upstream changes:

Version 1.58.1 (2022-01-19)
===========================

* Fix race condition in `std::fs::remove_dir_all` ([CVE-2022-21658])
* [Handle captured arguments in the `useless_format` Clippy lint][clippy/8295]
* [Move `non_send_fields_in_send_ty` Clippy lint to nursery][clippy/8075]
* [Fix wrong error message displayed when some imports are missing][91254]
* [Fix rustfmt not formatting generated files from stdin][92912]

[CVE-2022-21658]: https://www.cve.org/CVERecord?id=CVE-2022-21658]
[91254]: rust-lang/rust#91254
[92912]: rust-lang/rust#92912
[clippy/8075]: rust-lang/rust-clippy#8075
[clippy/8295]: rust-lang/rust-clippy#8295

Version 1.58.0 (2022-01-13)
==========================

Language
--------

- [Format strings can now capture arguments simply by writing
  `{ident}` in the string.][90473] This works in all macros accepting
  format strings. Support for this in `panic!` (`panic!("{ident}")`)
  requires the 2021 edition; panic invocations in previous editions
  that appear to be trying to use this will result in a warning lint
  about not having the intended effect.
- [`*const T` pointers can now be dereferenced in const contexts.][89551]
- [The rules for when a generic struct implements `Unsize` have
  been relaxed.][90417]

Compiler
--------

- [Add LLVM CFI support to the Rust compiler][89652]
- [Stabilize -Z strip as -C strip][90058]. Note that while release
  builds already don't add debug symbols for the code you compile,
  the compiled standard library that ships with Rust includes debug
  symbols, so you may want to use the `strip` option to remove these
  symbols to produce smaller release binaries. Note that this release
  only includes support in rustc, not directly in cargo.
- [Add support for LLVM coverage mapping format versions 5 and 6][91207]
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
- [Update the minimum external LLVM to 12][90175]
- [Add `x86_64-unknown-none` at Tier 3*][89062]
- [Build musl dist artifacts with debuginfo enabled][90733]. When
  building release binaries using musl, you may want to use the newly
  stabilized strip option to remove these debug symbols, reducing
  the size of your binaries.
- [Don't abort compilation after giving a lint error][87337]
- [Error messages point at the source of trait bound obligations
  in more places][89580]

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

Libraries
---------

- [All remaining functions in the standard library have `#[must_use]`
  annotations where appropriate][89692], producing a warning when
  ignoring their return value. This helps catch mistakes such as
  expecting a function to mutate a value in place rather than return
  a new value.
- [Paths are automatically canonicalized on Windows for operations
  that support it][89174]
- [Re-enable debug checks for `copy` and `copy_nonoverlapping`][90041]
- [Implement `RefUnwindSafe` for `Rc<T>`][87467]
- [Make RSplit<T, P>: Clone not require T: Clone][90117]
- [Implement `Termination` for `Result<Infallible, E>`][88601].
  This allows writing `fn main() -> Result<Infallible, ErrorType>`,
  for a program whose successful exits never involve returning from
  `main` (for instance, a program that calls `exit`, or that uses
  `exec` to run another program).

Stabilized APIs
---------------

- [`Metadata::is_symlink`]
- [`Path::is_symlink`]
- [`{integer}::saturating_div`]
- [`Option::unwrap_unchecked`]
- [`Result::unwrap_unchecked`]
- [`Result::unwrap_err_unchecked`]
- [`NonZero{unsigned}::is_power_of_two`]
- [`File::options`]

These APIs are now usable in const contexts:

- [`Duration::new`]
- [`Duration::checked_add`]
- [`Duration::saturating_add`]
- [`Duration::checked_sub`]
- [`Duration::saturating_sub`]
- [`Duration::checked_mul`]
- [`Duration::saturating_mul`]
- [`Duration::checked_div`]
- [`MaybeUninit::as_ptr`]
- [`MaybeUninit::as_mut_ptr`]
- [`MaybeUninit::assume_init`]
- [`MaybeUninit::assume_init_ref`]

Cargo
-----

- [Add --message-format for install command][cargo/10107]
- [Warn when alias shadows external subcommand][cargo/10082]

Rustdoc
-------

- [Show all Deref implementations recursively in rustdoc][90183]
- [Use computed visibility in rustdoc][88447]

Compatibility Notes
-------------------

- [Try all stable method candidates first before trying unstable
  ones][90329]. This change ensures that adding new nightly-only
  methods to the Rust standard library will not break code invoking
  methods of the same name from traits outside the standard library.
- Windows: [`std::process::Command` will no longer search the
  current directory for executables.][87704]
- [All proc-macro backward-compatibility lints are now deny-by-default.][88041]
- [proc_macro: Append .0 to unsuffixed float if it would otherwise
  become int token][90297]
- [Refactor weak symbols in std::sys::unix][90846]. This optimizes
  accesses to glibc functions, by avoiding the use of dlopen. This
  does not increase the [minimum expected version of
  glibc](https://doc.rust-lang.org/nightly/rustc/platform-support.html).
  However, software distributions that use symbol versions to detect
  library dependencies, and which take weak symbols into account in
  that analysis, may detect rust binaries as requiring newer versions
  of glibc.
- [rustdoc now rejects some unexpected semicolons in doctests][91026]

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.

- [Implement coherence checks for negative trait impls][90104]
- [Add rustc lint, warning when iterating over hashmaps][89558]
- [Optimize live point computation][90491]
- [Enable verification for 1/32nd of queries loaded from disk][90361]
- [Implement version of normalize_erasing_regions that allows for
  normalization failure][91255]

[87337]: rust-lang/rust#87337
[87467]: rust-lang/rust#87467
[87704]: rust-lang/rust#87704
[88041]: rust-lang/rust#88041
[88300]: rust-lang/rust#88300
[88447]: rust-lang/rust#88447
[88601]: rust-lang/rust#88601
[88624]: rust-lang/rust#88624
[89062]: rust-lang/rust#89062
[89174]: rust-lang/rust#89174
[89542]: rust-lang/rust#89542
[89551]: rust-lang/rust#89551
[89558]: rust-lang/rust#89558
[89580]: rust-lang/rust#89580
[89652]: rust-lang/rust#89652
[89677]: rust-lang/rust#89677
[89951]: rust-lang/rust#89951
[90041]: rust-lang/rust#90041
[90058]: rust-lang/rust#90058
[90104]: rust-lang/rust#90104
[90117]: rust-lang/rust#90117
[90175]: rust-lang/rust#90175
[90183]: rust-lang/rust#90183
[90297]: rust-lang/rust#90297
[90329]: rust-lang/rust#90329
[90361]: rust-lang/rust#90361
[90417]: rust-lang/rust#90417
[90473]: rust-lang/rust#90473
[90491]: rust-lang/rust#90491
[90733]: rust-lang/rust#90733
[90833]: rust-lang/rust#90833
[90846]: rust-lang/rust#90846
[90896]: rust-lang/rust#90896
[91026]: rust-lang/rust#91026
[91207]: rust-lang/rust#91207
[91255]: rust-lang/rust#91255
[91301]: rust-lang/rust#91301
[cargo/10082]: rust-lang/cargo#10082
[cargo/10107]: rust-lang/cargo#10107
[`Metadata::is_symlink`]: https://doc.rust-lang.org/stable/std/fs/struct.Metadata.html#method.is_symlink
[`Path::is_symlink`]: https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_symlink
[`{integer}::saturating_div`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.saturating_div
[`Option::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unwrap_unchecked
[`Result::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_unchecked
[`Result::unwrap_err_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_err_unchecked
[`NonZero{unsigned}::is_power_of_two`]: https://doc.rust-lang.org/stable/std/num/struct.NonZeroU8.html#method.is_power_of_two
[`File::options`]: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.options
[`unix::process::ExitStatusExt::core_dumped`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.core_dumped
[`unix::process::ExitStatusExt::stopped_signal`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.stopped_signal
[`unix::process::ExitStatusExt::continued`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.continued
[`unix::process::ExitStatusExt::into_raw`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.into_raw
[`Duration::new`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.new
[`Duration::checked_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_add
[`Duration::saturating_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_add
[`Duration::checked_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_sub
[`Duration::saturating_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_sub
[`Duration::checked_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_mul
[`Duration::saturating_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_mul
[`Duration::checked_div`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_div
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f64
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f32
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f64
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f32
[`Duration::mul_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f64
[`Duration::mul_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f32
[`Duration::div_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f64
[`Duration::div_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f32
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f64
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f32
[`MaybeUninit::as_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
[`MaybeUninit::as_mut_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_mut_ptr
[`MaybeUninit::assume_init`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
[`MaybeUninit::assume_init_ref`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 1, 2022
Pkgsrc changes:
 * Bump bootstrap kit version to 1.57.0.
 * Bump require external LLVM to 12.0, according to upstream change log.
 * Adjust patches as needed, adjust line numbers.
 * Update checksum adjustments.  For some reason the vendor/libc checksum
   doesn't need fixing, apparently, it remains as commented out.
 * Add makefile to do all the NetBSD boostrap/cross builds (do-cross.mk).
   Allow passing in additions to CONFIGURE_ARGS via ADD_CONFIGURE_ARGS.

Upstream changes:

Version 1.58.1 (2022-01-19)
===========================

* Fix race condition in `std::fs::remove_dir_all` ([CVE-2022-21658])
* [Handle captured arguments in the `useless_format` Clippy lint][clippy/8295]
* [Move `non_send_fields_in_send_ty` Clippy lint to nursery][clippy/8075]
* [Fix wrong error message displayed when some imports are missing][91254]
* [Fix rustfmt not formatting generated files from stdin][92912]

[CVE-2022-21658]: https://www.cve.org/CVERecord?id=CVE-2022-21658]
[91254]: rust-lang/rust#91254
[92912]: rust-lang/rust#92912
[clippy/8075]: rust-lang/rust-clippy#8075
[clippy/8295]: rust-lang/rust-clippy#8295

Version 1.58.0 (2022-01-13)
==========================

Language
--------

- [Format strings can now capture arguments simply by writing
  `{ident}` in the string.][90473] This works in all macros accepting
  format strings. Support for this in `panic!` (`panic!("{ident}")`)
  requires the 2021 edition; panic invocations in previous editions
  that appear to be trying to use this will result in a warning lint
  about not having the intended effect.
- [`*const T` pointers can now be dereferenced in const contexts.][89551]
- [The rules for when a generic struct implements `Unsize` have
  been relaxed.][90417]

Compiler
--------

- [Add LLVM CFI support to the Rust compiler][89652]
- [Stabilize -Z strip as -C strip][90058]. Note that while release
  builds already don't add debug symbols for the code you compile,
  the compiled standard library that ships with Rust includes debug
  symbols, so you may want to use the `strip` option to remove these
  symbols to produce smaller release binaries. Note that this release
  only includes support in rustc, not directly in cargo.
- [Add support for LLVM coverage mapping format versions 5 and 6][91207]
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
- [Update the minimum external LLVM to 12][90175]
- [Add `x86_64-unknown-none` at Tier 3*][89062]
- [Build musl dist artifacts with debuginfo enabled][90733]. When
  building release binaries using musl, you may want to use the newly
  stabilized strip option to remove these debug symbols, reducing
  the size of your binaries.
- [Don't abort compilation after giving a lint error][87337]
- [Error messages point at the source of trait bound obligations
  in more places][89580]

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

Libraries
---------

- [All remaining functions in the standard library have `#[must_use]`
  annotations where appropriate][89692], producing a warning when
  ignoring their return value. This helps catch mistakes such as
  expecting a function to mutate a value in place rather than return
  a new value.
- [Paths are automatically canonicalized on Windows for operations
  that support it][89174]
- [Re-enable debug checks for `copy` and `copy_nonoverlapping`][90041]
- [Implement `RefUnwindSafe` for `Rc<T>`][87467]
- [Make RSplit<T, P>: Clone not require T: Clone][90117]
- [Implement `Termination` for `Result<Infallible, E>`][88601].
  This allows writing `fn main() -> Result<Infallible, ErrorType>`,
  for a program whose successful exits never involve returning from
  `main` (for instance, a program that calls `exit`, or that uses
  `exec` to run another program).

Stabilized APIs
---------------

- [`Metadata::is_symlink`]
- [`Path::is_symlink`]
- [`{integer}::saturating_div`]
- [`Option::unwrap_unchecked`]
- [`Result::unwrap_unchecked`]
- [`Result::unwrap_err_unchecked`]
- [`NonZero{unsigned}::is_power_of_two`]
- [`File::options`]

These APIs are now usable in const contexts:

- [`Duration::new`]
- [`Duration::checked_add`]
- [`Duration::saturating_add`]
- [`Duration::checked_sub`]
- [`Duration::saturating_sub`]
- [`Duration::checked_mul`]
- [`Duration::saturating_mul`]
- [`Duration::checked_div`]
- [`MaybeUninit::as_ptr`]
- [`MaybeUninit::as_mut_ptr`]
- [`MaybeUninit::assume_init`]
- [`MaybeUninit::assume_init_ref`]

Cargo
-----

- [Add --message-format for install command][cargo/10107]
- [Warn when alias shadows external subcommand][cargo/10082]

Rustdoc
-------

- [Show all Deref implementations recursively in rustdoc][90183]
- [Use computed visibility in rustdoc][88447]

Compatibility Notes
-------------------

- [Try all stable method candidates first before trying unstable
  ones][90329]. This change ensures that adding new nightly-only
  methods to the Rust standard library will not break code invoking
  methods of the same name from traits outside the standard library.
- Windows: [`std::process::Command` will no longer search the
  current directory for executables.][87704]
- [All proc-macro backward-compatibility lints are now deny-by-default.][88041]
- [proc_macro: Append .0 to unsuffixed float if it would otherwise
  become int token][90297]
- [Refactor weak symbols in std::sys::unix][90846]. This optimizes
  accesses to glibc functions, by avoiding the use of dlopen. This
  does not increase the [minimum expected version of
  glibc](https://doc.rust-lang.org/nightly/rustc/platform-support.html).
  However, software distributions that use symbol versions to detect
  library dependencies, and which take weak symbols into account in
  that analysis, may detect rust binaries as requiring newer versions
  of glibc.
- [rustdoc now rejects some unexpected semicolons in doctests][91026]

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.

- [Implement coherence checks for negative trait impls][90104]
- [Add rustc lint, warning when iterating over hashmaps][89558]
- [Optimize live point computation][90491]
- [Enable verification for 1/32nd of queries loaded from disk][90361]
- [Implement version of normalize_erasing_regions that allows for
  normalization failure][91255]

[87337]: rust-lang/rust#87337
[87467]: rust-lang/rust#87467
[87704]: rust-lang/rust#87704
[88041]: rust-lang/rust#88041
[88300]: rust-lang/rust#88300
[88447]: rust-lang/rust#88447
[88601]: rust-lang/rust#88601
[88624]: rust-lang/rust#88624
[89062]: rust-lang/rust#89062
[89174]: rust-lang/rust#89174
[89542]: rust-lang/rust#89542
[89551]: rust-lang/rust#89551
[89558]: rust-lang/rust#89558
[89580]: rust-lang/rust#89580
[89652]: rust-lang/rust#89652
[89677]: rust-lang/rust#89677
[89951]: rust-lang/rust#89951
[90041]: rust-lang/rust#90041
[90058]: rust-lang/rust#90058
[90104]: rust-lang/rust#90104
[90117]: rust-lang/rust#90117
[90175]: rust-lang/rust#90175
[90183]: rust-lang/rust#90183
[90297]: rust-lang/rust#90297
[90329]: rust-lang/rust#90329
[90361]: rust-lang/rust#90361
[90417]: rust-lang/rust#90417
[90473]: rust-lang/rust#90473
[90491]: rust-lang/rust#90491
[90733]: rust-lang/rust#90733
[90833]: rust-lang/rust#90833
[90846]: rust-lang/rust#90846
[90896]: rust-lang/rust#90896
[91026]: rust-lang/rust#91026
[91207]: rust-lang/rust#91207
[91255]: rust-lang/rust#91255
[91301]: rust-lang/rust#91301
[cargo/10082]: rust-lang/cargo#10082
[cargo/10107]: rust-lang/cargo#10107
[`Metadata::is_symlink`]: https://doc.rust-lang.org/stable/std/fs/struct.Metadata.html#method.is_symlink
[`Path::is_symlink`]: https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_symlink
[`{integer}::saturating_div`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.saturating_div
[`Option::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unwrap_unchecked
[`Result::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_unchecked
[`Result::unwrap_err_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_err_unchecked
[`NonZero{unsigned}::is_power_of_two`]: https://doc.rust-lang.org/stable/std/num/struct.NonZeroU8.html#method.is_power_of_two
[`File::options`]: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.options
[`unix::process::ExitStatusExt::core_dumped`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.core_dumped
[`unix::process::ExitStatusExt::stopped_signal`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.stopped_signal
[`unix::process::ExitStatusExt::continued`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.continued
[`unix::process::ExitStatusExt::into_raw`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.into_raw
[`Duration::new`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.new
[`Duration::checked_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_add
[`Duration::saturating_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_add
[`Duration::checked_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_sub
[`Duration::saturating_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_sub
[`Duration::checked_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_mul
[`Duration::saturating_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_mul
[`Duration::checked_div`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_div
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f64
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f32
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f64
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f32
[`Duration::mul_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f64
[`Duration::mul_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f32
[`Duration::div_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f64
[`Duration::div_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f32
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f64
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f32
[`MaybeUninit::as_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
[`MaybeUninit::as_mut_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_mut_ptr
[`MaybeUninit::assume_init`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
[`MaybeUninit::assume_init_ref`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Mar 2, 2022
Pkgsrc changes:
 * Bump available bootstraps to 1.58.1.
 * Adjust one patch (and checksum) so that it still applies.

Upstream changes:

Version 1.59.0 (2022-02-24)
==========================

Language
--------

- [Stabilize default arguments for const generics][90207]
- [Stabilize destructuring assignment][90521]
- [Relax private in public lint on generic bounds and where clauses
  of trait impls][90586]
- [Stabilize asm! and global_asm! for x86, x86_64, ARM, Aarch64,
  and RISC-V][91728]

Compiler
--------

- [Stabilize new symbol mangling format, leaving it opt-in
  (-Csymbol-mangling-version=v0)][90128]
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
- [Fix sparc64 ABI for aggregates with floating point members][91003]
- [Warn when a `#[test]`-like built-in attribute macro is present
  multiple times.][91172]
- [Add support for riscv64gc-unknown-freebsd][91284]
- [Stabilize `-Z emit-future-incompat` as `--json future-incompat`][91535]
- [Soft disable incremental compilation][94124]

This release disables incremental compilation, unless the user has explicitly
opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
This is due to a known and relatively frequently occurring bug in incremental
compilation, which causes builds to issue internal compiler errors. This
particular bug is already fixed on nightly, but that fix has not yet rolled out
to stable and is deemed too risky for a direct stable backport.

As always, we encourage users to test with nightly and report bugs so that we
can track failures and fix issues earlier.

See [94124] for more details.

[94124]: rust-lang/rust#94124

Libraries
---------

- [Remove unnecessary bounds for some Hash{Map,Set} methods][91593]

Stabilized APIs
---------------

- [`std::thread::available_parallelism`][available_parallelism]
- [`Result::copied`][result-copied]
- [`Result::cloned`][result-cloned]
- [`arch::asm!`][asm]
- [`arch::global_asm!`][global_asm]
- [`ops::ControlFlow::is_break`][is_break]
- [`ops::ControlFlow::is_continue`][is_continue]
- [`TryFrom<char> for u8`][try_from_char_u8]
- [`char::TryFromCharError`][try_from_char_err]
  implementing `Clone`, `Debug`, `Display`, `PartialEq`, `Copy`, `Eq`, `Error`
- [`iter::zip`][zip]
- [`NonZeroU8::is_power_of_two`][is_power_of_two8]
- [`NonZeroU16::is_power_of_two`][is_power_of_two16]
- [`NonZeroU32::is_power_of_two`][is_power_of_two32]
- [`NonZeroU64::is_power_of_two`][is_power_of_two64]
- [`NonZeroU128::is_power_of_two`][is_power_of_two128]
- [`DoubleEndedIterator for ToLowercase`][lowercase]
- [`DoubleEndedIterator for ToUppercase`][uppercase]
- [`TryFrom<&mut [T]> for [T; N]`][tryfrom_ref_arr]
- [`UnwindSafe for Once`][unwindsafe_once]
- [`RefUnwindSafe for Once`][refunwindsafe_once]
- [armv8 neon intrinsics for aarch64][stdarch/1266]

Const-stable:

- [`mem::MaybeUninit::as_ptr`][muninit_ptr]
- [`mem::MaybeUninit::assume_init`][muninit_init]
- [`mem::MaybeUninit::assume_init_ref`][muninit_init_ref]
- [`ffi::CStr::from_bytes_with_nul_unchecked`][cstr_from_bytes]

Cargo
-----

- [Stabilize the `strip` profile option][cargo/10088]
- [Stabilize future-incompat-report][cargo/10165]
- [Support abbreviating `--release` as `-r`][cargo/10133]
- [Support `term.quiet` configuration][cargo/10152]
- [Remove `--host` from cargo {publish,search,login}][cargo/10145]

Compatibility Notes
-------------------

- [Refactor weak symbols in std::sys::unix][90846]
  This may add new, versioned, symbols when building with a newer glibc, as the
  standard library uses weak linkage rather than dynamically attempting to load
  certain symbols at runtime.
- [Deprecate crate_type and crate_name nested inside `#![cfg_attr]`][83744]
  This adds a future compatibility lint to supporting the use of cfg_attr
  wrapping either crate_type or crate_name specification within Rust files;
  it is recommended that users migrate to setting the equivalent command line
  flags.
- [Remove effect of `#[no_link]` attribute on name resolution][92034]
  This may expose new names, leading to conflicts with preexisting names in a
  given namespace and a compilation failure.
- [Cargo will document libraries before binaries.][cargo/10172]
- [Respect doc=false in dependencies, not just the root crate][cargo/10201]
- [Weaken guarantee around advancing underlying iterators in zip][83791]
- [Make split_inclusive() on an empty slice yield an empty output][89825]
- [Update std::env::temp_dir to use GetTempPath2 on Windows when
  available.][89999]
- [unreachable! was updated to match other formatting macro behavior
  on Rust 2021][92137]

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.

- [Fix many cases of normalization-related ICEs][91255]
- [Replace dominators algorithm with simple Lengauer-Tarjan][85013]
- [Store liveness in interval sets for region inference][90637]

- [Remove `in_band_lifetimes` from the compiler and standard library,
  in preparation for removing this unstable feature.][91867]

[91867]: rust-lang/rust#91867
[83744]: rust-lang/rust#83744
[83791]: rust-lang/rust#83791
[85013]: rust-lang/rust#85013
[89825]: rust-lang/rust#89825
[89999]: rust-lang/rust#89999
[90128]: rust-lang/rust#90128
[90207]: rust-lang/rust#90207
[90521]: rust-lang/rust#90521
[90586]: rust-lang/rust#90586
[90637]: rust-lang/rust#90637
[90833]: rust-lang/rust#90833
[90846]: rust-lang/rust#90846
[91003]: rust-lang/rust#91003
[91172]: rust-lang/rust#91172
[91255]: rust-lang/rust#91255
[91284]: rust-lang/rust#91284
[91535]: rust-lang/rust#91535
[91593]: rust-lang/rust#91593
[91728]: rust-lang/rust#91728
[91878]: rust-lang/rust#91878
[91896]: rust-lang/rust#91896
[91926]: rust-lang/rust#91926
[91984]: rust-lang/rust#91984
[92020]: rust-lang/rust#92020
[92034]: rust-lang/rust#92034
[92483]: rust-lang/rust#92483
[cargo/10088]: rust-lang/cargo#10088
[cargo/10133]: rust-lang/cargo#10133
[cargo/10145]: rust-lang/cargo#10145
[cargo/10152]: rust-lang/cargo#10152
[cargo/10165]: rust-lang/cargo#10165
[cargo/10172]: rust-lang/cargo#10172
[cargo/10201]: rust-lang/cargo#10201
[cargo/10269]: rust-lang/cargo#10269

[cstr_from_bytes]: https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.from_bytes_with_nul_unchecked
[muninit_ptr]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
[muninit_init]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
[muninit_init_ref]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref
[unwindsafe_once]: https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-UnwindSafe
[refunwindsafe_once]: https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-RefUnwindSafe
[tryfrom_ref_arr]: https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3C%26%27_%20mut%20%5BT%5D%3E
[lowercase]: https://doc.rust-lang.org/stable/std/char/struct.ToLowercase.html#impl-DoubleEndedIterator
[uppercase]: https://doc.rust-lang.org/stable/std/char/struct.ToUppercase.html#impl-DoubleEndedIterator
[try_from_char_err]: https://doc.rust-lang.org/stable/std/char/struct.TryFromCharError.html
[available_parallelism]: https://doc.rust-lang.org/stable/std/thread/fn.available_parallelism.html
[result-copied]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.copied
[result-cloned]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.cloned
[asm]: https://doc.rust-lang.org/stable/core/arch/macro.asm.html
[global_asm]: https://doc.rust-lang.org/stable/core/arch/macro.global_asm.html
[is_break]: https://doc.rust-lang.org/stable/std/ops/enum.ControlFlow.html#method.is_break
[is_continue]: https://doc.rust-lang.org/stable/std/ops/enum.ControlFlow.html#method.is_continue
[try_from_char_u8]: https://doc.rust-lang.org/stable/std/primitive.char.html#impl-TryFrom%3Cchar%3E
[zip]: https://doc.rust-lang.org/stable/std/iter/fn.zip.html
[is_power_of_two8]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU8.html#method.is_power_of_two
[is_power_of_two16]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU16.html#method.is_power_of_two
[is_power_of_two32]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU32.html#method.is_power_of_two
[is_power_of_two64]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU64.html#method.is_power_of_two
[is_power_of_two128]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU128.html#method.is_power_of_two
[stdarch/1266]: rust-lang/stdarch#1266
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 15, 2022
Pkgsrc changes:
 * Bump available bootstraps to 1.58.1.
 * Adjust one patch (and checksum) so that it still applies.

Upstream changes:

Version 1.59.0 (2022-02-24)
==========================

Language
--------

- [Stabilize default arguments for const generics][90207]
- [Stabilize destructuring assignment][90521]
- [Relax private in public lint on generic bounds and where clauses
  of trait impls][90586]
- [Stabilize asm! and global_asm! for x86, x86_64, ARM, Aarch64,
  and RISC-V][91728]

Compiler
--------

- [Stabilize new symbol mangling format, leaving it opt-in
  (-Csymbol-mangling-version=v0)][90128]
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
- [Fix sparc64 ABI for aggregates with floating point members][91003]
- [Warn when a `#[test]`-like built-in attribute macro is present
  multiple times.][91172]
- [Add support for riscv64gc-unknown-freebsd][91284]
- [Stabilize `-Z emit-future-incompat` as `--json future-incompat`][91535]
- [Soft disable incremental compilation][94124]

This release disables incremental compilation, unless the user has explicitly
opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
This is due to a known and relatively frequently occurring bug in incremental
compilation, which causes builds to issue internal compiler errors. This
particular bug is already fixed on nightly, but that fix has not yet rolled out
to stable and is deemed too risky for a direct stable backport.

As always, we encourage users to test with nightly and report bugs so that we
can track failures and fix issues earlier.

See [94124] for more details.

[94124]: rust-lang/rust#94124

Libraries
---------

- [Remove unnecessary bounds for some Hash{Map,Set} methods][91593]

Stabilized APIs
---------------

- [`std::thread::available_parallelism`][available_parallelism]
- [`Result::copied`][result-copied]
- [`Result::cloned`][result-cloned]
- [`arch::asm!`][asm]
- [`arch::global_asm!`][global_asm]
- [`ops::ControlFlow::is_break`][is_break]
- [`ops::ControlFlow::is_continue`][is_continue]
- [`TryFrom<char> for u8`][try_from_char_u8]
- [`char::TryFromCharError`][try_from_char_err]
  implementing `Clone`, `Debug`, `Display`, `PartialEq`, `Copy`, `Eq`, `Error`
- [`iter::zip`][zip]
- [`NonZeroU8::is_power_of_two`][is_power_of_two8]
- [`NonZeroU16::is_power_of_two`][is_power_of_two16]
- [`NonZeroU32::is_power_of_two`][is_power_of_two32]
- [`NonZeroU64::is_power_of_two`][is_power_of_two64]
- [`NonZeroU128::is_power_of_two`][is_power_of_two128]
- [`DoubleEndedIterator for ToLowercase`][lowercase]
- [`DoubleEndedIterator for ToUppercase`][uppercase]
- [`TryFrom<&mut [T]> for [T; N]`][tryfrom_ref_arr]
- [`UnwindSafe for Once`][unwindsafe_once]
- [`RefUnwindSafe for Once`][refunwindsafe_once]
- [armv8 neon intrinsics for aarch64][stdarch/1266]

Const-stable:

- [`mem::MaybeUninit::as_ptr`][muninit_ptr]
- [`mem::MaybeUninit::assume_init`][muninit_init]
- [`mem::MaybeUninit::assume_init_ref`][muninit_init_ref]
- [`ffi::CStr::from_bytes_with_nul_unchecked`][cstr_from_bytes]

Cargo
-----

- [Stabilize the `strip` profile option][cargo/10088]
- [Stabilize future-incompat-report][cargo/10165]
- [Support abbreviating `--release` as `-r`][cargo/10133]
- [Support `term.quiet` configuration][cargo/10152]
- [Remove `--host` from cargo {publish,search,login}][cargo/10145]

Compatibility Notes
-------------------

- [Refactor weak symbols in std::sys::unix][90846]
  This may add new, versioned, symbols when building with a newer glibc, as the
  standard library uses weak linkage rather than dynamically attempting to load
  certain symbols at runtime.
- [Deprecate crate_type and crate_name nested inside `#![cfg_attr]`][83744]
  This adds a future compatibility lint to supporting the use of cfg_attr
  wrapping either crate_type or crate_name specification within Rust files;
  it is recommended that users migrate to setting the equivalent command line
  flags.
- [Remove effect of `#[no_link]` attribute on name resolution][92034]
  This may expose new names, leading to conflicts with preexisting names in a
  given namespace and a compilation failure.
- [Cargo will document libraries before binaries.][cargo/10172]
- [Respect doc=false in dependencies, not just the root crate][cargo/10201]
- [Weaken guarantee around advancing underlying iterators in zip][83791]
- [Make split_inclusive() on an empty slice yield an empty output][89825]
- [Update std::env::temp_dir to use GetTempPath2 on Windows when
  available.][89999]
- [unreachable! was updated to match other formatting macro behavior
  on Rust 2021][92137]

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.

- [Fix many cases of normalization-related ICEs][91255]
- [Replace dominators algorithm with simple Lengauer-Tarjan][85013]
- [Store liveness in interval sets for region inference][90637]

- [Remove `in_band_lifetimes` from the compiler and standard library,
  in preparation for removing this unstable feature.][91867]

[91867]: rust-lang/rust#91867
[83744]: rust-lang/rust#83744
[83791]: rust-lang/rust#83791
[85013]: rust-lang/rust#85013
[89825]: rust-lang/rust#89825
[89999]: rust-lang/rust#89999
[90128]: rust-lang/rust#90128
[90207]: rust-lang/rust#90207
[90521]: rust-lang/rust#90521
[90586]: rust-lang/rust#90586
[90637]: rust-lang/rust#90637
[90833]: rust-lang/rust#90833
[90846]: rust-lang/rust#90846
[91003]: rust-lang/rust#91003
[91172]: rust-lang/rust#91172
[91255]: rust-lang/rust#91255
[91284]: rust-lang/rust#91284
[91535]: rust-lang/rust#91535
[91593]: rust-lang/rust#91593
[91728]: rust-lang/rust#91728
[91878]: rust-lang/rust#91878
[91896]: rust-lang/rust#91896
[91926]: rust-lang/rust#91926
[91984]: rust-lang/rust#91984
[92020]: rust-lang/rust#92020
[92034]: rust-lang/rust#92034
[92483]: rust-lang/rust#92483
[cargo/10088]: rust-lang/cargo#10088
[cargo/10133]: rust-lang/cargo#10133
[cargo/10145]: rust-lang/cargo#10145
[cargo/10152]: rust-lang/cargo#10152
[cargo/10165]: rust-lang/cargo#10165
[cargo/10172]: rust-lang/cargo#10172
[cargo/10201]: rust-lang/cargo#10201
[cargo/10269]: rust-lang/cargo#10269

[cstr_from_bytes]: https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.from_bytes_with_nul_unchecked
[muninit_ptr]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
[muninit_init]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
[muninit_init_ref]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref
[unwindsafe_once]: https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-UnwindSafe
[refunwindsafe_once]: https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-RefUnwindSafe
[tryfrom_ref_arr]: https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3C%26%27_%20mut%20%5BT%5D%3E
[lowercase]: https://doc.rust-lang.org/stable/std/char/struct.ToLowercase.html#impl-DoubleEndedIterator
[uppercase]: https://doc.rust-lang.org/stable/std/char/struct.ToUppercase.html#impl-DoubleEndedIterator
[try_from_char_err]: https://doc.rust-lang.org/stable/std/char/struct.TryFromCharError.html
[available_parallelism]: https://doc.rust-lang.org/stable/std/thread/fn.available_parallelism.html
[result-copied]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.copied
[result-cloned]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.cloned
[asm]: https://doc.rust-lang.org/stable/core/arch/macro.asm.html
[global_asm]: https://doc.rust-lang.org/stable/core/arch/macro.global_asm.html
[is_break]: https://doc.rust-lang.org/stable/std/ops/enum.ControlFlow.html#method.is_break
[is_continue]: https://doc.rust-lang.org/stable/std/ops/enum.ControlFlow.html#method.is_continue
[try_from_char_u8]: https://doc.rust-lang.org/stable/std/primitive.char.html#impl-TryFrom%3Cchar%3E
[zip]: https://doc.rust-lang.org/stable/std/iter/fn.zip.html
[is_power_of_two8]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU8.html#method.is_power_of_two
[is_power_of_two16]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU16.html#method.is_power_of_two
[is_power_of_two32]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU32.html#method.is_power_of_two
[is_power_of_two64]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU64.html#method.is_power_of_two
[is_power_of_two128]: https://doc.rust-lang.org/stable/core/num/struct.NonZeroU128.html#method.is_power_of_two
[stdarch/1266]: rust-lang/stdarch#1266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet