Skip to content

Updated std::dynamic_lib to use std::path. - #23197

Merged
bors merged 1 commit into
rust-lang:masterfrom
aatxe:master
Mar 28, 2015
Merged

Updated std::dynamic_lib to use std::path.#23197
bors merged 1 commit into
rust-lang:masterfrom
aatxe:master

Conversation

@aatxe

@aatxe aatxe commented Mar 8, 2015

Copy link
Copy Markdown
Contributor

std::dynamic_library is currently using std::old_io::Path specifically. This change brings the API in alignment with std::fs::File by having it take std::path::AsPath. The Windows code should work, but I admittedly haven't tried it (I don't have a Windows machine readily available right now).

r? @alexcrichton

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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.

Comment thread src/libstd/dynamic_lib.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately using a type parameter I believe will cause DynamicLibrary::open(None) to fail as there's no way to determine the type of P. Perhaps this could stay as Path for now?

@alexcrichton

Copy link
Copy Markdown
Member

While you're at it, would you mine changing DynamicLibrary::search_path as well to return PathBuf instead of old_path::Path? Thanks!

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 5b24228

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ d619afe

@bors

bors commented Mar 10, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d619afe with merge a61acf6...

@bors

bors commented Mar 10, 2015

Copy link
Copy Markdown
Collaborator

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

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 9ce9ad478d2f032251e728923f753d84639bad1c

@bors

bors commented Mar 11, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 9ce9ad4 with merge 629557f...

@bors

bors commented Mar 11, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-mac-64-nopt-t

@aatxe

aatxe commented Mar 11, 2015

Copy link
Copy Markdown
Contributor Author

I missed some stuff again, but I think I got it this time. Sorry for being bad about this, @alexcrichton. Hopefully this is the last commit.

@alexcrichton

Copy link
Copy Markdown
Member

Looks like there's a tidy error (squashes are also nice)

@aatxe

aatxe commented Mar 11, 2015

Copy link
Copy Markdown
Contributor Author

Yup, I accidentally had some trailing whitespace. I fixed that up and I squashed the whole thing into one commit. @alexcrichton

@aatxe aatxe changed the title Updated DynamicLibrary::open to use AsPath. Updated std::dynamic_lib to use std::path. Mar 11, 2015
@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ c861692ca6e04d1b54a893218b3c51f1045de362

@bors

bors commented Mar 12, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit c861692 with merge f71ce33...

@bors

bors commented Mar 12, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-linux-64-nopt-t

@aatxe

aatxe commented Mar 12, 2015

Copy link
Copy Markdown
Contributor Author

Removed the unused imports that caused the linux build to fail, @alexcrichton.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ c80d8fa

@bors

bors commented Mar 12, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit c80d8fa with merge 80093ef...

@bors

bors commented Mar 12, 2015

Copy link
Copy Markdown
Collaborator

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

@Manishearth

Copy link
Copy Markdown
Member
C:/bot/slave/auto-win-32-nopt-t/build/src/libstd\dynamic_lib.rs:277:9: 277:12 error: unused import, #[deny(unused_imports)] on by default
C:/bot/slave/auto-win-32-nopt-t/build/src/libstd\dynamic_lib.rs:277     use str;

@aatxe

aatxe commented Mar 12, 2015

Copy link
Copy Markdown
Contributor Author

Fixed that now, too. Am I missing something? Is there an easy way to test this stuff before committing? Running make check-stage1-std NO_REBUILD=1 NO_BENCH=1 gave no indication of the unused imports (even in the first case with linux).

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 267478a

Unfortunately without compiling on windows there's not a great way to do a smoke test of compiling on windows.

@aatxe

aatxe commented Mar 23, 2015

Copy link
Copy Markdown
Contributor Author

@Manishearth @alexcrichton I think I got the rebase correct?

Comment thread src/librustdoc/plugins.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This call to as_path shouldn't be necessary

@aatxe

aatxe commented Mar 23, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton I made all the changes you suggested.

Comment thread src/librustdoc/plugins.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can probably be deleted

@aatxe

aatxe commented Mar 24, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton and now I've done the rest of them.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ d72691df90f1f522aafb775e77476e4a2edd9511

Thanks!

@bors

bors commented Mar 24, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d72691d with merge 9451af9...

@bors

bors commented Mar 24, 2015

Copy link
Copy Markdown
Collaborator

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

@aatxe

aatxe commented Mar 24, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton I think I caught all the Windows issues now. (At least, I hope?)

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 05f942c

@bors

bors commented Mar 25, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 05f942c with merge 5f267f2...

@bors

bors commented Mar 25, 2015

Copy link
Copy Markdown
Collaborator

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

@Manishearth

Copy link
Copy Markdown
Member
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:24:5: 24:7 error: unused import, #[deny(unused_imports)] on by default
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:24 use os;
                                                                                                         ^~
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:24:5: 24:7 error: use of deprecated item: replaced with std::env APIs, #[deny(deprecated)] on by default
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:24 use os;
                                                                                                         ^~
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:25:5: 25:8 error: unused import, #[deny(unused_imports)] on by default
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-x-android-t/build/src/libstd/dynamic_lib.rs:25 use str;
                                                                                                         ^~~
error: aborting due to 3 previous errors
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-

@aatxe

aatxe commented Mar 27, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton Added #[cfg(not(target_os = "android"))] on those imports.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ alexcrichton@fb3bd98

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 6acf385 has been approved by alexcrichton

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ fb3bd98d619dd26663df7745e81466fbe8ef2a92

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

🙀 fb3bd98d619dd26663df7745e81466fbe8ef2a92 is not a valid commit SHA. Please try again with 6acf385.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 6acf385

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 27, 2015
`std::dynamic_library` is currently using `std::old_io::Path` specifically. This change brings the API in alignment with `std::fs::File` by having it take `std::path::AsPath`. The Windows code should work, but I admittedly haven't tried it (I don't have a Windows machine readily available right now).

r? @alexcrichton
@bors
bors merged commit 6acf385 into rust-lang:master Mar 28, 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.

5 participants