Skip to content

Raw string error note - #48546

Merged
alexcrichton merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:raw-string-error-note
Mar 6, 2018
Merged

Raw string error note#48546
alexcrichton merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:raw-string-error-note

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes#48395.

I think this note should be helpful enough to solve the issue.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 26, 2018
Comment threadsrc/test/ui/raw_string.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should be newline-terminated.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed.

@eddyb

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

Comment threadsrc/test/ui/raw_string.stderr Outdated

@estebankestebankFeb 27, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span should really only point at the first char and have a span label:


error: unterminated raw string
--> $DIR/raw_string.rs:12:13
|
12 | let x = r##"lol"#;
| ^ unterminated raw string
|
= note: this raw string must be terminated with `"##`

@estebank

Copy link
Copy Markdown
Contributor

Other than the nitpick, r=me

@nikomatsakis

Copy link
Copy Markdown
Contributor

r? @estebank

@estebankestebank added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2018
@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

Updated.

@estebankestebank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, r=me after addressing the nit-pick.

self.fatal_span_(from_pos, to_pos, &m[..])
}

fn struct_span_fatal(&self,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method necessary after the last change?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still yes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it being used only in fail_unterminated_raw_string above? The span for the error and the span_label could be made only once (self.mk_span(pos, pos)) and the message and label literal could be the same variable.

@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Mar 5, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 1c191b2 has been approved by estebank

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 5, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Mar 6, 2018
…e, r=estebank
Raw string error note
Fixesrust-lang#48395.
I think this note should be helpful enough to solve the issue.
@kennytmkennytm mentioned this pull request Mar 6, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Mar 6, 2018
…e, r=estebank
Raw string error note
Fixesrust-lang#48395.
I think this note should be helpful enough to solve the issue.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Mar 6, 2018
…e, r=estebank
Raw string error note
Fixesrust-lang#48395.
I think this note should be helpful enough to solve the issue.
bors added a commit that referenced this pull request Mar 6, 2018
Rollup of 14 pull requests
- Successful merges: #48403, #48432, #48546, #48573, #48590, #48657, #48727, #48732, #48753, #48754, #48761, #48474, #48507, #47463
- Failed merges:
@alexcrichton
alexcrichton merged commit 1c191b2 into rust-lang:masterMar 6, 2018
@GuillaumeGomez
GuillaumeGomez deleted the raw-string-error-note branch March 6, 2018 19:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@GuillaumeGomez@rust-highfive@eddyb@estebank@nikomatsakis@bors@varkor@alexcrichton