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

Make write/print macros eagerly drop temporaries #96455

Merged
merged 3 commits into from
May 23, 2022

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Apr 26, 2022

This PR fixes the 2 regressions in #96434 (println and eprintln) and changes all the other similar macros (write, writeln, print, eprint) to match the old pre-#94868 behavior of println and eprintln.

argument position before #94868 after #94868 after this PR
write!($tmp, "…", …) 😡 😡 😺
write!(…, "…", $tmp) 😡 😡 😺
writeln!($tmp, "…", …) 😡 😡 😺
writeln!(…, "…", $tmp) 😡 😡 😺
print!("…", $tmp) 😡 😡 😺
println!("…", $tmp) 😺 😡 😺
eprint!("…", $tmp) 😡 😡 😺
eprintln!("…", $tmp) 😺 😡 😺
panic!("…", $tmp) 😺 😺 😺

Example of code that is affected by this change:

use std::sync::Mutex;

fn main() {
    let mutex = Mutex::new(0);
    print!("{}", mutex.lock().unwrap()) /* no semicolon */
}

You can see several real-world examples like this in the Crater links at the top of #96434. This code failed to compile prior to this PR as follows, but works after this PR.

error[E0597]: `mutex` does not live long enough
 --> src/main.rs:5:18
  |
5 |     print!("{}", mutex.lock().unwrap()) /* no semicolon */
  |                  ^^^^^^^^^^^^---------
  |                  |
  |                  borrowed value does not live long enough
  |                  a temporary with access to the borrow is created here ...
6 | }
  | -
  | |
  | `mutex` dropped here while still borrowed
  | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`

@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 26, 2022
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 Apr 26, 2022
@dtolnay dtolnay linked an issue Apr 26, 2022 that may be closed by this pull request
@Mark-Simulacrum Mark-Simulacrum added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. relnotes Marks issues that should be documented in the release notes of the next release. beta-nominated Nominated for backporting to the compiler in the beta channel. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 27, 2022
@Mark-Simulacrum
Copy link
Member

I suppose we want T-libs-api FCP here since this affects stable behavior, but r=me on the PR itself.

Also nominating for beta backport.

@dtolnay
Copy link
Member Author

dtolnay commented Apr 27, 2022

@rust-lang/libs-api:
@rfcbot fcp merge

In the table above, I think everything other than the 1st and 3rd rows are an obvious improvement. These are all equivalent to #64856.

The 1st and 3rd row (how to treat the "writer" argument of write! and writeln!) are not as obvious. In particular I don't see a way to simultaneously support both of the following situations:

use std::fmt;

fn needs_late_drop() {
    struct Mutex;
    struct MutexGuard<'a>(&'a Mutex);

    impl<'a> MutexGuard<'a> {
        fn write_fmt(&self, _args: fmt::Arguments) -> &Self {
            self
        }

        fn lol(&self) {}
    }

    // NEEDS LATE DROP. Needs the MutexGuard temporary to drop at the nearest
    // semicolon _outside_ the write macro.
    let mutex = Mutex;
    write!(MutexGuard(&mutex), "").lol();
}

fn needs_early_drop() -> fmt::Result {
    struct Mutex;
    struct MutexGuard<'a>(&'a Mutex);

    impl<'a> Drop for MutexGuard<'a> {
        fn drop(&mut self) {}
    }

    impl<'a> MutexGuard<'a> {
        fn write_fmt(&self, _args: fmt::Arguments) -> fmt::Result {
            Ok(())
        }
    }

    // NEEDS EARLY DROP. Needs the MutexGuard temporary to drop at a semicolon
    // _inside_ of the write macro.
    let mutex = Mutex;
    write!(MutexGuard(&mutex), "") /* no semicolon */
}

If write! drops the writer inside of the macro, then needs_late_drop fails with:

error[E0716]: temporary value dropped while borrowed
  --> src/main.rs:18:12
   |
18 |     write!(MutexGuard(&mutex), "").lol();
   |     -------^^^^^^^^^^^^^^^^^^-----
   |     |      |
   |     |      creates a temporary which is freed while still in use
   |     temporary value is freed at the end of this statement
   |     borrow later used here
   |
   = note: consider using a `let` binding to create a longer lived value

If write! does not drop the writer inside of the macro, then needs_early_drop fails with:

error[E0597]: `mutex` does not live long enough
  --> src/main.rs:38:23
   |
38 |     write!(MutexGuard(&mutex), "") /* no semicolon */
   |            -----------^^^^^^-
   |            |          |
   |            |          borrowed value does not live long enough
   |            a temporary with access to the borrow is created here ...
39 | }
   | -
   | |
   | `mutex` dropped here while still borrowed
   | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `needs_early_drop::MutexGuard`

In either case the fix required by the programmer is the same: just make a let for the writer.

-    write!(MutexGuard(&mutex), "").lol();
+    let writer = MutexGuard(&mutex);
+    write!(writer, "").lol();
-    write!(MutexGuard(&mutex), "") /* no semicolon */
+    let writer = MutexGuard(&mutex);
+    write!(writer, "") /* no semicolon */

My opinion is that in the two functions above, needs_early_drop is the one that should compile successfully and needs_late_drop is the one that should not. My rationale is that needs_early_drop is a situation that can happen with the ordinary io::Write and fmt::Write signatures (fn write_fmt(&mut self, Arguments) -> io::Result<()> and fn write_fmt(&mut self, Arguments) -> fmt::Result) while needs_late_drop is a situation that occurs only in contrived code with a highly unusual custom signature for write_fmt.

@rfcbot
Copy link

rfcbot commented Apr 27, 2022

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Apr 27, 2022
@joshtriplett
Copy link
Member

@dtolnay Seeking clarification: can this ever change the semantics of existing code by changing when drop happens, or can it only ever make code that didn't compile start compiling.

@dtolnay
Copy link
Member Author

dtolnay commented Apr 27, 2022

Yes, it's about moving drops from the nearest end of statement outside the macro to inside the macro. So for example:

use std::fmt::{self, Display};
use std::ops::Add;

struct X(usize);

impl Display for X {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        formatter.write_str("X")
    }
}

impl Add<X> for () {
    type Output = ();
    fn add(self, _: X) -> Self::Output {}
}

impl Drop for X {
    fn drop(&mut self) {
        print!("{}", self.0);
    }
}

fn main() {
    print!("{}", X(0)) + X(1);
}

would go from X10 to X01.

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Apr 27, 2022
@rfcbot
Copy link

rfcbot commented Apr 27, 2022

🔔 This is now entering its final comment period, as per the review above. 🔔

@dtolnay
Copy link
Member Author

dtolnay commented Apr 27, 2022

Un-nominating for backport and nominating #96490 instead.

Both PRs can land in nightly without conflicting, but only #96490 needs to be backported I think.

@dtolnay dtolnay removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 27, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 1, 2022
…lacrum

Make [e]println macros eagerly drop temporaries (for backport)

This PR extracts the subset of rust-lang#96455 which is only the parts necessary for fixing the 1.61-beta regressions in rust-lang#96434.

My larger PR rust-lang#96455 contains a few other changes relative to the pre-rust-lang#94868 behavior; those are not necessary to backport into 1.61.

argument position | before rust-lang#94868 | after rust-lang#94868 | after this PR
--- |:---:|:---:|:---:
`write!($tmp, "…", …)` | :rage: | :rage: | :rage:
`write!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`writeln!($tmp, "…", …)` | :rage: | :rage: | :rage:
`writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`print!("…", $tmp)` | :rage: | :rage: | :rage:
`println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`eprint!("…", $tmp)` | :rage: | :rage: | :rage:
`eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
ehuss pushed a commit to ehuss/rust that referenced this pull request May 4, 2022
…lacrum

Make [e]println macros eagerly drop temporaries (for backport)

This PR extracts the subset of rust-lang#96455 which is only the parts necessary for fixing the 1.61-beta regressions in rust-lang#96434.

My larger PR rust-lang#96455 contains a few other changes relative to the pre-rust-lang#94868 behavior; those are not necessary to backport into 1.61.

argument position | before rust-lang#94868 | after rust-lang#94868 | after this PR
--- |:---:|:---:|:---:
`write!($tmp, "…", …)` | :rage: | :rage: | :rage:
`write!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`writeln!($tmp, "…", …)` | :rage: | :rage: | :rage:
`writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`print!("…", $tmp)` | :rage: | :rage: | :rage:
`println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`eprint!("…", $tmp)` | :rage: | :rage: | :rage:
`eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 7, 2022
@Mark-Simulacrum Mark-Simulacrum 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 May 15, 2022
MabezDev pushed a commit to esp-rs/rust that referenced this pull request May 17, 2022
…lacrum

Make [e]println macros eagerly drop temporaries (for backport)

This PR extracts the subset of rust-lang#96455 which is only the parts necessary for fixing the 1.61-beta regressions in rust-lang#96434.

My larger PR rust-lang#96455 contains a few other changes relative to the pre-rust-lang#94868 behavior; those are not necessary to backport into 1.61.

argument position | before rust-lang#94868 | after rust-lang#94868 | after this PR
--- |:---:|:---:|:---:
`write!($tmp, "…", …)` | :rage: | :rage: | :rage:
`write!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`writeln!($tmp, "…", …)` | :rage: | :rage: | :rage:
`writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`print!("…", $tmp)` | :rage: | :rage: | :rage:
`println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`eprint!("…", $tmp)` | :rage: | :rage: | :rage:
`eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: x86_64-gnu-tools
##[endgroup]
From https://github.com/rust-lang/rust
 * branch              master     -> FETCH_HEAD
Searching for toolstate changes between 07e7b4346c48fe6d5c3026207e2d04c9a9f00fb8 and 39f628fd0c5bfedb296f3c086dfcd18d7868b4df
Clippy or rustfmt subtrees were updated
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
---
.......... (60/64)
...       (64/64)


/checkout/src/test/rustdoc-gui/escape-key.goml escape-key... FAILED
[ERROR] (line 6) Error: The following CSS selector "#search h1" was not found: for command `wait-for: "#search h1" // The search element is empty before the first search `
Build completed unsuccessfully in 0:00:41

@dtolnay
Copy link
Member Author

dtolnay commented May 23, 2022

Failure is rustdoc-gui being flaky, unrelated to this PR. #93784

/checkout/src/test/rustdoc-gui/escape-key.goml escape-key... FAILED
[ERROR] (line 6) Error: The following CSS selector "#search h1" was not found: for command `wait-for: "#search h1" // The search element is empty before the first search `

@dtolnay
Copy link
Member Author

dtolnay commented May 23, 2022

@bors r=m-ou-se

@bors
Copy link
Contributor

bors commented May 23, 2022

📌 Commit a610098 has been approved by m-ou-se

@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 May 23, 2022
@bors
Copy link
Contributor

bors commented May 23, 2022

⌛ Testing commit a610098 with merge c186f7c...

@bors
Copy link
Contributor

bors commented May 23, 2022

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing c186f7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2022
@bors bors merged commit c186f7c into rust-lang:master May 23, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 23, 2022
@dtolnay dtolnay deleted the writetmp branch May 23, 2022 05:39
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c186f7c): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 3 0 0 0 3
mean2 0.4% N/A N/A N/A 0.4%
max 0.6% N/A N/A N/A 0.6%

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 2 1 0 0 2
mean2 3.1% 1.1% N/A N/A 3.1%
max 3.4% 1.1% N/A N/A 3.4%

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 3 1 0 1
mean2 N/A 4.4% -2.5% N/A -2.5%
max N/A 4.6% -2.5% N/A -2.5%

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

Footnotes

  1. number of relevant changes 2 3

  2. the arithmetic mean of the percent change 2 3

@rustbot rustbot added the perf-regression Performance regression. label May 23, 2022
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label May 24, 2022
@Mark-Simulacrum
Copy link
Member

This change is relatively minor and limited to a single benchmark; it doesn't look to be obviously noise, but I think is not worth further investigation. Marking as triaged.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 28, 2022
Revert `write!` and `writeln!` to late drop temporaries

Closes (on master, but not on beta) rust-lang#99684 by reverting the `write!` and `writeln!` parts of rust-lang#96455.

argument position | before<br>rust-lang#94868 | after<br>rust-lang#94868 | after<br>rust-lang#96455 | after<br>this PR | desired<br>(unimplementable)
--- |:---:|:---:|:---:|:---:|:---:
`write!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`write!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`writeln!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`writeln!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`print!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`println!("…", $tmp)` | *early⸺* | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprint!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprintln!("…", $tmp)` | *early⸺* | **⸺late**| *early⸺* | *early⸺* | *early⸺*
`panic!("…", $tmp)` | *early⸺* | *early⸺* | *early⸺* | *early⸺* | *early⸺*

"Late drop" refers to dropping temporaries at the nearest semicolon **outside** of the macro invocation.

"Early drop" refers to dropping temporaries inside of the macro invocation.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 10, 2022
Pkgsrc changes:
 * Adjust patches as needed & checksum updates.

Upstream changes:

Version 1.63.0 (2022-08-11)
==========================

Language
--------
- [Remove migrate borrowck mode for pre-NLL errors.][95565]
- [Modify MIR building to drop repeat expressions with length zero.][95953]
- [Remove label/lifetime shadowing warnings.][96296]
- [Allow explicit generic arguments in the presence of `impl Trait` args.]
  [96868]
- [Make `cenum_impl_drop_cast` warnings deny-by-default.][97652]
- [Prevent unwinding when `-C panic=abort` is used regardless of
  declared ABI.][96959]
- [lub: don't bail out due to empty binders.][97867]

Compiler
--------
- [Stabilize the `bundle` native library modifier,][95818] also removing the
  deprecated `static-nobundle` linking kind.
- [Add Apple WatchOS compile targets\*.][95243]
- [Add a Windows application manifest to rustc-main.][96737]

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

Libraries
---------
- [Implement `Copy`, `Clone`, `PartialEq` and `Eq` for
  `core::fmt::Alignment`.][94530]
- [Extend `ptr::null` and `null_mut` to all thin (including extern)
  types.][94954]
- [`impl Read and Write for VecDeque<u8>`.][95632]
- [STD support for the Nintendo 3DS.][95897]
- [Make write/print macros eagerly drop temporaries.][96455]
- [Implement internal traits that enable `[OsStr]::join`.][96881]
- [Implement `Hash` for `core::alloc::Layout`.][97034]
- [Add capacity documentation for `OsString`.][97202]
- [Put a bound on collection misbehavior.][97316]
- [Make `std::mem::needs_drop` accept `?Sized`.][97675]
- [`impl Termination for Infallible` and then make the `Result` impls
  of `Termination` more generic.][97803]
- [Document Rust's stance on `/proc/self/mem`.][97837]

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

- [`array::from_fn`]
- [`Box::into_pin`]
- [`BinaryHeap::try_reserve`]
- [`BinaryHeap::try_reserve_exact`]
- [`OsString::try_reserve`]
- [`OsString::try_reserve_exact`]
- [`PathBuf::try_reserve`]
- [`PathBuf::try_reserve_exact`]
- [`Path::try_exists`]
- [`Ref::filter_map`]
- [`RefMut::filter_map`]
- [`NonNull::<[T]>::len`][`NonNull::<slice>::len`]
- [`ToOwned::clone_into`]
- [`Ipv6Addr::to_ipv4_mapped`]
- [`unix::io::AsFd`]
- [`unix::io::BorrowedFd<'fd>`]
- [`unix::io::OwnedFd`]
- [`windows::io::AsHandle`]
- [`windows::io::BorrowedHandle<'handle>`]
- [`windows::io::OwnedHandle`]
- [`windows::io::HandleOrInvalid`]
- [`windows::io::HandleOrNull`]
- [`windows::io::InvalidHandleError`]
- [`windows::io::NullHandleError`]
- [`windows::io::AsSocket`]
- [`windows::io::BorrowedSocket<'handle>`]
- [`windows::io::OwnedSocket`]
- [`thread::scope`]
- [`thread::Scope`]
- [`thread::ScopedJoinHandle`]

These APIs are now usable in const contexts:

- [`array::from_ref`]
- [`slice::from_ref`]
- [`intrinsics::copy`]
- [`intrinsics::copy_nonoverlapping`]
- [`<*const T>::copy_to`]
- [`<*const T>::copy_to_nonoverlapping`]
- [`<*mut T>::copy_to`]
- [`<*mut T>::copy_to_nonoverlapping`]
- [`<*mut T>::copy_from`]
- [`<*mut T>::copy_from_nonoverlapping`]
- [`str::from_utf8`]
- [`Utf8Error::error_len`]
- [`Utf8Error::valid_up_to`]
- [`Condvar::new`]
- [`Mutex::new`]
- [`RwLock::new`]

Cargo
-----
- [Stabilize the `--config path` command-line argument.][cargo/10755]
- [Expose rust-version in the environment as
  `CARGO_PKG_RUST_VERSION`.][cargo/10713]

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

- [`#[link]` attributes are now checked more strictly,][96885]
  which may introduce errors for invalid attribute arguments that
  were previously ignored.

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.

- [Prepare Rust for LLVM opaque pointers.][94214]

[94214]: rust-lang/rust#94214
[94530]: rust-lang/rust#94530
[94954]: rust-lang/rust#94954
[95243]: rust-lang/rust#95243
[95565]: rust-lang/rust#95565
[95632]: rust-lang/rust#95632
[95818]: rust-lang/rust#95818
[95897]: rust-lang/rust#95897
[95953]: rust-lang/rust#95953
[96296]: rust-lang/rust#96296
[96455]: rust-lang/rust#96455
[96737]: rust-lang/rust#96737
[96868]: rust-lang/rust#96868
[96881]: rust-lang/rust#96881
[96885]: rust-lang/rust#96885
[96959]: rust-lang/rust#96959
[97034]: rust-lang/rust#97034
[97202]: rust-lang/rust#97202
[97316]: rust-lang/rust#97316
[97652]: rust-lang/rust#97652
[97675]: rust-lang/rust#97675
[97803]: rust-lang/rust#97803
[97837]: rust-lang/rust#97837
[97867]: rust-lang/rust#97867
[cargo/10713]: rust-lang/cargo#10713
[cargo/10755]: rust-lang/cargo#10755

[`array::from_fn`]: https://doc.rust-lang.org/stable/std/array/fn.from_fn.html
[`Box::into_pin`]: https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_pin
[`BinaryHeap::try_reserve_exact`]: https://doc.rust-lang.org/stable/alloc/collections/binary_heap/struct.BinaryHeap.html#method.try_reserve_exact
[`BinaryHeap::try_reserve`]: https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.try_reserve
[`OsString::try_reserve`]: https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.try_reserve
[`OsString::try_reserve_exact`]: https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.try_reserve_exact
[`PathBuf::try_reserve`]: https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.try_reserve
[`PathBuf::try_reserve_exact`]: https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.try_reserve_exact
[`Path::try_exists`]: https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.try_exists
[`Ref::filter_map`]: https://doc.rust-lang.org/stable/std/cell/struct.Ref.html#method.filter_map
[`RefMut::filter_map`]: https://doc.rust-lang.org/stable/std/cell/struct.RefMut.html#method.filter_map
[`NonNull::<slice>::len`]: https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.len
[`ToOwned::clone_into`]: https://doc.rust-lang.org/stable/std/borrow/trait.ToOwned.html#method.clone_into
[`Ipv6Addr::to_ipv4_mapped`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.to_ipv4_mapped
[`unix::io::AsFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/trait.AsFd.html
[`unix::io::BorrowedFd<'fd>`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.BorrowedFd.html
[`unix::io::OwnedFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.OwnedFd.html
[`windows::io::AsHandle`]: https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsHandle.html
[`windows::io::BorrowedHandle<'handle>`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.BorrowedHandle.html
[`windows::io::OwnedHandle`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html
[`windows::io::HandleOrInvalid`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.HandleOrInvalid.html
[`windows::io::HandleOrNull`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.HandleOrNull.html
[`windows::io::InvalidHandleError`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.InvalidHandleError.html
[`windows::io::NullHandleError`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.NullHandleError.html
[`windows::io::AsSocket`]: https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsSocket.html
[`windows::io::BorrowedSocket<'handle>`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.BorrowedSocket.html
[`windows::io::OwnedSocket`]: https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedSocket.html
[`thread::scope`]: https://doc.rust-lang.org/stable/std/thread/fn.scope.html
[`thread::Scope`]: https://doc.rust-lang.org/stable/std/thread/struct.Scope.html
[`thread::ScopedJoinHandle`]: https://doc.rust-lang.org/stable/std/thread/struct.ScopedJoinHandle.html

[`array::from_ref`]: https://doc.rust-lang.org/stable/std/array/fn.from_ref.html
[`slice::from_ref`]: https://doc.rust-lang.org/stable/std/slice/fn.from_ref.html
[`intrinsics::copy`]: https://doc.rust-lang.org/stable/std/intrinsics/fn.copy.html
[`intrinsics::copy_nonoverlapping`]: https://doc.rust-lang.org/stable/std/intrinsics/fn.copy_nonoverlapping.html
[`<*const T>::copy_to`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_to
[`<*const T>::copy_to_nonoverlapping`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_to_nonoverlapping
[`<*mut T>::copy_to`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_to-1
[`<*mut T>::copy_to_nonoverlapping`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_to_nonoverlapping-1
[`<*mut T>::copy_from`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_from
[`<*mut T>::copy_from_nonoverlapping`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.copy_from_nonoverlapping
[`str::from_utf8`]: https://doc.rust-lang.org/stable/std/str/fn.from_utf8.html
[`Utf8Error::error_len`]: https://doc.rust-lang.org/stable/std/str/struct.Utf8Error.html#method.error_len
[`Utf8Error::valid_up_to`]: https://doc.rust-lang.org/stable/std/str/struct.Utf8Error.html#method.valid_up_to
[`Condvar::new`]: https://doc.rust-lang.org/stable/std/sync/struct.Condvar.html#method.new
[`Mutex::new`]: https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.new
[`RwLock::new`]: https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[regression] println borrow check errors