Closed AidoP closed 1 year ago
Looks like it also happens without the re-borrow, but with a different error.
pub struct Data([u8]);
const _: *const Data = &[] as *const Data;
```
error: internal compiler error: compiler/rustc_const_eval/src/interpret/place.rs:551:56: write_immediate_to_mplace: invalid Scalar layout: TyAndLayout {
ty: *const Data,
layout: Layout {
size: Size(16 bytes),
align: AbiAndPrefAlign {
abi: Align(8 bytes),
pref: Align(8 bytes),
},
abi: ScalarPair(
Initialized {
value: Pointer(
AddressSpace(
0,
),
),
valid_range: 0..=18446744073709551615,
},
Initialized {
value: Int(
I64,
false,
),
valid_range: 0..=18446744073709551615,
},
),
fields: Arbitrary {
offsets: [
Size(0 bytes),
Size(8 bytes),
],
memory_index: [
0,
1,
],
},
largest_niche: None,
variants: Single {
index: 0,
},
},
}
--> ice.rs:2:1
|
2 | const _: *const Data = &[] as *const Data;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thread 'rustc' panicked at 'Box
https://github.com/rust-lang/rust/issues/115998#issue-1904872292 Regression in nightly-2021-11-14
found 7 bors merge commits in the specified range commit[0] 2021-11-12: Auto merge of #90836 - matthiaskrgr:rollup-ou6yrlw, r=matthiaskrgr commit[1] 2021-11-13: Auto merge of #89167 - workingjubilee:use-simd, r=MarkSimulacrum commit[2] 2021-11-13: Auto merge of #90041 - jfrimmel:rt_copy_checks, r=Mark-Simulacrum commit[3] 2021-11-13: Auto merge of #87264 - mystor:expand_literal, r=petrochenkov commit[4] 2021-11-13: Auto merge of #90542 - the8472:privatize-the-means-of-rawvec-production, r=joshtriplett commit[5] 2021-11-13: Auto merge of #89551 - jhpratt:stabilize-const_raw_ptr_deref, r=oli-obk commit[6] 2021-11-13: Auto merge of #90385 - mfrw:mfrw/librustdoc, r=GuillaumeGomez ERROR: no CI builds available between e90c5fbbc5df5c81267747daeb937d4e955ce6ad and b416e3892d9526709f3a248f5ed3a43a970f795e within last 167 days
https://github.com/rust-lang/rust/issues/115998#issuecomment-1727621382 Regression in nightly-2019-06-17 found 7 bors merge commits in the specified range commit[0] 2019-06-15: Auto merge of #61828 - RalfJung:cfg-if, r=alexcrichton commit[1] 2019-06-16: Auto merge of #61886 - Centril:rollup-3p3m2fu, r=Centril commit[2] 2019-06-16: Auto merge of #60730 - matthewjasper:optimize-false-edges, r=pnkfelix commit[3] 2019-06-16: Auto merge of #61739 - chansuke:separate-unit-tests, r=petrochenkov commit[4] 2019-06-16: Auto merge of #61754 - nikomatsakis:trait-caching-perf-3, r=pnkfelix commit[5] 2019-06-16: Auto merge of #61881 - glaubitz:sparc64-ffi-abi, r=petrochenkov commit[6] 2019-06-16: Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkov ERROR: no CI builds available between 0dc9e9c10ca6dc78cba8b9f9b15038c977b10a77 and 4edff843dd219cf19a5fede6c78c7ce95402e1f5 within last 167 days
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium
This also returns ICE, but ICE message varies between rustc version.
pub struct Data([u8]);
fn main(){
let _f = &[] as *const Data;
}
Code
Playgrounds
Meta
rustc --version --verbose
:On playgrounds it seemed to affect
release
anddebug
forstable
,nightly
andbeta
.Error output
Backtrace
``` lorix ~ %RUST_BACKTRACE=full rustc --crate-type lib ice.rs returned 101 error: internal compiler error: compiler/rustc_const_eval/src/interpret/place.rs:36:17: expected wide pointer extra data (e.g. slice length or trait object vtable) thread 'rustc' panicked at 'Box', /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
0: 0x7fba78362b51 - std::backtrace_rs::backtrace::libunwind::trace::h66dc1c6acf794faa
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7fba78362b51 - std::backtrace_rs::backtrace::trace_unsynchronized::ha80d20099a67f790
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7fba78362b51 - std::sys_common::backtrace::_print_fmt::h7b959d43f35f16d4
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
3: 0x7fba78362b51 - ::fmt::hdaa196410d9ee0b9
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7fba783c96ff - core::fmt::rt::Argument::fmt::h0ddfbbe8be3f80d0
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
5: 0x7fba783c96ff - core::fmt::write::h66b3c629f3d623e4
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
6: 0x7fba78355497 - std::io::Write::write_fmt::hb6d80fba4115e0c2
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
7: 0x7fba78362965 - std::sys_common::backtrace::_print::h1a49cfb0cf3cce17
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7fba78362965 - std::sys_common::backtrace::print::hca95c2d0055e42a2
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7fba78365743 - std::panicking::default_hook::{{closure}}::hc03c01c56bca600c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
10: 0x7fba783654d4 - std::panicking::default_hook::hb2cb5315b6634f1c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
11: 0x7fba7b66b60b - rustc_driver_impl[e91af841be79713a]::install_ice_hook::{closure#0}
12: 0x7fba78365f6e - as core::ops::function::Fn>::call::hb3a915ffd78277c6
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:2007:9
13: 0x7fba78365f6e - std::panicking::rust_panic_with_hook::h75cd912a39a34e8a
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:709:13
14: 0x7fba7bc22921 - std[74d10c9f32099e86]::panicking::begin_panic::::{closure#0}
15: 0x7fba7bc214b6 - std[74d10c9f32099e86]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !>
16: 0x7fba7bbce646 - std[74d10c9f32099e86]::panicking::begin_panic::
17: 0x7fba7bb896d4 - ::bug::
18: 0x7fba7bb89556 - ::bug::
19: 0x7fba7bb636cc - rustc_middle[fbd75b4db2cdb7e6]::util::bug::opt_span_bug_fmt::::{closure#0}
20: 0x7fba7bb5efba - rustc_middle[fbd75b4db2cdb7e6]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0}
21: 0x7fba7bb5ef8a - rustc_middle[fbd75b4db2cdb7e6]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !>
22: 0x7fba79da9efd - rustc_middle[fbd75b4db2cdb7e6]::util::bug::bug_fmt
23: 0x7fba79ad4ab6 - >::size_and_align_of
24: 0x7fba79ad480b - >::size_and_align_of
25: 0x7fba79a6fe05 - >::statement
26: 0x7fba79a6a59a - rustc_const_eval[88869f152bb01255]::const_eval::eval_queries::eval_to_allocation_raw_provider
27: 0x7fba796cc0c7 - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::>
28: 0x7fba7a289f2c - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, false>
29: 0x7fba7a289bed - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
30: 0x7fba7aa9ceb6 - rustc_const_eval[88869f152bb01255]::const_eval::eval_queries::eval_to_const_value_raw_provider
31: 0x7fba79689c87 - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::>
32: 0x7fba7a2b1bdb - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, false>
33: 0x7fba7a2b17cd - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
34: 0x7fba7aa9c614 - rustc_const_eval[88869f152bb01255]::const_eval::eval_queries::eval_to_const_value_raw_provider
35: 0x7fba79689c87 - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::>
36: 0x7fba7a2b1bdb - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, false>
37: 0x7fba7a2b17cd - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
38: 0x7fba7973f46c - ::const_eval_poly
39: 0x7fba7973a4f3 - ::check_item
40: 0x7fba79736a21 - rustc_hir[7b007da93fd56bed]::intravisit::walk_mod::>
41: 0x7fba79736336 - rustc_lint[8d94bab7becf7711]::late::late_lint_mod::
42: 0x7fba797360ec - rustc_lint[8d94bab7becf7711]::lint_mod
43: 0x7fba7a2b356c - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::>
44: 0x7fba7a2b354e - >::call_once
45: 0x7fba79d71cff - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, false>
46: 0x7fba7afe1754 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
47: 0x7fba7aa2af17 - rustc_data_structures[bf281432ed14a641]::sync::par_for_each_in::<&[rustc_hir[7b007da93fd56bed]::hir_id::OwnerId], ::par_for_each_module::{closure#1}::{closure#0}::{closure#0}>::{closure#0}>
48: 0x7fba7aa2ac65 - ::time::<(), rustc_lint[8d94bab7becf7711]::late::check_crate::{closure#1}::{closure#0}>
49: 0x7fba7aa2a89e - ::time::<(), rustc_interface[9522ab489a5f66e6]::passes::analysis::{closure#5}::{closure#1}::{closure#2}::{closure#0}>
50: 0x7fba7aa2a3bf - as core[63ccc595abf60ca6]::ops::function::FnOnce<()>>::call_once
51: 0x7fba7aa29db0 - ::time::<(), rustc_interface[9522ab489a5f66e6]::passes::analysis::{closure#5}>
52: 0x7fba7aa28887 - rustc_interface[9522ab489a5f66e6]::passes::analysis
53: 0x7fba7aa8f3ea - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::>
54: 0x7fba7aa8f3d9 - >::call_once
55: 0x7fba7acae458 - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, false>
56: 0x7fba7acae229 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
57: 0x7fba7ab238e2 - >::enter::, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
58: 0x7fba7ab22587 - ::enter::, rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
59: 0x7fba7ab1f7b5 - rustc_span[ca0c6fb73220b455]::set_source_map::, rustc_interface[9522ab489a5f66e6]::interface::run_compiler, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
60: 0x7fba7ab1f226 - >::set::, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
61: 0x7fba7ab1e7ec - std[74d10c9f32099e86]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
62: 0x7fba7aea53b5 - <::spawn_unchecked_, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#1} as core[63ccc595abf60ca6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
63: 0x7fba78370425 - as core::ops::function::FnOnce>::call_once::hde6e666388faa495
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:1993:9
64: 0x7fba78370425 - as core::ops::function::FnOnce>::call_once::h9b6389e489a4842f
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:1993:9
65: 0x7fba78370425 - std::sys::unix::thread::Thread::new::thread_start::hcab660740b858b1f
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys/unix/thread.rs:108:17
66: 0x7fba7808c9eb -
67: 0x7fba78110dfc -
68: 0x0 -
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.72.1 (d5c2e9c34 2023-09-13) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib
query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `_`
#1 [eval_to_const_value_raw] simplifying constant for the type system `_`
#2 [eval_to_const_value_raw] simplifying constant for the type system `_`
#3 [lint_mod] linting top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
```