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

Projects
None yet
8 participants
@oli-obk
Copy link
Contributor

oli-obk commented Dec 21, 2015

r? @eddyb

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 21, 2015

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),

This comment has been minimized.

@eddyb

eddyb Dec 21, 2015

Member

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

This comment has been minimized.

@oli-obk

oli-obk Dec 21, 2015

Author Contributor

indeed. fixed it

@oli-obk oli-obk force-pushed the oli-obk:unsigned_ast branch from 5dfafe2 to 4c6a8ba Dec 21, 2015

@eddyb

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

Manishearth commented Dec 21, 2015

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

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Dec 22, 2015

cc @erickt @nrc

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

@nrc

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

eddyb commented Dec 22, 2015

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

@oli-obk

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

Manishearth commented Dec 23, 2015

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 oli-obk:unsigned_ast branch 2 times, most recently from 45cd3c4 to 2bb0d02 Dec 23, 2015

@bors

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

pnkfelix commented Jan 12, 2016

@Manishearth

I vote for "breaking-batch"

(Apologies to Walter White)

@oli-obk oli-obk force-pushed the oli-obk:unsigned_ast branch from d2bd889 to cdf67c6 Jan 14, 2016

Oliver 'ker' Schneider and others added some commits Dec 23, 2015

@oli-obk oli-obk force-pushed the oli-obk:unsigned_ast branch from cdf67c6 to 7fae645 Jan 17, 2016

@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

This comment has been minimized.

Copy link
Member

steveklabnik commented Feb 8, 2016

This has been rebased, is it ready to go?

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Feb 8, 2016

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

@oli-obk

This comment has been minimized.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.