Skip to content

long line breaks span note formatting #40157

Closed
@durka

Description

@durka
Contributor

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

Activity

changed the title [-]long source line runs into error span marker[/-] [+]long source breaks span note formatting[/+] on Feb 28, 2017
changed the title [-]long source breaks span note formatting[/-] [+]long line breaks span note formatting[/+] on Feb 28, 2017
sophiajt

sophiajt commented on Feb 28, 2017

@sophiajt
Contributor

I have a sneaking suspicion that this will require detecting the case where we're about to overwrite the message.

sophiajt

sophiajt commented on Feb 28, 2017

@sophiajt
Contributor

I'm not sure if we can detect the width of the terminal in a cross platform way. If we can, maybe we can use that to factor in how we draw the message

estebank

estebank commented on Mar 6, 2017

@estebank
Contributor

I don't think this is a problem with terminal width, but rather a bug in the positioning of the labels.

added a commit that references this issue on Mar 9, 2017

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

817c2e4
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Mar 9, 2017
added 2 commits that reference this issue on Mar 10, 2017

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

2ceadae

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

ef6979d
added 3 commits that reference this issue on Mar 10, 2017

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

57a9863

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

a98e38f

Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc

21c6cf6

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @steveklabnik@durka@sophiajt@estebank

        Issue actions

          long line breaks span note formatting · Issue #40157 · rust-lang/rust