Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

thread 'rustc' panicked at 'internal error: entered unreachable code', src/traverse.rs:763:29 #271

Open

Description

@hlb8122

Using latest master causes thread 'rustc' panicked at 'internal error: entered unreachable code', src/traverse.rs:763:29.

Activity

  1. JohnTitor commented on Feb 25, 2022

    @JohnTitor
    Member

    Could you provide your code (if it's public), backtrace, and/or environment? It's hard to debug with only the error message.

  2. hlb8122 commented on Feb 25, 2022

    @hlb8122
    Author

    Really sorry not able to divulge much more than my environment.

    System:    Kernel: 5.4.0-99-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 5.2.7 
               wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal 
    
  3. dario23 commented on May 8, 2022

    @dario23
    Contributor

    would you be willing/able to run with RUSTC_LOG=debug and check some things in the output?

    do you know which part of the code this crashes on, and can't share for some reason, or not sure where it crashes either?

    src/traverse.rs:763 is line 776 in current master, which is the case when neither the old nor the new item being compared has any lifetime in the type, but that comparison only goes until max(old.count_lifetimes, new.count_lifetimes), so one of the sides has to have a lifetime or the loop isn't entered in the first place; so i think unless we can get a bit more info on what the input looks like here, we won't be able to do much about it.

  4. leavelet commented on May 11, 2022

    @leavelet

    I also encountered this problem. The code is at casbin/casbin-rs
    Could you please take a look?

  5. dario23 commented on May 13, 2022

    @dario23
    Contributor

    i think i found what goes wrong here: the async-trait crate/#[async_trait] attribute do rewriting on functions, so they end up having has_self set to true, but the rewrite removes the &self param/lifetime, so we off-by-one in the loop in which we compare the lifetimes due to wrongly setting self_add == 1. (we index out of bounds of the generics entries, but due to using Vec::get and returning None for both "index out of bounds" and "the ith generic param is not a lifetime" this didn't pop up immediately at the location where it went wrong.)

    i have pushed a workaround to #295, but i'm not happy with it as a fix. still, please test if that fixes things for you.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions