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

ICE: invalid scalar pair layout #98176

Closed
RalfJung opened this issue Jun 16, 2022 · 9 comments · Fixed by #98178 or #98233
Closed

ICE: invalid scalar pair layout #98176

RalfJung opened this issue Jun 16, 2022 · 9 comments · Fixed by #98178 or #98233
Labels
A-miri Area: The miri tool

Comments

@RalfJung
Copy link
Member

RalfJung commented Jun 16, 2022

This test in Miri recently started ICEing:

error: internal compiler error: /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/place.rs:771:68: write_immediate_to_mplace: invalid ScalarPair layout: TyAndLayout {
                                    ty: *mut alloc::collections::btree::node::LeafNode<Foo, ()>,
                                    layout: Layout {
                                        fields: Primitive,
                                        variants: Single {
                                            index: 0,
                                        },
                                        abi: Scalar(
                                            Initialized {
                                                value: Pointer,
                                                valid_range: 0..=18446744073709551615,
                                            },
                                        ),
                                        largest_niche: None,
                                        align: AbiAndPrefAlign {
                                            abi: Align(8 bytes),
                                            pref: Align(8 bytes),
                                        },
                                        size: Size(8 bytes),
                                    },
                                }
  --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/collections/btree/node.rs:84:28
   |
84 |             LeafNode::init(leaf.as_mut_ptr());
   |                            ^^^^^^^^^^^^^^^^^

So we have a ScalarPair value with Scalar layout. Clearly something went wrong somewhere earlier when that value was constructed.

Backtrace
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
   0:     0x7f5e230ae4cd - std::backtrace_rs::backtrace::libunwind::trace::ha65f46174cdb360a
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5e230ae4cd - std::backtrace_rs::backtrace::trace_unsynchronized::hfbfbd995eed88907
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5e230ae4cd - std::sys_common::backtrace::_print_fmt::hb9a4b91d9836896b
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f5e230ae4cd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h74b81077de211a85
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f5e2310a30c - core::fmt::write::h79f47bb3504917f6
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/core/src/fmt/mod.rs:1196:17
   5:     0x7f5e2309fa91 - std::io::Write::write_fmt::h3937ab33a0b333dc
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/io/mod.rs:1654:15
   6:     0x7f5e230b11a5 - std::sys_common::backtrace::_print::h93abfd2adb3fdfb0
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f5e230b11a5 - std::sys_common::backtrace::print::h35a3573fe2a0b616
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f5e230b11a5 - std::panicking::default_hook::{{closure}}::h0e88dc5c1d6b72c1
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panicking.rs:295:22
   9:     0x7f5e230b0ec6 - std::panicking::default_hook::h472eb815610d1ad9
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panicking.rs:314:9
  10:     0x7f5e23888d81 - rustc_driver[f30206aada3619d2]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f5e230b187a - std::panicking::rust_panic_with_hook::h65d3a31645b7d9c0
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panicking.rs:702:17
  12:     0x55940784c023 - std::panicking::begin_panic::{{closure}}::h3cd7d2520ba0a39c
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panicking.rs:617:9
  13:     0x55940784bff6 - std::sys_common::backtrace::__rust_end_short_backtrace::hf2f19a7d201a3078
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x5594076b6a96 - std::panicking::begin_panic::h6814c3cf587ca3fb
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panicking.rs:616:12
  15:     0x559407819b66 - std::panic::panic_any::hfff2880ea7eb7866
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/library/std/src/panic.rs:61:5
  16:     0x559407819013 - rustc_errors::HandlerInner::span_bug::h08b5b6a6c06108aa
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_errors/src/lib.rs:1331:9
  17:     0x559407819b0a - rustc_errors::Handler::span_bug::h43e80d1caefd13a6
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_errors/src/lib.rs:912:9
  18:     0x559407845549 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::hc07de1ff7ee9cfd9
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/util/bug.rs:34:40
  19:     0x559407845549 - rustc_middle::ty::context::tls::with_opt::{{closure}}::hd7fb4337a1bf88f4
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/ty/context.rs:1900:40
  20:     0x559407845549 - rustc_middle::ty::context::tls::with_context_opt::h8ef810eb8003f5f6
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/ty/context.rs:1852:22
  21:     0x559407845549 - rustc_middle::ty::context::tls::with_opt::h93bb0b3d4802b0e9
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/ty/context.rs:1900:9
  22:     0x5594078455a9 - rustc_middle::util::bug::opt_span_bug_fmt::hc158fe01d3cd1e01
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/util/bug.rs:31:5
  23:     0x5594076b6a57 - rustc_middle::util::bug::span_bug_fmt::h7b911efb8d56e467
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_middle/src/util/bug.rs:22:5
  24:     0x559407781814 - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::write_immediate_to_mplace_no_validate::h0638e32f5165e0c1
  25:     0x5594077809cb - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::write_immediate_no_validate::h69bc9b8a733970d8
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/place.rs:733:9
  26:     0x559407780422 - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op_no_validate::h3950ffa7c8a7eabe
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/place.rs:872:24
  27:     0x55940777ea1d - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op::hbb10dc29e60e83fa
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/place.rs:836:9
  28:     0x55940777ea1d - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op_transmute::h2e5a425a97c34a82
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/place.rs:903:20
  29:     0x55940776c770 - rustc_const_eval::interpret::eval_context::InterpCx<M>::pop_stack_frame::h88260ac54a8018a0
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/eval_context.rs:814:13
  30:     0x559407775bdb - rustc_const_eval::interpret::terminator::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::eval_terminator::h662a1237dfdb504c
  31:     0x559407775bdb - rustc_const_eval::interpret::step::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::terminator::hf0cbf184e1be5a2d
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/step.rs:305:9
  32:     0x559407747db7 - rustc_const_eval::interpret::step::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::step::h2611461c9f6f7522
                               at /rustc/6ec3993ef4a4eb72bc20477fe9a4d92acd53f2c6/compiler/rustc_const_eval/src/interpret/step.rs:71:9
  33:     0x559407747db7 - miri::eval::eval_entry::{{closure}}::h9cce92f32328283b
                               at /home/r/src/rust/miri.2/src/eval.rs:338:29
  34:     0x559407747db7 - miri::eval::eval_entry::hc2a5923a148b7ccd
                               at /home/r/src/rust/miri.2/src/eval.rs:332:38

Good commit: 1f34da9
ICE: 6ec3993

@b-naber
Copy link
Contributor

b-naber commented Jun 16, 2022

Good commit: 1f34da9
ICE: 6ec3993

Is that a typo? Seems like the first commit you mentioned is more likely to be the cause for this.

@RalfJung
Copy link
Member Author

1b9daa6 is the first bad commit.

@RalfJung
Copy link
Member Author

The ICE happens while popping a stack frame, here in the interpreter:

self.copy_op_transmute(&op, &frame.return_place)?;

Specifically this is while returning from MaybeUninit::<alloc::collections::btree::node::LeafNode<Foo, ()>>::as_mut_ptr. The call site is here in the btree code:

LeafNode::init(leaf.as_mut_ptr());

That function is really odd since it uses Box with a non-ZST allocator even if A is a ZST! Various parts of rustc cannot yet deal with non-ZST allocators so this is a problem.
@exrook @Amanieu I wonder if there is any reason that this uses Box<_, &A>? AFAIK everywhere else uses Box<_, A> to ensure this is zero-cost when A is a zero-sized type.

@RalfJung
Copy link
Member Author

(IOW, this is an instance of #95453, but usually that bug can only be triggered by actually using a custom allocator -- whereas now with this btree implementation it can be triggered even on code not using any unstable features.)

@exrook
Copy link
Contributor

exrook commented Jun 16, 2022

The reason for the &A is because BTreeMap holds the allocator within its top level struct, but needs to use the same allocator to allocate nodes through Box::new_in(x, &self.alloc), the other option here would be to require the Allocator to be Clone so we can call Box::new_in(x, self.alloc.clone()) which seems overly restrictive unless we require every Allocator to be clone.

@RalfJung
Copy link
Member Author

#98178 is my proposal for fixing this.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 16, 2022 via email

@bors bors closed this as completed in ff86b27 Jun 18, 2022
@RalfJung
Copy link
Member Author

Even after landing #98178 and #98233, I am still getting ICEs when running the liballoc test suite in Miri -- not entirely sure where they are coming from.

test collections::btree::node::tests::test_partial_eq ... error: internal compiler error: /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/place.rs:771:68: write_immediate_to_mplace: invalid ScalarPair layout: TyAndLayout {
                                    ty: *mut collections::btree::node::LeafNode<i32, ()>,
                                    layout: Layout {
                                        fields: Primitive,
                                        variants: Single {
                                            index: 0,
                                        },
                                        abi: Scalar(
                                            Initialized {
                                                value: Pointer,
                                                valid_range: 0..=18446744073709551615,
                                            },
                                        ),
                                        largest_niche: None,
                                        align: AbiAndPrefAlign {
                                            abi: Align(8 bytes),
                                            pref: Align(8 bytes),
                                        },
                                        size: Size(8 bytes),
                                    },
                                }
  --> alloc_miri_test/../liballoc/src/collections/btree/node.rs:84:28
   |
84 |             LeafNode::init(leaf.as_mut_ptr());
   |                            ^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
   0:     0x7fb8b670ffcd - std::backtrace_rs::backtrace::libunwind::trace::hbd72e940138526b1
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fb8b670ffcd - std::backtrace_rs::backtrace::trace_unsynchronized::h48a77af08b7d13ae
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb8b670ffcd - std::sys_common::backtrace::_print_fmt::h67a74d03e7705414
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fb8b670ffcd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd5c14c44df370080
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fb8b676bd9c - core::fmt::write::hcc530e971977c02f
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/core/src/fmt/mod.rs:1196:17
   5:     0x7fb8b67016f1 - std::io::Write::write_fmt::hfc9163877afd0e5d
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/io/mod.rs:1654:15
   6:     0x7fb8b6712ca5 - std::sys_common::backtrace::_print::hb238af926743aa24
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fb8b6712ca5 - std::sys_common::backtrace::print::hbff108d9b70dac5c
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fb8b6712ca5 - std::panicking::default_hook::{{closure}}::hb5116e73e30a5ccb
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panicking.rs:295:22
   9:     0x7fb8b67129c6 - std::panicking::default_hook::hee1085369b06ab42
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panicking.rs:314:9
  10:     0x7fb8b6eebe81 - rustc_driver[9b361a02c0fe26d1]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fb8b671337a - std::panicking::rust_panic_with_hook::hafd263e42e54dac6
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panicking.rs:702:17
  12:     0x5635d46ed7b3 - std::panicking::begin_panic::{{closure}}::h0620e68f08688870
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panicking.rs:617:9
  13:     0x5635d46ed766 - std::sys_common::backtrace::__rust_end_short_backtrace::hb3657c09fb353fbb
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x5635d45477c6 - std::panicking::begin_panic::h321c5e14a552a92c
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panicking.rs:616:12
  15:     0x5635d45e3926 - std::panic::panic_any::hde0ca3d6a8438108
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/library/std/src/panic.rs:61:5
  16:     0x5635d45e2dd3 - rustc_errors::HandlerInner::span_bug::h28fd53fd37394f16
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_errors/src/lib.rs:1331:9
  17:     0x5635d45e38ca - rustc_errors::Handler::span_bug::h1962adbd2c41e099
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_errors/src/lib.rs:912:9
  18:     0x5635d46cca89 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h926f9f4548fce363
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/util/bug.rs:34:40
  19:     0x5635d46cca89 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h839947ae2bb50c89
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/ty/context.rs:1927:40
  20:     0x5635d46cca89 - rustc_middle::ty::context::tls::with_context_opt::h65f89cab2f91bc4c
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/ty/context.rs:1879:22
  21:     0x5635d46cca89 - rustc_middle::ty::context::tls::with_opt::h3be283049a3cdb97
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/ty/context.rs:1927:9
  22:     0x5635d46ccae9 - rustc_middle::util::bug::opt_span_bug_fmt::h34d6ecd5429f0ab9
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/util/bug.rs:31:5
  23:     0x5635d4548ac7 - rustc_middle::util::bug::span_bug_fmt::he994c8f97027a625
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_middle/src/util/bug.rs:22:5
  24:     0x5635d46110d4 - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::write_immediate_to_mplace_no_validate::he1b49060feebed29
  25:     0x5635d461028b - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::write_immediate_no_validate::had556abc960eedd7
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/place.rs:733:9
  26:     0x5635d460fce2 - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op_no_validate::hf527dddf490375ed
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/place.rs:872:24
  27:     0x5635d460e2dd - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op::h84a32abffa086928
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/place.rs:836:9
  28:     0x5635d460e2dd - rustc_const_eval::interpret::place::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::copy_op_transmute::h9545921bd5c32024
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/place.rs:903:20
  29:     0x5635d45fbff0 - rustc_const_eval::interpret::eval_context::InterpCx<M>::pop_stack_frame::h4debf5beddb889c3
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/eval_context.rs:814:13
  30:     0x5635d460546b - rustc_const_eval::interpret::terminator::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::eval_terminator::h10fe413f9bb50d5e
  31:     0x5635d460546b - rustc_const_eval::interpret::step::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::terminator::he1f3ef6064740aac
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/step.rs:305:9
  32:     0x5635d45d9887 - rustc_const_eval::interpret::step::<impl rustc_const_eval::interpret::eval_context::InterpCx<M>>::step::h393f02e3c7ec62d2
                               at /rustc/cdcc53b7dc002ea4a7a28105010c5a1126ee31b7/compiler/rustc_const_eval/src/interpret/step.rs:71:9
  33:     0x5635d45d9887 - miri::eval::eval_entry::{{closure}}::h5557d5f15a0ed8b1
                               at /home/r/src/rust/miri.2/src/eval.rs:338:29
  34:     0x5635d45d9887 - miri::eval::eval_entry::hda8290ced827330e
                               at /home/r/src/rust/miri.2/src/eval.rs:332:38

@RalfJung RalfJung reopened this Jun 18, 2022
@RalfJung
Copy link
Member Author

After removing some more & from #98233, the ICEs seem gone. :)

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jun 19, 2022
Remove accidental uses of `&A: Allocator`

Cc rust-lang#98232

Fixes rust-lang#98176 (for real this time)
@bors bors closed this as completed in 6a2a56d Jun 19, 2022
workingjubilee pushed a commit to tcdi/postgrestd that referenced this issue Sep 15, 2022
btree: avoid forcing the allocator to be a reference

The previous code forces the actual allocator used to be some `&A`. This generalizes the code to allow any `A: Copy`. If people truly want to use a reference, they can use `&A` themselves.

Fixes rust-lang/rust#98176
workingjubilee pushed a commit to tcdi/postgrestd that referenced this issue Sep 15, 2022
Remove accidental uses of `&A: Allocator`

Cc rust-lang/rust#98232

Fixes rust-lang/rust#98176 (for real this time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-miri Area: The miri tool
Projects
None yet
3 participants