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

ICE: unexpected predicate TraitPredicate on opaque type #75983

Closed
matthiaskrgr opened this issue Aug 27, 2020 · 10 comments · Fixed by #77956
Closed

ICE: unexpected predicate TraitPredicate on opaque type #75983

matthiaskrgr opened this issue Aug 27, 2020 · 10 comments · Fixed by #77956
Labels
A-traits Area: Trait system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-trait_alias `#![feature(trait_alias)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

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.

@matthiaskrgr matthiaskrgr added 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. labels Aug 27, 2020
@jonas-schievink jonas-schievink added A-traits Area: Trait system regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Aug 27, 2020
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 27, 2020
@estebank
Copy link
Contributor

Is this going out in the new stable?

@jonas-schievink
Copy link
Contributor

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

@jonas-schievink jonas-schievink added the requires-nightly This issue requires a nightly compiler in some way. label Aug 27, 2020
@LeSeulArtichaut LeSeulArtichaut removed the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Aug 28, 2020
@LeSeulArtichaut
Copy link
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".

@LeSeulArtichaut LeSeulArtichaut added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 28, 2020
@Skepfyr
Copy link
Contributor

Skepfyr commented Aug 29, 2020

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
}

@LeSeulArtichaut LeSeulArtichaut added the F-trait_alias `#![feature(trait_alias)]` label Aug 29, 2020
@apiraino
Copy link
Contributor

apiraino commented Aug 31, 2020

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

@rustbot rustbot added the ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections label Aug 31, 2020
@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2020

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

@Skepfyr
Copy link
Contributor

Skepfyr commented Aug 31, 2020

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

@spastorino
Copy link
Member

spastorino commented Sep 2, 2020

possibly #72788, cc @matthewjasper

@spastorino
Copy link
Member

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

@spastorino spastorino added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 2, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Sep 8, 2020
@JohnTitor
Copy link
Member

JohnTitor commented Oct 7, 2020

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.

@JohnTitor JohnTitor added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Oct 7, 2020
@bors bors closed this as completed in cbc42a0 Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-trait_alias `#![feature(trait_alias)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way. 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.

10 participants