Skip to content

removal of fail keyword Issue #4524 #4721

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

Closed
wants to merge 2 commits into from
Closed

removal of fail keyword Issue #4524 #4721

wants to merge 2 commits into from

Conversation

nickdesaulniers
Copy link

Removed fail keyword. 2 of the 3 steps here. The followup pull request will be replacing die! with fail! after a new snapshot is created. The first commit removes almost all invocations of fail with die!, the rest are caught in the second after fail is removed from the lexer & parser. Tests are green after applying the first or both patches. I'd like to separate these from the final commit that involves a new snapshot. Heads up @bstrie & @brson.

fail fmt!("The .times method expects a nonnegative number, \
but found %?", self);
die!(fmt!("The .times method expects a nonnegative number, \
but found %?", self));
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated observation here, but I wonder how hard it would be to make die! act like debug! et al with respect to having an implicit fmt! inside of it.

@nickdesaulniers
Copy link
Author

Referencing Issue #4524

@bstrie
Copy link
Contributor

bstrie commented Feb 1, 2013

Heh, I've never before seen a patch so long that Github refuses to show its complete diff. Looks good, though I'm not qualified to comment on the part about ripping out the fail keyword itself.

@nickdesaulniers
Copy link
Author

Awesome! Thanks for taking the time to review it for me @bstrie! I appreciate it!

@brson
Copy link
Contributor

brson commented Feb 1, 2013

There were some big merge conflicts (there have been a lot of wide-reaching changes going in lately), so I've pushed just the first commit converting to die!(), minus all the conflicting bits. That's the bulk of your work merged.

The next step is to rebase your branch onto mozilla/incoming and fix all the merge conflicts ... and everything will be a conflict :-D. @nickdesaulniers would you mind trying to do that? It's not going to be pleasant, and I'm sorry about that, but it's the nature of these big syntax changes.

@nickdesaulniers
Copy link
Author

That's ok, I need some experience with merge conflict resolution. So I think I've done it right. Either 100% correct or 100% wrong. Building now. Seeing warnings when building src/libcore/private/finally.rs L35 warning: argument 1 uses by-copy mode. Not sure that I caused that. Will have an incoming pull request shortly, hopefully!

@brson
Copy link
Contributor

brson commented Feb 1, 2013

@nickdesaulniers The warning is unrelated. Before we do a snapshot you will need to create a duplicate definition of die! called fail!. Once the snapshot compiler knows how to interpret fail! you can start using it.

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.

3 participants