-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unexpected panic with derive debug on non-item #43023
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
Comments
Minimized: struct Mount;
impl Mount {
#[derive(Debug)]
fn mount(a: ()) {}
} Though I'm only able to reproduce on stable and beta, not nightly |
This is on stable
|
I also seen this bug with the following code: fn main() { rustc 1.19.0 (0ade339 2017-07-17) |
@iWritei's ICE seems to be a different issue from @Boreeas's. Several reduced test cases: // ICE everywhere.
struct S;
impl S {
#[derive(Debug)]
fn f() {
file!(); // must invoke a macro.
}
} // ICE on beta, nightly; no ICE on stable.
trait TT {
#[derive(Debug)]
fn f();
} // ICE on beta, nightly; no ICE on stable.
trait TT {
#[derive(Debug)]
type F;
} The first new ICE happens with the impl<'a, 'b> PlaceholderExpander<'a, 'b> {
fn remove(&mut self, id: ast::NodeId) -> Expansion {
self.expansions.remove(&id).unwrap()
}
} Not sure about the rest, but they all involve an |
I ran into this again today, can this be improved somehow? |
Current compiler output is:
|
triage: P-high |
Fixed in #44757. |
@jseyfried Thanks for the fix, hope it gets merged soon. For my understanding and learning, is it possible for you to detail how you went about debugging this? I wouldn't know where to start, and since this PR is fairly simple in its changes, it would be probably a good one to learn from. Thanks :) |
Code:
I assume this is because of where I put the derive debug line.
The text was updated successfully, but these errors were encountered: