-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix: ices on virtual-function-elimination about principal trait #130734
Conversation
//@ build-pass | ||
//@ compile-flags: -Zvirtual-function-elimination=true -Clto=true | ||
//@ only-x86_64 | ||
//@ no-prefer-dynamic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this argument needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./x test
needs this argument to perform LTO.
Below is the error message without no-prefer-dynamic
:
running 1 tests
[ui] tests/ui/codegen/virtual-function-elimination.rs ... F
failures:
---- [ui] tests/ui/codegen/virtual-function-elimination.rs stdout ----
error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/ray/Desktop/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/ray/Desktop/rust/tests/ui/codegen/virtual-function-elimination.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/ray/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/ray/Desktop/rust/vendor" "--sysroot" "/home/ray/Desktop/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/ray/Desktop/rust/build/x86_64-unknown-linux-gnu/test/ui/codegen/virtual-function-elimination" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/ray/Desktop/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/ray/Desktop/rust/build/x86_64-unknown-linux-gnu/test/ui/codegen/virtual-function-elimination/auxiliary" "-Zvirtual-function-elimination=true" "-Clto=true"
stdout: none
--- stderr -------------------------------
error: cannot prefer dynamic linking when performing LTO
|
= note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO
error: aborting due to 1 previous error
------------------------------------------
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after review comment
@bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#130549 (Add RISC-V vxworks targets) - rust-lang#130595 (Initial std library support for NuttX) - rust-lang#130734 (Fix: ices on virtual-function-elimination about principal trait) - rust-lang#130787 (Ban combination of GCE and new solver) - rust-lang#130809 (Update llvm triple for OpenHarmony targets) - rust-lang#130810 (Don't trap into the debugger on panics under Linux) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130734 - Luv-Ray:fix_vfe, r=lcnr Fix: ices on virtual-function-elimination about principal trait Extract `load_vtable` function to ensure the `virtual_function_elimination` option is always checked. It's okay not to use `llvm.type.checked.load` to load the vtable if there is no principal trait. Fixes rust-lang#123955 Fixes rust-lang#124092
Extract
load_vtable
function to ensure thevirtual_function_elimination
option is always checked.It's okay not to use
llvm.type.checked.load
to load the vtable if there is no principal trait.Fixes #123955
Fixes #124092