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

Remove self: Self methods from vtables #114260

Closed
wants to merge 6 commits into from

Conversation

WaffleLapkin
Copy link
Member

Fixes #114007

This turned out to be a lot more complex than I'd wished for, eh. Maybe someone has better ideas?
cc @compiler-errors
r? @oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2023
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-15 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[group]Run git config --global core.autocrlf false
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
  lfs: false
  submodules: false
  set-safe-directory: true
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/should-skip-this.sh
src/ci/scripts/should-skip-this.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/collect-cpu-stats.sh
src/ci/scripts/collect-cpu-stats.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/install-sccache.sh
src/ci/scripts/install-sccache.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/select-xcode.sh
src/ci/scripts/select-xcode.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/install-clang.sh
src/ci/scripts/install-clang.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/install-wix.sh
src/ci/scripts/install-wix.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/disable-git-crlf-conversion.sh
src/ci/scripts/disable-git-crlf-conversion.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/install-msys2.sh
src/ci/scripts/install-msys2.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/install-mingw.sh
src/ci/scripts/install-mingw.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/install-ninja.sh
src/ci/scripts/install-ninja.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/enable-docker-ipv6.sh
src/ci/scripts/enable-docker-ipv6.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/disable-git-crlf-conversion.sh
src/ci/scripts/disable-git-crlf-conversion.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/verify-line-endings.sh
src/ci/scripts/verify-line-endings.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-15
##[endgroup]
##[group]Run src/ci/scripts/verify-backported-commits.sh
src/ci/scripts/verify-backported-commits.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/verify-stable-version-number.sh
src/ci/scripts/verify-stable-version-number.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/run-build-from-ci.sh
src/ci/scripts/run-build-from-ci.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 7a4d253837ff7a49a1002035fd377cf92d617df4
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
 finished in 1.505 seconds
##[group]Testing stage2 book unstable-book (x86_64-unknown-linux-gnu)


command did not execute successfully: CFG_RELEASE_CHANNEL="nightly" RUSTC_BOOTSTRAP="1" RUSTC_STAGE="2" RUSTC_SYSROOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" RUSTDOC_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" RUSTDOC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" RUST_TEST_THREADS="16" "/checkout/obj/build/bootstrap/debug/rustdoc" "-Wrustdoc::invalid_codeblock_attributes" "-Dwarnings" "-Znormalize-docs" "-Z" "unstable-options" "--test" "/checkout/src/doc/unstable-book/src/language-features/unsized-locals.md" "--test-args" ""

stdout ----

running 7 tests
---
test /checkout/src/doc/unstable-book/src/language-features/unsized-locals.md - The_tracking_issue_for_this_feature_is__::Advisory_on_stack_usage (line 164) ... ok

failures:

---- /checkout/src/doc/unstable-book/src/language-features/unsized-locals.md - The_tracking_issue_for_this_feature_is__::By_value_trait_objects (line 105) stdout ----
##[error]error: internal compiler error: compiler/rustc_middle/src/ty/instance.rs:411:25: failed to resolve instance for <dyn Foo as Foo>::foo: Ok(
                                )

thread 'rustc' panicked at 'Box<dyn Any>', /checkout/compiler/rustc_errors/src/lib.rs:1645:9
stack backtrace:
stack backtrace:
   0:     0x7fd8cf2ce791 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h53bd09c025c72070
   1:     0x7fd8cf33b8f7 - core::fmt::write::h888c74b3d36b9c7c
   2:     0x7fd8cf2c29e5 - std::io::Write::write_fmt::hcee2e7f973a4b139
   3:     0x7fd8cf2ce5a5 - std::sys_common::backtrace::print::h1b927eb9eaaf51b8
   4:     0x7fd8cf2d187f - std::panicking::panic_hook_with_disk_dump::{{closure}}::h77322b23c492c739
   5:     0x7fd8cf2d15af - std::panicking::panic_hook_with_disk_dump::h88b9c6ec47fd7f95
   6:     0x7fd8cfee7d40 - rustc_driver_impl[71141359bf75221b]::install_ice_hook::{closure#0}
   7:     0x7fd8cf2d2087 - std::panicking::rust_panic_with_hook::h6ca2d1109aa6fabb
   8:     0x7fd8d2a4ced3 - std[19d7cacdde5e65a7]::panicking::begin_panic::<rustc_errors[b89a246f31ea65b2]::ExplicitBug>::{closure#0}
   9:     0x7fd8d2a452e6 - std[19d7cacdde5e65a7]::sys_common::backtrace::__rust_end_short_backtrace::<std[19d7cacdde5e65a7]::panicking::begin_panic<rustc_errors[b89a246f31ea65b2]::ExplicitBug>::{closure#0}, !>
  10:     0x7fd8cfe5c936 - std[19d7cacdde5e65a7]::panicking::begin_panic::<rustc_errors[b89a246f31ea65b2]::ExplicitBug>
  11:     0x7fd8d2a66f77 - <rustc_errors[b89a246f31ea65b2]::HandlerInner>::bug::<alloc[5deb2540111ae3f5]::string::String>
  12:     0x7fd8d2a66dd9 - <rustc_errors[b89a246f31ea65b2]::Handler>::bug::<alloc[5deb2540111ae3f5]::string::String>
  13:     0x7fd8d2967eb7 - rustc_middle[9485d0795c8038f]::util::bug::opt_span_bug_fmt::<rustc_span[8dc55e9d9c6f6934]::span_encoding::Span>::{closure#0}
  14:     0x7fd8d295984c - rustc_middle[9485d0795c8038f]::ty::context::tls::with_opt::<rustc_middle[9485d0795c8038f]::util::bug::opt_span_bug_fmt<rustc_span[8dc55e9d9c6f6934]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7fd8d29597e4 - rustc_middle[9485d0795c8038f]::ty::context::tls::with_context_opt::<rustc_middle[9485d0795c8038f]::ty::context::tls::with_opt<rustc_middle[9485d0795c8038f]::util::bug::opt_span_bug_fmt<rustc_span[8dc55e9d9c6f6934]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7fd8cfe59fb2 - rustc_middle[9485d0795c8038f]::util::bug::bug_fmt
  17:     0x7fd8d2a33b6f - <rustc_middle[9485d0795c8038f]::ty::instance::Instance>::expect_resolve
  18:     0x7fd8d093f2df - <rustc_monomorphize[96046148b99aae6c]::collector::MirUsedCollector as rustc_middle[9485d0795c8038f]::mir::visit::Visitor>::visit_terminator
  19:     0x7fd8d0948c15 - rustc_monomorphize[96046148b99aae6c]::collector::collect_used_items
  20:     0x7fd8d0945d0b - rustc_monomorphize[96046148b99aae6c]::collector::collect_items_rec
  21:     0x7fd8d0985664 - <core[43630a9b995a1a7f]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[9bcc84c0d149e49e]::sync::par_for_each_in<alloc[5deb2540111ae3f5]::vec::Vec<rustc_middle[9485d0795c8038f]::mir::mono::MonoItem>, rustc_monomorphize[96046148b99aae6c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}> as core[43630a9b995a1a7f]::ops::function::FnOnce<()>>::call_once
  22:     0x7fd8d096e793 - rustc_data_structures[9bcc84c0d149e49e]::sync::par_for_each_in::<alloc[5deb2540111ae3f5]::vec::Vec<rustc_middle[9485d0795c8038f]::mir::mono::MonoItem>, rustc_monomorphize[96046148b99aae6c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  23:     0x7fd8d09859f0 - <rustc_session[dd319d36d08395a3]::session::Session>::time::<(), rustc_monomorphize[96046148b99aae6c]::collector::collect_crate_mono_items::{closure#1}>
  24:     0x7fd8d0942345 - rustc_monomorphize[96046148b99aae6c]::collector::collect_crate_mono_items
  25:     0x7fd8d0950fc2 - rustc_monomorphize[96046148b99aae6c]::partitioning::collect_and_partition_mono_items
  26:     0x7fd8d17ab807 - rustc_query_impl[8b7606b3ab732dd2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8b7606b3ab732dd2]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9485d0795c8038f]::query::erase::Erased<[u8; 24usize]>>
  27:     0x7fd8d19bc20d - <rustc_query_impl[8b7606b3ab732dd2]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[43630a9b995a1a7f]::ops::function::FnOnce<(rustc_middle[9485d0795c8038f]::ty::context::TyCtxt, ())>>::call_once
  28:     0x7fd8d1a67b5f - rustc_query_system[ad2f6644f0415e8d]::query::plumbing::try_execute_query::<rustc_query_impl[8b7606b3ab732dd2]::DynamicConfig<rustc_query_system[ad2f6644f0415e8d]::query::caches::SingleCache<rustc_middle[9485d0795c8038f]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8b7606b3ab732dd2]::plumbing::QueryCtxt, false>
  29:     0x7fd8d194e40b - rustc_query_impl[8b7606b3ab732dd2]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7fd8d023bc9a - rustc_codegen_ssa[32c102c07e06a259]::base::codegen_crate::<rustc_codegen_llvm[2405510487ccf580]::LlvmCodegenBackend>
  31:     0x7fd8d0292fe6 - <rustc_codegen_llvm[2405510487ccf580]::LlvmCodegenBackend as rustc_codegen_ssa[32c102c07e06a259]::traits::backend::CodegenBackend>::codegen_crate
  32:     0x7fd8d00d6e3f - <rustc_session[dd319d36d08395a3]::session::Session>::time::<alloc[5deb2540111ae3f5]::boxed::Box<dyn core[43630a9b995a1a7f]::any::Any>, rustc_interface[37679bd0ab435d39]::passes::start_codegen::{closure#0}>
  33:     0x7fd8d00a726c - rustc_interface[37679bd0ab435d39]::passes::start_codegen
  34:     0x7fd8d01321ed - <rustc_middle[9485d0795c8038f]::ty::context::GlobalCtxt>::enter::<<rustc_interface[37679bd0ab435d39]::queries::Queries>::ongoing_codegen::{closure#0}, core[43630a9b995a1a7f]::result::Result<alloc[5deb2540111ae3f5]::boxed::Box<dyn core[43630a9b995a1a7f]::any::Any>, rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>
  35:     0x7fd8d00c6fa6 - <rustc_interface[37679bd0ab435d39]::queries::Queries>::ongoing_codegen
  36:     0x7fd8cff0abce - rustc_span[8dc55e9d9c6f6934]::set_source_map::<core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>, rustc_interface[37679bd0ab435d39]::interface::run_compiler<core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>, rustc_driver_impl[71141359bf75221b]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  37:     0x7fd8cff21a53 - <scoped_tls[3eaaa867950c7d5a]::ScopedKey<rustc_span[8dc55e9d9c6f6934]::SessionGlobals>>::set::<rustc_interface[37679bd0ab435d39]::interface::run_compiler<core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>, rustc_driver_impl[71141359bf75221b]::run_compiler::{closure#1}>::{closure#0}, core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>
  38:     0x7fd8cff1fba7 - std[19d7cacdde5e65a7]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[37679bd0ab435d39]::util::run_in_thread_pool_with_globals<rustc_interface[37679bd0ab435d39]::interface::run_compiler<core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>, rustc_driver_impl[71141359bf75221b]::run_compiler::{closure#1}>::{closure#0}, core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>
  39:     0x7fd8cff290d6 - <<std[19d7cacdde5e65a7]::thread::Builder>::spawn_unchecked_<rustc_interface[37679bd0ab435d39]::util::run_in_thread_pool_with_globals<rustc_interface[37679bd0ab435d39]::interface::run_compiler<core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>, rustc_driver_impl[71141359bf75221b]::run_compiler::{closure#1}>::{closure#0}, core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[43630a9b995a1a7f]::result::Result<(), rustc_span[8dc55e9d9c6f6934]::ErrorGuaranteed>>::{closure#1} as core[43630a9b995a1a7f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7fd8cf078b43 - <unknown>
  42:     0x7fd8cf10aa00 - <unknown>
  43:                0x0 - <unknown>


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: please attach the file at `/checkout/obj/rustc-ice-2023-07-30T17:17:54.361920943Z-257846.txt` to your bug report

note: compiler flags: --crate-type bin -Z unstable-options -C codegen-units=1 -Z normalize-docs -Z unstable-options -Z unstable-options
query stack during panic:
query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
error: aborting due to previous error

Couldn't compile the test.

Comment on lines +16 to 17
= help: consider moving `test` to another trait
= help: consider moving `test` to another trait
Copy link
Member

@Noratrieb Noratrieb Jul 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think users need that much help when getting the error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You see, this is tricky, because those lines are triggered by different errors:

ObjectSafetyViolation::AssocConst(name, _)
| ObjectSafetyViolation::GAT(name, _)
| ObjectSafetyViolation::Method(name, ..) => {
err.help(format!("consider moving `{name}` to another trait"));

I couldn't find an easy way to fix this...

@bjorn3
Copy link
Member

bjorn3 commented Sep 5, 2023

It is possible to call a self: Self method on a trait object when #![feature(unsized_fn_params)] is enabled. This is how the impl FnOnce() for Box<dyn FnOnce()> impl works. It calls call_once on dyn FnOnce() which has self: Self as arg.

@WaffleLapkin
Copy link
Member Author

I thought that this is not a problem, given that we planned to remove unsized locals stuff and FnOnce can be special cased. But I'm not actually sure we still want to remove unsized params so maybe there isn't anything that can be done here...

@bjorn3
Copy link
Member

bjorn3 commented Sep 9, 2023

We want to remove unsized locals, but afaik not unsized params.

@WaffleLapkin
Copy link
Member Author

Yeah, if that's the case, nothing can really be done here. For unsized params we need to have the entries in the vtable. And we can't check if the feature is enabled or not, because upstream crates can enable it.

@WaffleLapkin WaffleLapkin deleted the vtablin'' branch September 9, 2023 15:55
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 25, 2023
Return multiple object-safety violation errors and code improvements to the object-safety check

See individual commits for more information. Split off of rust-lang#114260, since it turned out that the main intent of that PR was wrong.

r? oli-obk
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2023
Rollup merge of rust-lang#116401 - WaffleLapkin:vtablin''', r=oli-obk

Return multiple object-safety violation errors and code improvements to the object-safety check

See individual commits for more information. Split off of rust-lang#114260, since it turned out that the main intent of that PR was wrong.

r? oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VTables include uncallable methods (that take self by value)
6 participants