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

Replace int/uint by isize/usize in libstd/thread.rs #22510

Merged
merged 1 commit into from
Mar 2, 2015
Merged

Replace int/uint by isize/usize in libstd/thread.rs #22510

merged 1 commit into from
Mar 2, 2015

Conversation

GuillaumeGomez
Copy link
Member

Part of #22240.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -805,13 +805,13 @@ mod test {
}

fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Thunk<'static>) {
let (tx, rx) = channel::<uint>();
let (tx, rx) = channel::<usize>();
Copy link
Member

Choose a reason for hiding this comment

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

This can just as well be u32

@alexcrichton
Copy link
Member

Thanks! r=me with a squash

Also feel free to comment on a PR whenever you update it because sadly github does not send out notifications otherwise.

@GuillaumeGomez
Copy link
Member Author

@alexcrichton: I think it can be merged now. Except if @aturon sees something else which needs to be changed ?

@alexcrichton
Copy link
Member

Could you squash the commits together as well?

@GuillaumeGomez
Copy link
Member Author

Done !

@alexcrichton
Copy link
Member

@bors: r+ d708089

@bors
Copy link
Contributor

bors commented Feb 27, 2015

⌛ Testing commit d708089 with merge 54449c5...

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-linux-64-x-android-t

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Feb 27, 2015

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-win-32-nopt-t

@alexcrichton
Copy link
Member

@bors: retry clean

@alexcrichton
Copy link
Member

@bors: rollup

@Manishearth
Copy link
Member

I'm getting these errors in libstd:

/home/manishearth/Mozilla/rust/src/libstd/panicking.rs:36:61: 36:65 warning: the `uint` type is deprecated; use `usize` or a fixed-sized integer
/home/manishearth/Mozilla/rust/src/libstd/panicking.rs:36 pub fn on_panic(obj: &(Any+Send), file: &'static str, line: uint) {
                                                                                                                      ^~~~
/home/manishearth/Mozilla/rust/src/libstd/panicking.rs:36:65: 36:65 help: add #![feature(int_uint)] to the crate attributes to silence this warning
/home/manishearth/Mozilla/rust/src/libgetopts/lib.rs:966:50: 966:66 error: failed to resolve. Could not find `uint` in `std`
/home/manishearth/Mozilla/rust/src/libgetopts/lib.rs:966     t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::MAX,
                                                                                                          ^~~~~~~~~~~~~~~~
/home/manishearth/Mozilla/rust/src/libgetopts/lib.rs:966:50: 966:66 error: unresolved name `std::uint::MAX`
/home/manishearth/Mozilla/rust/src/libgetopts/lib.rs:966     t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::MAX,
                                                                                                          ^~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
make: *** [x86_64-unknown-linux-gnu/stage1/test/getoptstest-x86_64-unknown-linux-gnu] Error 101
make: *** Waiting for unfinished jobs....
/home/manishearth/Mozilla/rust/src/libstd/old_io/mod.rs:1618:10: 1618:11 warning: the type parameter `T` is not constrained by the impl trait, self type, or predicates
/home/manishearth/Mozilla/rust/src/libstd/old_io/mod.rs:1618 impl<'a, T, A: ?Sized + Acceptor<T>> Iterator for IncomingConnections<'a, A> {
                                                                      ^
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:818:21: 818:31 error: mismatched types:
 expected `u32`,
    found `usize`
(expected u32,
    found usize) [E0308]
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:818             tx.send(x_in_child).unwrap();
                                                                            ^~~~~~~~~~
<core macros>:5:24: 5:35 error: mismatched types:
 expected `usize`,
    found `u32`
(expected usize,
    found u32) [E0308]
<core macros>:5 if ! ( ( * left_val == * right_val ) && ( * right_val == * left_val ) ) {
                                       ^~~~~~~~~~~
<core macros>:1:1: 9:39 note: in expansion of assert_eq!
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:822:9: 822:45 note: expansion site
<core macros>:5:58: 5:68 error: mismatched types:
 expected `u32`,
    found `usize`
(expected u32,
    found usize) [E0308]
<core macros>:5 if ! ( ( * left_val == * right_val ) && ( * right_val == * left_val ) ) {
                                                                         ^~~~~~~~~~
<core macros>:1:1: 9:39 note: in expansion of assert_eq!
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:822:9: 822:45 note: expansion site
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:859:24: 859:35 error: mismatched types:
 expected `usize`,
    found `u32`
(expected usize,
    found u32) [E0308]
/home/manishearth/Mozilla/rust/src/libstd/thread.rs:859                 if x < GENERATIONS {
                                                                               ^~~~~~~~~~~
error: aborting due to 4 previous errors
make: *** [x86_64-unknown-linux-gnu/stage1/test/stdtest-x86_64-unknown-linux-gnu] Error 101

Could you try to make sure check-stage1 passes?

@Manishearth
Copy link
Member

@bors: r-

@GuillaumeGomez
Copy link
Member Author

Tests have been fixed. @alexcrichton @Manishearth

@Manishearth
Copy link
Member

@bors: r=alexcrichton 6d74279

@bors
Copy link
Contributor

bors commented Mar 2, 2015

⌛ Testing commit 6d74279 with merge 1cc8b6e...

bors added a commit that referenced this pull request Mar 2, 2015
@bors bors merged commit 6d74279 into rust-lang:master Mar 2, 2015
@tbu-
Copy link
Contributor

tbu- commented Mar 2, 2015

@Manishearth This looks incorrect, it is casting a pointer to a u32. (Also it uses isize for an integer where it is unnecessary, but that's incorrect, just missed while replacing.)

@Manishearth
Copy link
Member

Where? Can you file a followup bug or pull-request?

@GuillaumeGomez GuillaumeGomez deleted the audit-integer-libstd-thread branch March 2, 2015 21:24
@GuillaumeGomez
Copy link
Member Author

You're talking about the change in the tests ? I didn't see that. Erf... Sorry about that...

@tbu-
Copy link
Contributor

tbu- commented Mar 2, 2015

I'm working on it.

@huonw huonw mentioned this pull request Mar 2, 2015
tbu- added a commit to tbu-/rust that referenced this pull request Mar 3, 2015
Manishearth pushed a commit to Manishearth/rust that referenced this pull request Mar 3, 2015
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