Skip to content

"doesn't have a size known at compile-time" should underline the type, not the whole size_of function #61860

Closed
@scottmcm

Description

@scottmcm

Low-importance nitpick: If I do

std::mem::size_of::<[String]>()

I get an error like

2 | std::mem::size_of::<[String]>()
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time

Arguably I should get a smaller underline like this:

2 | std::mem::size_of::<[String]>()
  |                     ^^^^^^^^ doesn't have a size known at compile-time

because it's the generic argument that doesn't have the size, not the function.

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.P-lowLow priorityT-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