Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:audit-integer-libstd-thread
Mar 2, 2015
Merged

Replace int/uint by isize/usize in libstd/thread.rs#22510
bors merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:audit-integer-libstd-thread

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Part of #22240.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @aturon

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

Comment thread src/libstd/thread.rs Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Member Author

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

@alexcrichton

Copy link
Copy Markdown
Member

Could you squash the commits together as well?

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Done !

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ d708089

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d708089 with merge 54449c5...

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

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

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

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

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry clean

@alexcrichton

Copy link
Copy Markdown
Member

@bors: rollup

@Manishearth

Copy link
Copy Markdown
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
Copy Markdown
Member

@bors: r-

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Tests have been fixed. @alexcrichton @Manishearth

@Manishearth

Copy link
Copy Markdown
Member

@bors: r=alexcrichton 6d74279

@bors

bors commented Mar 2, 2015

Copy link
Copy Markdown
Collaborator

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

bors added a commit that referenced this pull request Mar 2, 2015
@bors

bors commented Mar 2, 2015

Copy link
Copy Markdown
Collaborator

@bors bors merged commit 6d74279 into rust-lang:master Mar 2, 2015
@tbu-

tbu- commented Mar 2, 2015

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Member Author

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

@tbu-

tbu- commented Mar 2, 2015

Copy link
Copy Markdown
Contributor

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
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 8, 2026
internal: Align MIR ProjectionElem more with rustc's version and simplify 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.

7 participants