Uh oh!
There was an error while loading. Please reload this page.
std: Stabilize APIs for the 1.10 release - #33699
Conversation
rust-highfive
commented
May 17, 2016
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
May 17, 2016
Still working through the tests, but this should have all the real meat. r? @aturon |
There was a problem hiding this comment.
are the feature and the version here correct?
2e3600c to
7c03658Comparealexcrichton
commented
May 19, 2016
@SimonSapinbrings up that |
sfackler
commented
May 19, 2016
I think I like that approach given that there's an obvious and reasonable upper bound on the buffer size. |
alexcrichton
commented
May 20, 2016
I personally feel that it's inconsistent with how we handle encoding/decoding everywhere else, which is to use a result instead of panicking |
SimonSapin
commented
May 20, 2016
@alexcrichton what APIs and errors are you thinking of, specifically? Providing a buffer smaller than four bytes or two 16-bit units is a different kind of error than, for example, the input containing ill-formed byte sequences. It’s easy to use something like And, as I argued in #27784 (comment), would callers ever do anything other than |
alexcrichton
commented
May 20, 2016
The major examples are |
SimonSapin
commented
May 21, 2016
These examples don’t take a caller-provided buffer, so the "buffer too short" kind of error doesn’t happen there. If the caller of |
alexcrichton
commented
May 22, 2016
Yes they're only analogous in the sense that they don't panic, they return results on encoding/decoding operations. The buffer may not always be controlled by the caller, but some utility function would be given a buffer from elsewhere in which case it'd just always have to perform this validation. Essentially you will 100% of the time need this check for length unless you're calling with a buffer you created yourself, and that's probably not 100% of use cases. |
SimonSapin
commented
May 22, 2016
Outside of tests, rust-lang/rust currently contains 9 uses of
100% would statically ensure they provide a large enough buffer to (I found zero usage in Servo and its dependencies that I’ve ever checked out. When I really don’t see a scenario where "some utility function given a buffer from elsewhere" would be useful. |
aturon
commented
May 23, 2016
I agree with @SimonSapin here, a too-short buffer seems reasonable to treat as a contract violation. |
alexcrichton
commented
May 23, 2016
I'd be pretty uncomfortable stabilizing an API with a brand new name, new semantics, and a new return type all at once. This may also miss the beta branch now and need to be backported. Shall we just leave it out for another round? |
alexcrichton
commented
May 23, 2016
Ok, I've backed out those API additions, re-r? @aturon |
aturon
commented
May 23, 2016
@alexcrichton I've reviewed the rest of the PR (LGTM), but I don't see the updates backing out these recent additions. |
alexcrichton
commented
May 23, 2016
@bors: r=aturon 91e8b4c57eafc0b4dc577bfab6a2685e635c9bed |
bors
commented
May 23, 2016
🙀 |
alexcrichton
commented
May 23, 2016
@bors: r=aturon 91e8b4c57eafc0b4dc577bfab6a2685e635c9bed |
bors
commented
May 23, 2016
⌛ Testing commit 91e8b4c with merge b07d438... |
bors
commented
May 23, 2016
💔 Test failed - auto-mac-64-opt |
alexcrichton
commented
May 24, 2016
@bors: r=aturon |
bors
commented
May 24, 2016
📌 Commit 04eff6c has been approved by |
bors
commented
May 24, 2016
⌛ Testing commit 04eff6c with merge 05765aa... |
bors
commented
May 24, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:
Stabilized:
* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`
Deprecated:
* `StaticCondvar` - this, and all other static synchronization primitives
below, are usable today through the lazy-static crate on
stable Rust today. Additionally, we'd like the non-static
versions to be directly usable in a static context one day,
so they're unlikely to be the final forms of the APIs in any
case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`
Closesrust-lang#27717Closesrust-lang#27720
cc rust-lang#27784 (but encode methods still exist)
Closesrust-lang#30014Closesrust-lang#30425Closesrust-lang#30449Closesrust-lang#31190Closesrust-lang#31399Closesrust-lang#31767Closesrust-lang#32111Closesrust-lang#32281Closesrust-lang#32312Closesrust-lang#32551Closesrust-lang#33018alexcrichton
commented
May 24, 2016
@bors: r=aturon |
bors
commented
May 24, 2016
📌 Commit cae91d7 has been approved by |
bors
commented
May 25, 2016
⌛ Testing commit cae91d7 with merge 07399eb... |
bors
commented
May 25, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
alexcrichton
commented
May 25, 2016
@bors: retry Praying that's spurious, I'll open an issue if I see it again |
bors
commented
May 25, 2016
⌛ Testing commit cae91d7 with merge 991b0fa... |
bors
commented
May 25, 2016
💔 Test failed - auto-win-msvc-64-opt |
bors
commented
May 26, 2016
std: Stabilize APIs for the 1.10 release
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:
Stabilized:
* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`
Deprecated:
* `StaticCondvar` - this, and all other static synchronization primitives
below, are usable today through the lazy-static crate on
stable Rust today. Additionally, we'd like the non-static
versions to be directly usable in a static context one day,
so they're unlikely to be the final forms of the APIs in any
case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`
Closes#27717Closes#27720Closes#30014Closes#30425Closes#30449Closes#31190Closes#31399Closes#31767Closes#32111Closes#32281Closes#32312Closes#32551Closes#33018bors
commented
May 26, 2016
alexcrichton
commented
May 26, 2016
Tagging beta nominated/accepted to ensure we backport |
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:
Stabilized:
os::windows::fs::OpenOptionsExt::access_modeos::windows::fs::OpenOptionsExt::share_modeos::windows::fs::OpenOptionsExt::custom_flagsos::windows::fs::OpenOptionsExt::attributesos::windows::fs::OpenOptionsExt::security_qos_flagsos::unix::fs::OpenOptionsExt::custom_flagssync::Weak::newDefault for sync::Weakpanic::set_hookpanic::take_hookpanic::PanicInfopanic::PanicInfo::payloadpanic::PanicInfo::locationpanic::Locationpanic::Location::filepanic::Location::lineffi::CStr::from_bytes_with_nulffi::CStr::from_bytes_with_nul_uncheckedffi::FromBytesWithNulErrorfs::Metadata::modifiedfs::Metadata::accessedfs::Metadata::createdsync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchangesync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weakcollections::{btree,hash}_map::{Occupied,Vacant,}Entry::keyos::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}SocketAddr::is_unnamedSocketAddr::as_pathnameUnixStream::connectUnixStream::pairUnixStream::try_cloneUnixStream::local_addrUnixStream::peer_addrUnixStream::set_read_timeoutUnixStream::set_write_timeoutUnixStream::read_timeoutUnixStream::write_TimeoutUnixStream::set_nonblockingUnixStream::take_errorUnixStream::shutdownUnixStreamUnixListener::bindUnixListener::acceptUnixListener::try_cloneUnixListener::local_addrUnixListener::set_nonblockingUnixListener::take_errorUnixListener::incomingUnixListenerUnixDatagram::bindUnixDatagram::unboundUnixDatagram::pairUnixDatagram::connectUnixDatagram::try_cloneUnixDatagram::local_addrUnixDatagram::peer_addrUnixDatagram::recv_fromUnixDatagram::recvUnixDatagram::send_toUnixDatagram::sendUnixDatagram::set_read_timeoutUnixDatagram::set_write_timeoutUnixDatagram::read_timeoutUnixDatagram::write_timeoutUnixDatagram::set_nonblockingUnixDatagram::take_errorUnixDatagram::shutdownUnixDatagram{BTree,Hash}Map::values_mut<[_]>::binary_search_by_keyDeprecated:
StaticCondvar- this, and all other static synchronization primitivesbelow, are usable today through the lazy-static crate on
stable Rust today. Additionally, we'd like the non-static
versions to be directly usable in a static context one day,
so they're unlikely to be the final forms of the APIs in any
case.
CONDVAR_INITStaticMutexMUTEX_INITStaticRwLockRWLOCK_INITiter::Peekable::is_emptyCloses#27717
Closes#27720
Closes#30014
Closes#30425
Closes#30449
Closes#31190
Closes#31399
Closes#31767
Closes#32111
Closes#32281
Closes#32312
Closes#32551
Closes#33018