Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librustc: back::link::sanitize support escape_utf8 #7488

Merged
merged 2 commits into from
Jul 1, 2013
Merged

librustc: back::link::sanitize support escape_utf8 #7488

merged 2 commits into from
Jul 1, 2013

Conversation

yichoi
Copy link
Contributor

@yichoi yichoi commented Jun 29, 2013

back::link::sanitize support escape_utf8
fix #7486

@emberian
Copy link
Member

@yichoi is this the same escaping that other tools use and accept?

@yichoi
Copy link
Contributor Author

yichoi commented Jun 30, 2013

@huonw
Copy link
Member

huonw commented Jun 30, 2013

This could probably be done by calling char::escape_default after filtering for @ .. , (or maybe escape_unicode would be better, after filtering for the ascii characters). Possibly:

 '@' => ...
 ...
 ',' => ...
 '0' .. '9' |
 'a' .. 'z' |
 'A' .. 'Z' => ...
 c => {
     result.push_char(`$`);
     result.push_str(char::escape_unicode(c).slice_from(1));
 }

which will encode things as $u1A2B and $U3C4D5E6F, depending on their length.

@yichoi
Copy link
Contributor Author

yichoi commented Jun 30, 2013

new commit push-forced again.
@huonw Thanks! much simper than before

}
}
}

// Underscore-qualify anything that didn't start as an ident.
Copy link
Member

Choose a reason for hiding this comment

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

Looks good! But I'm going to nitpick again... why is this deleted? (I literally have no idea about this, so I'm sure you know more... it just seems strange.)

@emberian
Copy link
Member

@yichoi the reason I ask is because we follow the GNU C++ name mangling scheme (I think), so all of our symbols can be put through a tool like c++filt. it would be good if we could use the same escaping scheme as them

@yichoi
Copy link
Contributor Author

yichoi commented Jun 30, 2013

@huonw thanks again, I would pass my mistake without your kind comment

@yichoi
Copy link
Contributor Author

yichoi commented Jun 30, 2013

@cmr do you know how c++filt handle escaping utf8 ?

@emberian
Copy link
Member

@yichoi it seems it does not, and that the linker does not error on utf8 symbol names, that must be an android-specific problem. this is a fine fix since it doesn't do escaping.

@huonw
Copy link
Member

huonw commented Jun 30, 2013

(I've r+'d this for now, I'll file a bug about "name mangling and unicode" when this goes through.)

@yichoi
Copy link
Contributor Author

yichoi commented Jul 1, 2013

rebased because of changes of char::escape_unicode

bors added a commit that referenced this pull request Jul 1, 2013
back::link::sanitize support escape_utf8
fix #7486
@bors bors closed this Jul 1, 2013
@bors bors merged commit 567cf30 into rust-lang:master Jul 1, 2013
@yichoi yichoi deleted the sanitize_utf8 branch July 1, 2013 23:19
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 29, 2021
Add primitive type support to disallowed_type lint

Closes rust-lang#6845

changelog: Enable the banning of primitive types in [`disallowed_type`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

run-pass utf8_idents fails on android (android as problem)
4 participants