Skip to content

long line breaks span note formatting #40157

Closed
@durka

Description

@durka

The note after line 5 is supposed to say `foo` dropped here while still borrowed.

$ cargo script -e 'println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });'
   Compiling expr v0.1.0 (file:///Users/alex/.cargo/.cargo/script-cache/expr-fbc7431f17311f94)
error: `foo` does not live long enough
 --> /Users/alex/.cargo/.cargo/script-cache/expr-fbc7431f17311f94/expr.rs:5:60
  |
5 | {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
  |  ----------------------------------------------------------^-------------d here while still borrowed
  |  |                                              |
  |  |                                              |
  |  |                                              borrow occurs here
  |  borrowed value needs to live until here
  |
  = note: this error originates in a macro outside of the current crate

cc @jonathandturner

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-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