Skip to content

derived traits do not have a location #4433

@P-E-P

Description

@P-E-P

Summary

In attributes, the traits to derive do not have a correct locus

#[derive(MyTrait)]
//         ^ here
// [...]

this means the error emitted on those items won't have a correct line/column reporting

Reproducer

I tried this code:

#![feature(no_core)]
#![no_core]

#[derive(Toto)]
struct Test {
}

Does the code make use of any (1.49) nightly feature ?

  • Nightly

Godbolt link

https://godbolt.org/z/91ojhcz5f

Actual behavior

The current behavior is: no line number

Expected behavior

I expected to see a line/column prefix on the error message

GCC Version

1c6d3bf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions