![](/style/images/good.png)
6
![](/style/images/bad.png)
Support -Zfunction-sections by bjorn3 · Pull Request #118 · rust-lang/rustc_code...
source link: https://github.com/rust-lang/rustc_codegen_gcc/pull/118
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
---- slice::test_array_chunks_count stdout ----
---- slice::test_array_chunks_count stderr ----
thread 'main' panicked at 'attempt to create unaligned or null slice', /home/runner/work/rustc_codegen_gcc/rustc_codegen_gcc/build_sysroot/sysroot_src/library/core/src/slice/raw.rs:141:9
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::slice::raw::debug_check_data_len::rt_check::<[i32; 2]>
4: <core::slice::raw::debug_check_data_len::rt_check<[i32; 2]> as core::ops::function::FnOnce<(*const [i32; 2],)>>::call_once
5: core::intrinsics::const_eval_select::<(*const [i32; 2],), core::slice::raw::debug_check_data_len::noop<[i32; 2]>, core::slice::raw::debug_check_data_len::rt_check<[i32; 2]>, ()>
6: core::slice::raw::debug_check_data_len::<[i32; 2]>
7: core::slice::raw::from_raw_parts::<[i32; 2]>
8: <[i32]>::as_chunks_unchecked::<2>
9: <[i32]>::as_chunks::<2>
10: <core::slice::iter::ArrayChunks<i32, 2>>::new
11: <[i32]>::array_chunks::<2>
12: coretests::slice::test_array_chunks_count
13: coretests::slice::test_array_chunks_count::{closure#0}
14: <coretests::slice::test_array_chunks_count::{closure#0} as core::ops::function::FnOnce<()>>::call_once
15: <fn() as core::ops::function::FnOnce<()>>::call_once
16: <fn() as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
17: <alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output = ()> + core::marker::Send> as core::ops::function::FnOnce<()>>::call_once
18: test::run_test_in_spawned_subprocess
19: test::test_main_static_abort
20: coretests::main
21: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I think this perturbed the test executable just enough to expose an existing bug.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK