Skip to content

rustc crash when trying to reference static export from another crate #24843

Closed

Description

https://gist.github.com/Eljay/24d13b4a27c4f6735b05

rustc just crashes with no useful errors. I guess you're not supposed to be able to do this anyway and it works if either are const instead of static but it shouldn't crash.

Tested with latest nightly and 1.0.0-beta.2 on windows 64-bit.

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Apr 26, 2015
  2. thomas-huet commented on Dec 26, 2016

    @thomas-huet

    No longer crashes:

    error[E0394]: cannot refer to other statics by value, use the address-of operator or a constant instead
     --> src/main.rs:3:35
      |
    3 | static TEST_STR_2: &'static str = &test::TEST_STR;
      |                                   ^^^^^^^^^^^^^^^ referring to another static by value
      |
      = note: use the address-of operator or a constant instead
    
  3. Mark-Simulacrum commented on May 18, 2017

    @Mark-Simulacrum
    Member

    E-needstest.

  4. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on May 18, 2017
  5. added
    C-bugCategory: This is a bug.
    and removed
    C-bugCategory: This is a bug.
    on Jul 22, 2017
  6. steveklabnik commented on Sep 24, 2018

    @steveklabnik
    Contributor

    Triage: not aware of any tests being added.

  7. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Oct 25, 2019
  8. mbrobbel commented on Nov 15, 2019

    @mbrobbel
    Contributor

    It seems that the E0394 error was removed in #51110 and the tests were moved from compile-fail and ui/error-codes to run-pass.

  9. added 3 commits that reference this issue on Apr 16, 2020
    40df0b9
    c3c96eb
    b347097
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

    C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions