Skip to content

ICE: assertion failure: eps.array_windows() ... rustc_middle/src/ty/context.rs:2684:9 #102933

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Oct 11, 2022 · 7 comments · Fixed by #102947
Closed
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Oct 11, 2022

59324.rs

Code

trait BufMut {}
struct Bytes;
struct BytesMut;

pub trait Future {
    type Item;
}

pub trait Service {
    type Response;
    type Future: Future<Item = Self::Response>;
}

pub trait ThriftService<F>:
    Service<
        Response = FramingEncoded<F>,
        Future = Box<Future<Item = FramingEncodedFinal<F>>>,
    >
where
    F: Framing,
{
    fn get_service(
        &self,
    ) -> &Service<
        Response = Self::Response,
        Future = Self::Future,
    >;
}

pub trait BufMutExt: BufMut {
    type Final;
}

impl BufMutExt for BytesMut {
    type Final = Bytes;
}

pub type FramingEncoded<F> = <F as Framing>::EncBuf;
pub type FramingEncodedFinal<F> = <<F as Framing>::EncBuf as BufMutExt>::Final;

pub trait Framing {
    type EncBuf: BufMut;
}

pub struct SRHeaderTransport;
impl Framing for SRHeaderTransport {
    type EncBuf = BytesMut;
}

pub type BoxService<H> = Box<
    ThriftService<
            SRHeaderTransport,
            Response = Bytes,
            Future = Box<Future<Item = Bytes>>,
        >,
>;

fn with_factory<H>(self, factory: BoxService<H>) {}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (db0597f56 2022-10-11)
binary: rustc
commit-hash: db0597f5619d5ed93feca28e61226d3581cc7867
commit-date: 2022-10-11
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2

Error output

error: `self` parameter is only allowed in associated functions
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:58:20
   |
58 | fn with_factory<H>(self, factory: BoxService<H>) {}
   |                    ^^^^ not semantically valid as function parameter
   |
   = note: associated functions are those in `impl` or `trait` definitions

warning: trait objects without an explicit `dyn` are deprecated
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:17:22
   |
17 |         Future = Box<Future<Item = FramingEncodedFinal<F>>>,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
   = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
   |
17 |         Future = Box<dyn Future<Item = FramingEncodedFinal<F>>>,
   |                      +++

warning: trait objects without an explicit `dyn` are deprecated
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:51:5
   |
51 | /     ThriftService<
52 | |             SRHeaderTransport,
53 | |             Response = Bytes,
54 | |             Future = Box<Future<Item = Bytes>>,
55 | |         >,
   | |_________^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
   |
51 ~     dyn ThriftService<
52 |             SRHeaderTransport,
53 |             Response = Bytes,
54 |             Future = Box<Future<Item = Bytes>>,
55 ~         >,
   |

warning: trait objects without an explicit `dyn` are deprecated
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:54:26
   |
54 |             Future = Box<Future<Item = Bytes>>,
   |                          ^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
   |
54 |             Future = Box<dyn Future<Item = Bytes>>,
   |                          +++

warning: trait objects without an explicit `dyn` are deprecated
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:24:11
   |
24 |       ) -> &Service<
   |  ___________^
25 | |         Response = Self::Response,
26 | |         Future = Self::Future,
27 | |     >;
   | |_____^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
   |
24 ~     ) -> &dyn Service<
25 |         Response = Self::Response,
26 |         Future = Self::Future,
27 ~     >;
   |

error[E0277]: the trait bound `<F as Framing>::EncBuf: BufMutExt` is not satisfied
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:14:1
   |
14 | / pub trait ThriftService<F>:
15 | |     Service<
16 | |         Response = FramingEncoded<F>,
17 | |         Future = Box<Future<Item = FramingEncodedFinal<F>>>,
18 | |     >
   | |_____^ the trait `BufMutExt` is not implemented for `<F as Framing>::EncBuf`
   |
help: consider further restricting the associated type
   |
20 |     F: Framing, <F as Framing>::EncBuf: BufMutExt
   |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<F as Framing>::EncBuf: BufMutExt` is not satisfied
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:14:1
   |
14 | / pub trait ThriftService<F>:
15 | |     Service<
16 | |         Response = FramingEncoded<F>,
17 | |         Future = Box<Future<Item = FramingEncodedFinal<F>>>,
...  |
27 | |     >;
28 | | }
   | |_^ the trait `BufMutExt` is not implemented for `<F as Framing>::EncBuf`
   |
help: consider further restricting the associated type
   |
20 |     F: Framing, <F as Framing>::EncBuf: BufMutExt
   |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `BytesMut: BufMut` is not satisfied
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:34:6
   |
34 | impl BufMutExt for BytesMut {
   |      ^^^^^^^^^ the trait `BufMut` is not implemented for `BytesMut`
   |
note: required by a bound in `BufMutExt`
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:30:22
   |
30 | pub trait BufMutExt: BufMut {
   |                      ^^^^^^ required by this bound in `BufMutExt`

error[E0277]: the trait bound `<F as Framing>::EncBuf: BufMutExt` is not satisfied
  --> /home/matthias/vcs/github/glacier2/fixed/59324.rs:22:5
   |
22 | /     fn get_service(
23 | |         &self,
24 | |     ) -> &Service<
25 | |         Response = Self::Response,
26 | |         Future = Self::Future,
27 | |     >;
   | |______^ the trait `BufMutExt` is not implemented for `<F as Framing>::EncBuf`
   |
help: consider further restricting the associated type
   |
27 |     > where <F as Framing>::EncBuf: BufMutExt;
   |       +++++++++++++++++++++++++++++++++++++++
Backtrace

thread 'rustc' panicked at 'assertion failed: eps.array_windows().all(|[a, b]|\n        a.skip_binder().stable_cmp(self, &b.skip_binder()) !=\n            Ordering::Greater)', compiler/rustc_middle/src/ty/context.rs:2684:9
stack backtrace:
   0:     0x7fa29ff2f460 - std::backtrace_rs::backtrace::libunwind::trace::h845489be954216a1
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fa29ff2f460 - std::backtrace_rs::backtrace::trace_unsynchronized::hc22c3fc36941637e
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fa29ff2f460 - std::sys_common::backtrace::_print_fmt::h21566367032e35d4
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fa29ff2f460 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h72366b9f7489658b
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fa29ff8b42e - core::fmt::write::h1440c0152f5352ee
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7fa29ff1f545 - std::io::Write::write_fmt::h01a0c683f4011cbd
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/io/mod.rs:1680:15
   6:     0x7fa29ff32203 - std::sys_common::backtrace::_print::hb6b7d9350a1bf6ea
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fa29ff32203 - std::sys_common::backtrace::print::h5fef162fa4c4a90c
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fa29ff32203 - std::panicking::default_hook::{{closure}}::h91c8dfae313a0a3c
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/panicking.rs:267:22
   9:     0x7fa29ff31eda - std::panicking::default_hook::hd50d8a920cc08614
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/panicking.rs:286:9
  10:     0x7fa2a286aff1 - rustc_driver[7242de1449df662b]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fa29ff32a3b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4f4e2f6011476f3f
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/alloc/src/boxed.rs:1952:9
  12:     0x7fa29ff32a3b - std::panicking::rust_panic_with_hook::h23e14c7d62d93ab4
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/panicking.rs:673:13
  13:     0x7fa29ff32851 - std::panicking::begin_panic_handler::{{closure}}::hfe0bce4b7c5df181
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/panicking.rs:558:13
  14:     0x7fa29ff2f90c - std::sys_common::backtrace::__rust_end_short_backtrace::h2e38c83ce0dfcc0c
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys_common/backtrace.rs:138:18
  15:     0x7fa29ff325b2 - rust_begin_unwind
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/panicking.rs:556:5
  16:     0x7fa29ff88003 - core::panicking::panic_fmt::h0c090a9cb6ea02e8
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/core/src/panicking.rs:142:14
  17:     0x7fa29ff87e4d - core::panicking::panic::h4ccf6771b2a2af6d
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/core/src/panicking.rs:48:5
  18:     0x7fa2a19ac74e - <rustc_middle[95e307ed1fbbba30]::ty::context::TyCtxt>::intern_poly_existential_predicates
  19:     0x7fa2a22dfe75 - <rustc_middle[95e307ed1fbbba30]::ty::sty::Binder<rustc_middle[95e307ed1fbbba30]::ty::sty::ExistentialPredicate> as rustc_type_ir[9e4a1c58889f4edf]::InternIteratorElement<rustc_middle[95e307ed1fbbba30]::ty::sty::Binder<rustc_middle[95e307ed1fbbba30]::ty::sty::ExistentialPredicate>, &rustc_middle[95e307ed1fbbba30]::ty::list::List<rustc_middle[95e307ed1fbbba30]::ty::sty::Binder<rustc_middle[95e307ed1fbbba30]::ty::sty::ExistentialPredicate>>>>::intern_with::<core[3ffd720ca1c42488]::iter::adapters::chain::Chain<core[3ffd720ca1c42488]::iter::sources::once::Once<rustc_middle[95e307ed1fbbba30]::ty::sty::Binder<rustc_middle[95e307ed1fbbba30]::ty::sty::ExistentialPredicate>>, core[3ffd720ca1c42488]::iter::adapters::filter_map::FilterMap<rustc_infer[ad47d2b440a203e4]::traits::util::Elaborator, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_ty_for_trait::{closure#0}::{closure#1}>>, <rustc_middle[95e307ed1fbbba30]::ty::context::TyCtxt>::mk_poly_existential_predicates<core[3ffd720ca1c42488]::iter::adapters::chain::Chain<core[3ffd720ca1c42488]::iter::sources::once::Once<rustc_middle[95e307ed1fbbba30]::ty::sty::Binder<rustc_middle[95e307ed1fbbba30]::ty::sty::ExistentialPredicate>>, core[3ffd720ca1c42488]::iter::adapters::filter_map::FilterMap<rustc_infer[ad47d2b440a203e4]::traits::util::Elaborator, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_ty_for_trait::{closure#0}::{closure#1}>>>::{closure#0}>
  20:     0x7fa2a236e815 - rustc_trait_selection[1972b1c7572a008]::traits::object_safety::virtual_call_violation_for_method
  21:     0x7fa2a24f94f8 - rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violation_for_method
  22:     0x7fa2a24f93a3 - <core[3ffd720ca1c42488]::iter::adapters::map::Map<core[3ffd720ca1c42488]::iter::adapters::map::Map<core[3ffd720ca1c42488]::slice::iter::Iter<(rustc_span[db13f476b7ea05ff]::symbol::Symbol, &rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem)>, <rustc_data_structures[ea39d62d1b4f5af4]::sorted_map::index_map::SortedIndexMultiMap<u32, rustc_span[db13f476b7ea05ff]::symbol::Symbol, &rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItems>::in_definition_order::{closure#0}> as core[3ffd720ca1c42488]::iter::traits::iterator::Iterator>::try_fold::<(), core[3ffd720ca1c42488]::iter::adapters::filter::filter_try_fold<&rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem, (), core[3ffd720ca1c42488]::ops::control_flow::ControlFlow<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#0}, core[3ffd720ca1c42488]::iter::adapters::filter_map::filter_map_try_fold<&rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem, rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation, (), core[3ffd720ca1c42488]::ops::control_flow::ControlFlow<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#1}, core[3ffd720ca1c42488]::iter::traits::iterator::Iterator::find::check<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation, &mut rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#2}>::{closure#0}>::{closure#0}>::{closure#0}, core[3ffd720ca1c42488]::ops::control_flow::ControlFlow<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>>
  23:     0x7fa2a24f9165 - <alloc[86689f62ac00be20]::vec::Vec<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation> as alloc[86689f62ac00be20]::vec::spec_from_iter::SpecFromIter<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation, core[3ffd720ca1c42488]::iter::adapters::filter::Filter<core[3ffd720ca1c42488]::iter::adapters::filter_map::FilterMap<core[3ffd720ca1c42488]::iter::adapters::filter::Filter<core[3ffd720ca1c42488]::iter::adapters::map::Map<core[3ffd720ca1c42488]::iter::adapters::map::Map<core[3ffd720ca1c42488]::slice::iter::Iter<(rustc_span[db13f476b7ea05ff]::symbol::Symbol, &rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem)>, <rustc_data_structures[ea39d62d1b4f5af4]::sorted_map::index_map::SortedIndexMultiMap<u32, rustc_span[db13f476b7ea05ff]::symbol::Symbol, &rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[95e307ed1fbbba30]::ty::assoc::AssocItems>::in_definition_order::{closure#0}>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#0}>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#1}>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations_for_trait::{closure#2}>>>::from_iter
  24:     0x7fa2a24f8391 - <&mut rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations::{closure#0} as core[3ffd720ca1c42488]::ops::function::FnOnce<(rustc_span[db13f476b7ea05ff]::def_id::DefId,)>>::call_once
  25:     0x7fa2a24f7fbe - <core[3ffd720ca1c42488]::iter::adapters::flatten::FlatMap<rustc_trait_selection[1972b1c7572a008]::traits::util::SupertraitDefIds, alloc[86689f62ac00be20]::vec::Vec<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations::{closure#0}> as core[3ffd720ca1c42488]::iter::traits::iterator::Iterator>::next
  26:     0x7fa2a24f79fc - <smallvec[7c0c6c3d22c8eff2]::SmallVec<[rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation; 8usize]> as core[3ffd720ca1c42488]::iter::traits::collect::Extend<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>>::extend::<core[3ffd720ca1c42488]::iter::adapters::flatten::FlatMap<rustc_trait_selection[1972b1c7572a008]::traits::util::SupertraitDefIds, alloc[86689f62ac00be20]::vec::Vec<rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation>, rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations::{closure#0}>>
  27:     0x7fa2a24f7781 - rustc_trait_selection[1972b1c7572a008]::traits::object_safety::object_safety_violations
  28:     0x7fa2a25e9910 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::try_execute_query::<rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt, rustc_query_system[1567c4f72cef5d5a]::query::caches::DefaultCache<rustc_span[db13f476b7ea05ff]::def_id::DefId, &[rustc_middle[95e307ed1fbbba30]::traits::ObjectSafetyViolation]>>
  29:     0x7fa2a25e9576 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::get_query::<rustc_query_impl[5acd0bb7c17f3c56]::queries::object_safety_violations, rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt>
  30:     0x7fa2a1597032 - <rustc_middle[95e307ed1fbbba30]::ty::context::TyCtxt>::is_object_safe
  31:     0x7fa2a1585ab4 - <rustc_trait_selection[1972b1c7572a008]::traits::fulfill::FulfillProcessor as rustc_data_structures[ea39d62d1b4f5af4]::obligation_forest::ObligationProcessor>::process_obligation
  32:     0x7fa2a157ea89 - <rustc_data_structures[ea39d62d1b4f5af4]::obligation_forest::ObligationForest<rustc_trait_selection[1972b1c7572a008]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[1972b1c7572a008]::traits::fulfill::FulfillProcessor>
  33:     0x7fa2a1c0f32f - <rustc_trait_selection[1972b1c7572a008]::traits::engine::ObligationCtxt>::select_all_or_error
  34:     0x7fa2a1a99dcf - rustc_hir_analysis[c205a317ae4aae01]::check::wfcheck::check_item_fn
  35:     0x7fa2a1a92b98 - rustc_hir_analysis[c205a317ae4aae01]::check::wfcheck::check_well_formed
  36:     0x7fa2a181b6ac - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::get_query::<rustc_query_impl[5acd0bb7c17f3c56]::queries::check_well_formed, rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt>
  37:     0x7fa2a22e68df - rustc_data_structures[ea39d62d1b4f5af4]::sync::par_for_each_in::<&[rustc_hir[81ae391e231f8c5f]::hir::ItemId], <rustc_middle[95e307ed1fbbba30]::hir::ModuleItems>::par_items<rustc_hir_analysis[c205a317ae4aae01]::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>
  38:     0x7fa2a26b3151 - rustc_hir_analysis[c205a317ae4aae01]::check::wfcheck::check_mod_type_wf
  39:     0x7fa2a1e7fba5 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::try_execute_query::<rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt, rustc_query_system[1567c4f72cef5d5a]::query::caches::DefaultCache<rustc_span[db13f476b7ea05ff]::def_id::LocalDefId, ()>>
  40:     0x7fa2a228a8e9 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::get_query::<rustc_query_impl[5acd0bb7c17f3c56]::queries::check_mod_type_wf, rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt>
  41:     0x7fa2a2261a38 - rustc_data_structures[ea39d62d1b4f5af4]::sync::par_for_each_in::<&[rustc_hir[81ae391e231f8c5f]::hir_id::OwnerId], <rustc_middle[95e307ed1fbbba30]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[c205a317ae4aae01]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  42:     0x7fa2a2261843 - <rustc_session[33be129fa9a3b2db]::session::Session>::track_errors::<rustc_hir_analysis[c205a317ae4aae01]::check_crate::{closure#5}, ()>
  43:     0x7fa2a22605b0 - rustc_hir_analysis[c205a317ae4aae01]::check_crate
  44:     0x7fa2a2260137 - rustc_interface[b5c7f094b608ea39]::passes::analysis
  45:     0x7fa2a25f5da4 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::try_execute_query::<rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt, rustc_query_system[1567c4f72cef5d5a]::query::caches::DefaultCache<(), core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>>
  46:     0x7fa2a25f5ad7 - rustc_query_system[1567c4f72cef5d5a]::query::plumbing::get_query::<rustc_query_impl[5acd0bb7c17f3c56]::queries::analysis, rustc_query_impl[5acd0bb7c17f3c56]::plumbing::QueryCtxt>
  47:     0x7fa2a1452614 - <rustc_interface[b5c7f094b608ea39]::passes::QueryContext>::enter::<rustc_driver[7242de1449df662b]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>
  48:     0x7fa2a144ea66 - <rustc_interface[b5c7f094b608ea39]::interface::Compiler>::enter::<rustc_driver[7242de1449df662b]::run_compiler::{closure#1}::{closure#2}, core[3ffd720ca1c42488]::result::Result<core[3ffd720ca1c42488]::option::Option<rustc_interface[b5c7f094b608ea39]::queries::Linker>, rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>
  49:     0x7fa2a1449a0c - rustc_span[db13f476b7ea05ff]::with_source_map::<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_interface[b5c7f094b608ea39]::interface::create_compiler_and_run<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_driver[7242de1449df662b]::run_compiler::{closure#1}>::{closure#1}>
  50:     0x7fa2a144940f - rustc_interface[b5c7f094b608ea39]::interface::create_compiler_and_run::<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_driver[7242de1449df662b]::run_compiler::{closure#1}>
  51:     0x7fa2a1448602 - <scoped_tls[f5e6faabecdf262b]::ScopedKey<rustc_span[db13f476b7ea05ff]::SessionGlobals>>::set::<rustc_interface[b5c7f094b608ea39]::interface::run_compiler<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_driver[7242de1449df662b]::run_compiler::{closure#1}>::{closure#0}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>
  52:     0x7fa2a1447adf - std[a6dc0af1ec52a2ce]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b5c7f094b608ea39]::util::run_in_thread_pool_with_globals<rustc_interface[b5c7f094b608ea39]::interface::run_compiler<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_driver[7242de1449df662b]::run_compiler::{closure#1}>::{closure#0}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>::{closure#0}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>
  53:     0x7fa2a2687240 - <<std[a6dc0af1ec52a2ce]::thread::Builder>::spawn_unchecked_<rustc_interface[b5c7f094b608ea39]::util::run_in_thread_pool_with_globals<rustc_interface[b5c7f094b608ea39]::interface::run_compiler<core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>, rustc_driver[7242de1449df662b]::run_compiler::{closure#1}>::{closure#0}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>::{closure#0}, core[3ffd720ca1c42488]::result::Result<(), rustc_errors[9e9e85828f9a000d]::ErrorGuaranteed>>::{closure#1} as core[3ffd720ca1c42488]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  54:     0x7fa29ff3c643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2a8f9144a9e03d40
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/alloc/src/boxed.rs:1938:9
  55:     0x7fa29ff3c643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0460607c3f53db9e
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/alloc/src/boxed.rs:1938:9
  56:     0x7fa29ff3c643 - std::sys::unix::thread::Thread::new::thread_start::h5611122d9afa23bd
                               at /rustc/a6b7274a462829f8ef08a1ddcdcec7ac80dbf3e1/library/std/src/sys/unix/thread.rs:108:17
  57:     0x7fa29fc928fd - <unknown>
  58:     0x7fa29fd14a60 - <unknown>
  59:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

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.66.0-nightly (a6b7274a4 2022-10-10) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [object_safety_violations] determine object safety of trait `ThriftService`
#1 [check_well_formed] checking that `with_factory` is well-formed
#2 [check_mod_type_wf] checking that types are well-formed in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors; 4 warnings emitted

For more information about this error, try `rustc --explain E0277`.

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Oct 11, 2022
@matthiaskrgr
Copy link
Member Author

searched toolchains 81f3919 through a6b7274


Regression in 0265a3e

hmm

@compiler-errors
Copy link
Member

compiler-errors commented Oct 11, 2022

@matthiaskrgr what's your system? do you have debug builds on? I can't seem to repro this on master.

edit: oops, first question i guess is x86_64-unknown-linux-gnu

@matthiaskrgr
Copy link
Member Author

no this is not with debug build on, its just the normal master toolchain installed via rustup-toolchain-install-master -f -n master -c rustc-dev llvm-tools rust-src clippy rust-analyzer rustfmt miri on x86

@compiler-errors
Copy link
Member

Literally can't repro this locally. I'm pretty sure that I know the reason why (the object_ty_for_trait function, which is called from virtual_call_violation_for_method isn't actually returning a sorted list of elaborated predicates). This must be because we're calculating def path hash or something differently between the CI master build and a local build of master.

@matthiaskrgr
Copy link
Member Author

so you can't even repro with the official master artifacts? :| or just not with a local build?

@compiler-errors
Copy link
Member

Sorry, I can repro with the master artifacts. But not with a local build of master, which makes testing the change that I want to make to fix this issue difficult.

@compiler-errors
Copy link
Member

compiler-errors commented Oct 12, 2022

Actually, repro on stable whoops I mean nightly:

use std::future::Future;

pub trait Service {
    type Response;
    type Future: Future<Output = Self::Response>;
}

pub trait ThriftService: Service<Future = Box<dyn Future<Output = i32>>, Response = i32> {
    fn foo(&self) {}
}

pub trait ThriftService2: Service<Response = i32, Future = Box<dyn Future<Output = i32>>> {
    fn foo(&self) {}
}

fn main() {
    let x: &dyn ThriftService = todo!();
    let y: &dyn ThriftService2 = todo!();
}

This should be a UI test that is resilient to def path hashing changes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants