Skip to content

ICE: unexpected predicate TraitPredicate on opaque type #75983

Closed

Description

@matthiaskrgr

Found in the pr-75180 crater run:

git clone https://github.com/PaulGrandperrin/playground/  
cd playground
git checkout 572ff41ccdfa72771a37fd9ab89f37e9b5451041
cargo check

ICEs:

error: internal compiler error: unexpected predicate TraitPredicate(<<std::rc::Rc<impl non_volatile::object::any_rc_object::Object> as std::convert::TryFrom<non_volatile::object::any_rc_object::AnyRcObject>>::Error as std::fmt::Debug>) on opaque type
  --> src/non_volatile/object/any_rc_object.rs:34:52
   |
34 |         <Rc<Self> as TryFrom<AnyRcObject>>::Error: Debug;
   |                                                    ^^^^^
   |
   = note: delayed at src/librustc_ty/ty.rs:480:18

error: internal compiler error: unexpected predicate TraitPredicate(<std::rc::Rc<impl non_volatile::object::any_rc_object::Object> as std::convert::TryFrom<non_volatile::object::any_rc_object::AnyRcObject>>) on opaque type
  --> src/non_volatile/object/any_rc_object.rs:33:19
   |
33 |         Rc<Self>: TryFrom<AnyRcObject>,
   |                   ^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at src/librustc_ty/ty.rs:480:18

error: internal compiler error: unexpected predicate TraitPredicate(<std::rc::Rc<impl non_volatile::object::any_rc_object::Object> as std::marker::Sized>) on opaque type
   --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:494:23
    |
494 | pub trait TryFrom<T>: Sized {
    |                       ^^^^^
    |
    = note: delayed at src/librustc_ty/ty.rs:480:18

error: internal compiler error: unexpected predicate TraitPredicate(<non_volatile::object::any_rc_object::AnyRcObject as std::convert::From<std::rc::Rc<impl non_volatile::object::any_rc_object::Object>>>) on opaque type
  --> src/non_volatile/object/any_rc_object.rs:32:22
   |
32 |         AnyRcObject: From<Rc<Self>>,
   |                      ^^^^^^^^^^^^^^
   |
   = note: delayed at src/librustc_ty/ty.rs:480:18

error: internal compiler error: unexpected predicate TraitPredicate(<non_volatile::object::any_rc_object::AnyRcObject as std::marker::Sized>) on opaque type
   --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:386:20
    |
386 | pub trait From<T>: Sized {
    |                    ^^^^^
    |
    = note: delayed at src/librustc_ty/ty.rs:480:18

error: internal compiler error: unexpected predicate TraitPredicate(<non_volatile::object::any_rc_object::AnyRcObject as std::convert::From<impl non_volatile::object::any_rc_object::Object>>) on opaque type
  --> src/non_volatile/object/any_rc_object.rs:31:77
   |
31 | pub trait Object = Serializable + ConstObjType + Default where AnyRcObject: From<Self>,
   |                                                                             ^^^^^^^^^^
   |
   = note: delayed at src/librustc_ty/ty.rs:480:18

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:369:17
stack backtrace:
   0: std::panicking::begin_panic
   1: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   2: core::ptr::drop_in_place
   3: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place
   5: rustc_span::with_source_map
   6: rustc_interface::interface::create_compiler_and_run
   7: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.47.0-nightly (2d8a3b918 2020-08-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-cpu=native --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `playground`.

To learn more, run the command again with --verbose.

This ICE happens on:
rustc 1.47.0-beta.1 (0f91f5c28 2020-08-25)
rustc 1.47.0-nightly (2d8a3b918 2020-08-26)
but rustc 1.45.2 (d3fb005a3 2020-07-31) builds fine.

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 27, 2020
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 27, 2020
  3. estebank commented on Aug 27, 2020

    @estebank
    Contributor

    Is this going out in the new stable?

  4. jonas-schievink commented on Aug 27, 2020

    @jonas-schievink
    Contributor

    Oh, this crate is full of unstable features, so no need to worry about stable

  5. added
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    on Aug 27, 2020
  6. LeSeulArtichaut commented on Aug 28, 2020

    @LeSeulArtichaut
    Contributor

    Oh, this crate is full of unstable features, so no need to worry about stable

    Then I guess it would be worth minimizing this to check that we're unable to reproduce this with no unstable features, and if we can't, it would still be good to have a test case for the "culprit feature".

  7. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Aug 28, 2020
  8. Skepfyr commented on Aug 29, 2020

    @Skepfyr
    Contributor

    I got it down to this, I haven't been able to remove trait_alias so I think short term it's fine.

    #![feature(trait_alias)]
    
    struct Bar;
    trait Foo {}
    impl Foo for Bar {}
    
    trait Baz = Foo where Bar: Foo;
    
    fn new() -> impl Baz {
        Bar
    }
  9. apiraino commented on Aug 31, 2020

    @apiraino
    Contributor

    @rustbot ping cleanup-crew
    I've tried roughly bisecting some nightlies, it starts somewhere between 2020-06-09...2020-07-09.

  10. rustbot commented on Aug 31, 2020

    @rustbot
    Collaborator

    Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
    "Cleanup ICE-breaking candidate". In case it's useful, here are some
    instructions for tackling these sorts of bugs. Maybe take a look?
    Thanks! <3

    cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke

  11. Skepfyr commented on Aug 31, 2020

    @Skepfyr
    Contributor

    I'm not sure why I didn't bisect this as I'm all set up to do it..... the regression was in nightly 2020-06-22, specifically somewhere in this rollup: 7058471

  12. spastorino commented on Sep 2, 2020

    @spastorino
    Member

    possibly #72788, cc @matthewjasper

  13. spastorino commented on Sep 2, 2020

    @spastorino
    Member

    Assigning P-medium given this requires-nightly as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

  14. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 2, 2020
  15. JohnTitor commented on Oct 7, 2020

    @JohnTitor
    Member

    Triage: This (#75983 (comment)) is no longer ICE with the latest nightly, it'd be great if someone could confirm whether the original is also fixed, marking as E-needs-test for now.

    EDIT: Confirmed that the original issue is also resolved, it's just compiled fine on my local.

  16. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    and removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Oct 7, 2020
  17. added a commit that references this issue on Oct 18, 2020
    cbc42a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-trait_alias`#![feature(trait_alias)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions