Skip to content

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

Closed
@jhgg

Description

@jhgg

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)

Metadata

Metadata

Assignees

Labels

A-proc-macroproc macroBroken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions