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

Remove __rust_force_expr. #126929

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Commits on Jun 25, 2024

  1. Remove __rust_force_expr.

    This was added (with a different name) to improve an error message. It
    is no longer needed -- removing it changes the error message, but overall
    I think the new message is no worse:
    - the mention of `#` in the first line is a little worse,
    - but the extra context makes it very clear what the problem is, perhaps
      even clearer than the old message,
    - and the removal of the note about the `expr` fragment (an internal
      detail of `__rust_force_expr`) is an improvement.
    
    Overall I think the error is quite clear and still far better than the
    old message that prompted rust-lang#61933, which didn't even mention patterns.
    
    The motivation for this is rust-lang#124141, which will cause pasted
    metavariables to be tokenized and reparsed instead of the AST node being
    cached. This change in behaviour occasionally has a non-zero perf cost,
    and `__rust_force_expr` causes the tokenize/reparse step to occur twice.
    Removing `__rust_force_expr` greatly reduces the extra overhead for the
    `deep-vector` benchmark.
    nnethercote committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    9828e96 View commit details
    Browse the repository at this point in the history