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

Weird span positions for static recursion gate error #39865

Closed
est31 opened this issue Feb 15, 2017 · 2 comments
Closed

Weird span positions for static recursion gate error #39865

est31 opened this issue Feb 15, 2017 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@est31
Copy link
Member

est31 commented Feb 15, 2017

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

@est31
Copy link
Member Author

est31 commented Feb 15, 2017

cc also #29719

@jseyfried jseyfried added the A-diagnostics Area: Messages for errors, warnings, and lints label Feb 16, 2017
@est31 est31 changed the title Weird span positions for static recursion gate test Weird span positions for static recursion gate error Feb 16, 2017
@nrc
Copy link
Member

nrc commented Feb 23, 2017

Closed by #40027

@nrc nrc closed this as completed Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

3 participants