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

[breaking batch] remove the sign from integer literals in the ast #30508

Closed
wants to merge 2 commits into from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Dec 21, 2015

r? @eddyb

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

});
P(ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprUnary(ast::UnNeg, lit),
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't lit be returned early if the value is positive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed. fixed it

@eddyb
Copy link
Member

eddyb commented Dec 21, 2015

LGTM. r? @Manishearth for confirmal of acceptable breakage.

@rust-highfive rust-highfive assigned Manishearth and unassigned eddyb Dec 21, 2015
@Manishearth
Copy link
Member

This will likely cause aster breakage. I'm mostly okay with the clippy breakage this may cause (there's not much using this)

@Manishearth
Copy link
Member

cc @erickt @nrc

We might want to batch this up with other syntax breaking changes

@nrc
Copy link
Member

nrc commented Dec 22, 2015

What's the motivation for this work?

Seems like a good change to make to the HIR, not sure if it is a good change for the AST - does this conflate different source situations? (-5 vs - 5 or anything).

At the least, this should be batched with other changes.

@eddyb
Copy link
Member

eddyb commented Dec 22, 2015

@nrc Rust doesn't have -5 literals and the AST was misrepresenting that fact.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 22, 2015

The only way to get a -5 literal was to create it in a compiler plugin. So I'm not even sure if the current trans code did what it was supposed to, but it was also hard to check whether it did. The HIR could potentially fold ExprUnary(Neg, Lit) into some kind of signed literal.

@nrc
Copy link
Member

nrc commented Dec 22, 2015

@eddyb as in, the sign field in the int lit types was always Plus (except with syntax extensions)?

@nrc
Copy link
Member

nrc commented Dec 22, 2015

In which case, this sounds like a good change, but I'd still like to see it batched with other changes since it is non-urgent.

@Manishearth
Copy link
Member

Should we add some kind of github label for these PRs so it's easy to find them when we need to batch up? plugins-breaking or something

@oli-obk oli-obk force-pushed the unsigned_ast branch 2 times, most recently from 45cd3c4 to 2bb0d02 Compare December 23, 2015 16:07
@bors
Copy link
Contributor

bors commented Jan 12, 2016

☔ The latest upstream changes (presumably #30826) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix
Copy link
Member

@Manishearth

I vote for "breaking-batch"

(Apologies to Walter White)

@oli-obk oli-obk changed the title remove the sign from integer literals in the ast [breaking batch] remove the sign from integer literals in the ast Jan 25, 2016
@steveklabnik
Copy link
Member

This has been rebased, is it ready to go?

@Manishearth
Copy link
Member

@oli-obk want to uplift this to the mega-breaking-batch PR? Since that will probably bitrot this when it lands.

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 9, 2016

want to uplift this to the mega-breaking-batch PR? Since that will probably bitrot this when it lands.

already done

@oli-obk oli-obk closed this Feb 9, 2016
@oli-obk oli-obk deleted the unsigned_ast branch June 15, 2020 15:25
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.

8 participants