Skip to content

Made ast::blk not use spanned<T> anymore. #7826

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

Conversation

michaelwoerister
Copy link
Member

This is the first of a series of refactorings to get rid of the codemap::spanned<T> struct (see this thread for more information: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004798.html).

The changes in this PR should not change any semantics, just rename ast::blk_ to ast::blk and add a span field to it. 95% of the changes were of the form block.node.id -> block.id. Only some transformations in libsyntax::fold where not entirely trivial.

pnkfelix and others added 4 commits July 10, 2013 09:35
… semantics.

Also added unit tests of range code to test refactoring.  The
num-range-rev.rs test will need to be updated when the range_rev
semantics change.
@graydon
Copy link
Contributor

graydon commented Jul 16, 2013

While you're doing these, if you do renamings of structs, it would be nice to change them to the current convention of camelcase. That is, Block rather than blk.

@michaelwoerister
Copy link
Member Author

Sure, I'm glad to help.

ozten and others added 5 commits July 16, 2013 12:47
…fclosedness-issue5270-2ndpr, r=cmr

Changes int/uint range_rev to iterate over range `(hi,lo]` instead of `[hi,lo)`.

Fix rust-lang#5270.

Also:
* Adds unit tests for int/uint range functions
* Updates the uses of `range_rev` to account for the new semantics.  (Note that pretty much all of the updates there were strict improvements to the code in question; yay!)
* Exposes new function, `range_step_inclusive`, which does the range `[hi,lo]`, (at least when `hi-lo` is a multiple of the `step` parameter).
* Special-cases when `|step| == 1` removing unnecessary bounds-check.  (I did not check whether LLVM was already performing this optimization; I figure it would be a net win to not leave that analysis to the compiler.  If reviewer objects, I can easily remove that from the refactored code.)

(This pull request is a rebased version of PR rust-lang#7524, which went stale due to recent unrelated changes to num libraries.)
Allowing them in type signatures is a significant amount of extra work, unfortunately. This also doesn't apply to static values, which takes a different code path.
…e-unwrap, r=pcwalton

Fixes Issue rust-lang#7764

Running `make check` I do get a failure:

    test rt::io::extensions::test::push_bytes ... ok
    rustest rt::comm::test::oneshot_single_thread_send_port_close ... t: task failed at 'Unhandled condition:
     read_error: {kind: OtherIoError, desc: "Placeholder error. You shouldn\'t be seeing this", detail: None}',
     /Users/shout/Projects/rust/src/libstd/condition.rs:50
    /bin/sh: line 1: 35056 Abort trap: 6           x86_64-apple-darwin/stage2/test/stdtest-x86_64-apple-darwin --logfile
     tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.log
    make: *** [tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.ok] Error 134
@michaelwoerister
Copy link
Member Author

Rebased and solved merge conflict.

bors added a commit that referenced this pull request Jul 17, 2013
This is the first of a series of refactorings to get rid of the `codemap::spanned<T>` struct (see this thread for more information: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004798.html).

The changes in this PR should not change any semantics, just rename `ast::blk_` to `ast::blk` and add a span field to it. 95% of the changes were of the form `block.node.id` -> `block.id`. Only some transformations in `libsyntax::fold` where not entirely trivial.
@bors bors closed this Jul 17, 2013
osaut pushed a commit to osaut/rust that referenced this pull request Oct 31, 2013
…r=jdm

Continuation of rust-lang#7826.

AST spanned<T> refactoring, AST type renamings:

`crate => Crate`
`local => Local`
`blk => Block`
`crate_num => CrateNum`
`crate_cfg => CrateConfig`
`field => Field`

Also, Crate, Field and Local are not wrapped in spanned<T> anymore.
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.

7 participants