-
Notifications
You must be signed in to change notification settings - Fork 722
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: Cleanup name duplication in aliases and named types. #461
Conversation
It's just dumb.
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.
Great! r=me
_ => false, | ||
} | ||
} | ||
|
||
/// Creates a new named type, with name `name`. | ||
pub fn named(name: String) -> Self { | ||
assert!(!name.is_empty()); | ||
// TODO: stop duplicating the name, it's stupid. |
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.
hehehe
@@ -143,17 +127,15 @@ impl Type { | |||
TypeKind::BlockPointer | | |||
TypeKind::Int(..) | | |||
TypeKind::Float(..) | | |||
TypeKind::Named(..) => true, | |||
TypeKind::Named => true, | |||
_ => false, | |||
} | |||
} | |||
|
|||
/// Creates a new named type, with name `name`. | |||
pub fn named(name: String) -> Self { | |||
assert!(!name.is_empty()); |
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 it would be good to assert about identifiers like we now do in codegen here as well?
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.
Well, the point is that invalid identifiers may come here, we just don't want to generate code for them. It'd be good if they didn't, but more work needs to happen so that's true.
@bors-servo r=fitzgen |
📌 Commit a46971c has been approved by |
⚡ Test exempted - status |
ir: Cleanup name duplication in aliases and named types. It's just dumb. r? @fitzgen
It's just dumb.
r? @fitzgen