Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RalfJung opened this issue Feb 18, 2025 · 0 comments
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

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

@RalfJung RalfJung added the A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust label Feb 18, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 18, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 18, 2025
@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants