Skip to content

Weird span for #[bench] method error #52411

Open
@estebank

Description

@estebank

Given

#[bench]
fn bar(x: isize) { }

The current output is suboptimal:

error[E0308]: mismatched types
  --> $DIR/issue-12997-2.rs:16:1
   |
LL | fn bar(x: isize) { }
   | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference
   |
   = note: expected type `isize`
found type `&mut __test::test::Bencher`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions