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

proc macro errors are attached to the wrong location in diagnostics. #13616

Closed
jhgg opened this issue Nov 13, 2022 · 1 comment · Fixed by #13639
Closed

proc macro errors are attached to the wrong location in diagnostics. #13616

jhgg opened this issue Nov 13, 2022 · 1 comment · Fixed by #13639
Assignees
Labels
A-proc-macro proc macro Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@jhgg
Copy link
Contributor

jhgg commented Nov 13, 2022

this is a regression of #12657 which was fixed by #12691

Here are some ways to reproduce it, each which seem to map the error span to weird locations:

image

use serde::Deserialize;

fn main() {}

#[derive(Deserialize)]
#[serde(rename_all = "wrong")]
struct Foo {}

And from the original issue report:

image

#[tokio::main(heck)]
async fn main() {}

fn world() {
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
    println!("hello");
}

rust-analyzer version: 0.4.1283-standalone
rustc version: 1.65.0 (897e37553 2022-11-02)

@Veykril Veykril added Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug A-proc-macro proc macro labels Nov 14, 2022
@Veykril
Copy link
Member

Veykril commented Nov 14, 2022

We should probably try to make a test for this proc-macro behavior at least 😬 (curious to see what regressed this 🤔)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macro proc macro Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants