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

Compiler panics on missing 'fn'. #41389

Closed
ghost opened this issue Apr 19, 2017 · 1 comment
Closed

Compiler panics on missing 'fn'. #41389

ghost opened this issue Apr 19, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 19, 2017

Lets say you want to write this:

struct A {
    n: i32,
}

impl A {
    fn n(&self) -> i32 {
        self.n
    }
}

but you forget the fn

struct A {
    n: i32,
}

impl A {
    n(&self) -> i32 {
        self.n
    }
}

then the compiler responds with "note: the compiler unexpectedly panicked. this is a bug." I don't know if its possible but a "missing fn" message would be ideal or at least a "expected one of ! or ::, found ("

@petrochenkov
Copy link
Contributor

This should be fixed in #41282 and the fix is going to appear in the next nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant