File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ use crate::boxed::Box;
88/// Writes `x` into `b`.
99///
1010/// This is needed for `vec!`, which can't afford any extra copies of the argument (or else debug
11- /// builds regress), has to be written fully as a call chain without `let` (or else the temporary
12- /// lifetimes of the arguments change ), and can't use an `unsafe` block as that would then also
11+ /// builds regress), has to be written fully as a call chain without `let` (or else this breaks inference
12+ /// of e.g. unsizing coercions ), and can't use an `unsafe` block as that would then also
1313/// include the user-provided `$x`.
1414#[ rustc_intrinsic]
1515pub fn write_box_via_move < T > ( b : Box < MaybeUninit < T > > , x : T ) -> Box < MaybeUninit < T > > ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ macro_rules! vec {
5050 // Using `write_box_via_move` produces a dramatic improvement in stack usage for unoptimized
5151 // programs using this code path to construct large Vecs. We can't use `write_via_move`
5252 // because this entire invocation has to remain a call chain without `let` bindings, or else
53- // the temporary scopes change and things break (see `vec-macro-rvalue-scope` test ).
53+ // inference changes and things break (see `vec-macro-rvalue-scope` and `autoderef-vec-box-fn-36786` tests ).
5454 // This function isn't actually safe but the way we use it here is. We can't use an
5555 // unsafe block as that would also wrap `$x`.
5656 $crate:: boxed:: box_uninit_array_into_vec_unsafe(
You can’t perform that action at this time.
0 commit comments