Uh oh!
There was an error while loading. Please reload this page.
Fix intro examples compilation warnings - #21121
Conversation
rust-highfive
commented
Jan 13, 2015
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (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. 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 CONTRIBUTING.md for more information. |
There was a problem hiding this comment.
Ideally, these have no annotations. Does it work without them?
There was a problem hiding this comment.
In this particular case code without type annotations would fail to compile (error: unable to infer enough type information about). However, to annotate only the first number would be sufficient. I could update the changed examples in such regard.
There was a problem hiding this comment.
Yes, please do :) Thanks!
steveklabnik
commented
Jan 14, 2015
Thanks! I think I already have a patch in the queue that removes the suffixes here, but moving to ranges would also be good. Can you check into that? |
raindev
commented
Jan 14, 2015
Yeah, sure. I'd like to do the same changes (update suffixes and ranges) for the rest of examples. |
raindev
commented
Jan 14, 2015
The intro examples are now clear of compilation errors and warning (except the use of unstable |
raindev
commented
Jan 14, 2015
About the issue of detached threads in the examples: I think it's better to create an issue for that and/or address the problem in a separate pull request. What do you think? |
steveklabnik
commented
Jan 14, 2015
Well, ideally we'd use |
raindev
commented
Jan 14, 2015
Just read the documentation on |
steveklabnik
commented
Jan 14, 2015
👍 |
raindev
commented
Jan 15, 2015
@steveklabnik, I noticed that 245e6a8 overlaps with #21020. Changes of that pull request could be applied over this one. What do you think about that? |
steveklabnik
commented
Jan 15, 2015
Sounds good |
raindev
commented
Jan 15, 2015
Accordingly to your comment, the threading examples are working sequentially in the current version of this pull request. |
raindev
commented
Jan 15, 2015
I removed the latest commit (245e6a837e58ac866cf5ceb788b914884815ee06), so I wouldn't mess up the thread examples. Leaving them for someone more experienced in Rust. Goal of this pull request is to make examples compile without warnings which is achieved. Ready to merge. |
* Use range notation instead of deprecated `range()` * Remove deprecated `u` integer suffixes used in ranges * Replace deprecated `i` integer suffixes with `is` for vector numbers `Thread::spawn()` still gives "use of unstable item" warning which I hadn't found a way to fix.
The mentioned method are no longer part of Thread. Spawned threads are detached by default as of now.
Replace deprecated integer suffixes. Remove integer type notations altogether where possible. Replace uses of deprecated `range()` function with range notation.
raindev
commented
Jan 17, 2015
@steveklabnik, it looks like this pull request hadn't got merged automatically because of conflicts. I rebased it against master. |
Fix intro examples compilation warnings Reviewed-by: steveklabnik
steveklabnik
commented
Jan 17, 2015
Doing this manually as part of #21300 |
Basic support for declarative attribute/derive macros
range()uinteger suffixes used in rangesiinteger suffixes withisfor vector numbersThread::spawn()still giveswarning: use of unstable item: may change with specifics of new Send semanticswarning which I hadn't found a way to fix. As long as I've found, it's related to rust-lang/rfcs#458 which hadn't been implemented yet.Also I encountered two more example issues while going through the tutorial which aren't addressed in this PR:
compilation error of first Safety and Speed snippet(update: it should not compile, my bad)Thread::spawnbehaviour was different.Let me know if the
twoissue should be addressed in scope of this PR or in another one.