Skip to content

Conversation

estebank
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Contributor

r? @arielb1

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

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 18, 2017
@arielb1
Copy link
Contributor

arielb1 commented Dec 18, 2017

I'm worried this might call def_span on random-ish AST nodes (whatever is passed to visit_name), with possibly random results. What are the sort of nodes that are supposed to be valid input to def_span?

@estebank
Copy link
Contributor Author

@arielb1 def_span is an outright hack that takes everything in the original span until the next occurrence of the char {, or the full span if it reaches newline before then. The case where this could be a problem would be if a user tried something like type My{Weird}Type;, but that would get caught by the parser.

|
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable

error: non-ascii idents are not fully supported. (see issue #28979)
--> $DIR/feature-gate-non_ascii_idents.rs:34:5
|
34 | / Bäz { //~ ERROR non-ascii idents
35 | | qüx: isize //~ ERROR non-ascii idents
Copy link
Member

Choose a reason for hiding this comment

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

Why doesn't this line give an error?

Copy link
Contributor Author

@estebank estebank Dec 19, 2017

Choose a reason for hiding this comment

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

Good question. It wasn't already, would have to check.
@bjorn3 that error is being emitted further down, it's just hidden in the diff because it didn't change in this PR :)

@arielb1
Copy link
Contributor

arielb1 commented Dec 25, 2017

r? @petrochenkov

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 26, 2017

📌 Commit 502d570 has been approved by petrochenkov

@bors
Copy link
Collaborator

bors commented Dec 27, 2017

⌛ Testing commit 502d570 with merge e8098c5...

bors added a commit that referenced this pull request Dec 27, 2017
Use def span for non-ascii ident feature gate error
@bors
Copy link
Collaborator

bors commented Dec 27, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing e8098c5 to master...

@bors bors merged commit 502d570 into rust-lang:master Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants