Skip to content

Unable to match against secondary labels #141896

Open
@jieyouxu

Description

@jieyouxu

It seems there is no way to match label text other than error-pattern :/
I might fix that separately later hehe

Originally posted by @jdonszelmann in #141891 (comment)

Example stderr

error[E0596]: cannot borrow value as mutable, as it is not declared as mutable
  --> $DIR/borrowck-error-in-macro.rs:6:1
   |
LL | a::ice! {}
   | ^^^^^^^^^^
   | |
   | cannot borrow as mutable
   | a call in this macro requires a mutable binding due to mutable borrow of `d`
   |
   = note: this error originates in the macro `a::ice` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing this to be mutable
  --> $DIR/auxiliary/borrowck-error-in-macro.rs:6:17
   |
LL |             let mut c = || *d += 1;
   |                 +++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0596`.

AFAICT it's not yet possible to match cannot borrow as mutable with a NOTE 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-compiletest-annotationsArea: compiletest error annotationsC-bugCategory: This is a bug.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