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

libsyntax: update helper to stringify TyU* and TyI* to take value presence into account. #13452

Merged
merged 1 commit into from
Apr 13, 2014

Conversation

Ryman
Copy link
Contributor

@Ryman Ryman commented Apr 11, 2014

Fixes #13359.

@@ -131,9 +131,9 @@ pub fn is_path(e: @Expr) -> bool {
return match e.node { ExprPath(_) => true, _ => false };
}

pub fn int_ty_to_str(t: IntTy) -> ~str {
pub fn int_ty_to_str(t: IntTy, v: bool) -> ~str {
Copy link
Member

Choose a reason for hiding this comment

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

What is v?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True if you're going to print it alongside a value, false if not.
e.g. we want 7u8 but not 7uint

Want a doc, or a better name? I guess an Option param would be clearer?

Copy link
Member

Choose a reason for hiding this comment

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

A doc & a better name would be nice. :)

Could also be an enum like enum IntStrFormat { IntStrValue, IntStrType }.

@Ryman
Copy link
Contributor Author

Ryman commented Apr 12, 2014

Removed ~s and rebased on master.

@alexcrichton
Copy link
Member

Looks good to me! Could you squash the two commits together?

@Ryman
Copy link
Contributor Author

Ryman commented Apr 13, 2014

@alexcrichton done.

bors added a commit that referenced this pull request Apr 13, 2014
@bors bors closed this Apr 13, 2014
@bors bors merged commit 888517d into rust-lang:master Apr 13, 2014
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
…saturating, r=Veykril

add wrapping/checked/saturating assist

This addresses rust-lang#13452

I'm not sure about the structure of the code. I'm not sure if it needs to be 3 separate assists, and if that means it needs to be in 3 separate files as well.

Most of the logic is in `util.rs`, which feels funny to me, but there seems to be a pattern of 1 assist per file, and this seems better than duplicating the logic.

Let me know if anything needs changes 😁
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.

u is not a type, but is reported as if it were in mismatched types message
4 participants