Skip to content

Weird span positions for static recursion gate error #39865

Closed
@est31

Description

@est31
Member

If you consider the following example:

struct StaticDoubleLinked {
    prev: &'static StaticDoubleLinked,
    next: &'static StaticDoubleLinked,
    data: i32,
    head: bool,
}

static L1: StaticDoubleLinked = StaticDoubleLinked{prev: &L3, next: &L2, data: 1, head: true};
static L2: StaticDoubleLinked = StaticDoubleLinked{prev: &L1, next: &L3, data: 2, head: false};
static L3: StaticDoubleLinked = StaticDoubleLinked{prev: &L2, next: &L1, data: 3, head: false};

fn main() {}

Then it generates three gate errors. The problem is that all three errors point to the line where L1 is defined. This is bad. cc #39834

Activity

est31

est31 commented on Feb 15, 2017

@est31
MemberAuthor

cc also #29719

changed the title [-]Weird span positions for static recursion gate test[/-] [+]Weird span positions for static recursion gate error[/+] on Feb 16, 2017
nrc

nrc commented on Feb 23, 2017

@nrc
Member

Closed by #40027

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-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nrc@jseyfried@est31

        Issue actions

          Weird span positions for static recursion gate error · Issue #39865 · rust-lang/rust