Skip to content

rustc build: Pretty bad error message when there is a syntax error in an flt file #137223

Open
@RalfJung

Description

@RalfJung

I tried putting this in an flt file:

monomorphize_abi_error_disabled_vector_type =
  this function {$call ->
    [true] call
    *[false] definition
  } uses SIMD vector type `{$ty}` which (with the chosen ABI) requires the `{$required_feature}` target feature, which is not enabled{$call ->
    [true] {" "}in the caller
    *[false] definition
  }
  .label = function {$call ->
    [true] called
    *[false] defined} here

The error I got during the build for that is:

error: expected one of "a-zA-Z"
 --> ../messages.ftl:3:1
  |
3 |   .label = function {$call ->
  | ^
  |

The error is very clear about the fact that the problem is on line 3. That's wrong though, the problem is on line 5 -- the .label must be defined like this:

  .label = function {$call ->
    [true] called
    *[false] defined
  } here

Cc @davidtwco

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-diagnosticsArea: Messages for errors, warnings, and lintsA-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticC-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