Skip to content

Inspecific span when struct has no field #8263

Closed
@emberian

Description

@emberian
struct Foo {
    f: uint
}

struct Bar {
    foo: uint
}

fn foo(f: Bar) -> Foo {
    Foo {
        foo: f.foo
    }
}
foo.rs:11:8: 11:18 error: structure has no field named `foo`
foo.rs:11         foo: f.foo
                  ^~~~~~~~~~
error: aborting due to previous error

A different error is given if f has no field foo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions