-
Notifications
You must be signed in to change notification settings - Fork 685
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
ir: Sanitize base names more aggressively #906
Conversation
r? @Manishearth cc @upsuper |
src/ir/ty.rs
Outdated
return Cow::Borrowed(name) | ||
} | ||
|
||
Cow::Owned(name.replace(|c| c == ' ' || c == ':' || c == '.' , "_")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe assert that it is a valid identifier after this treatment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps just replace all non-ident chars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with fitzgen's assert
9c00e02
to
20f2ed2
Compare
@bors-servo r=fitzgen,Manishearth |
📌 Commit 20f2ed2 has been approved by |
ir: Sanitize base names more aggressively This fixes stylo build failures when template instantiations tests caused a rust compile error due to a bad test name. This commit makes names better sanitized, preventing similar errors in the future.
💔 Test failed - status-travis |
@bors-servo retry
|
ir: Sanitize base names more aggressively This fixes stylo build failures when template instantiations tests caused a rust compile error due to a bad test name. This commit makes names better sanitized, preventing similar errors in the future.
💔 Test failed - status-travis |
This fixes stylo build failures when template instantiations tests caused a rust compile error due to a bad test name. This commit makes names better sanitized, preventing similar errors in the future.
20f2ed2
to
b2bed30
Compare
or maybe I'm just stupid. The assertion doesn't hold for every type because of stuff like @bors-servo r=manishearth,fitzgen |
📌 Commit b2bed30 has been approved by |
ir: Sanitize base names more aggressively This fixes stylo build failures when template instantiations tests caused a rust compile error due to a bad test name. This commit makes names better sanitized, preventing similar errors in the future.
☀️ Test successful - status-travis |
This fixes stylo build failures when template instantiations tests caused a rust
compile error due to a bad test name.
This commit makes names better sanitized, preventing similar errors in the
future.