Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAPIs stabilization metabug #24028
Comments
alexcrichton
added
the
A-libs
label
Apr 3, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-high (1.1) |
rust-highfive
added
the
P-medium
label
Apr 3, 2015
rust-highfive
added this to the 1.1 milestone
Apr 3, 2015
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I second @bstrie's suggestion of Some nice-to-haves:
|
This comment has been minimized.
This comment has been minimized.
kinghajj
commented
Apr 4, 2015
|
Any chance that |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I'd like to stabilize the debug builders. |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure that this is the right place to mention it, but http://doc.rust-lang.org/std/io/struct.Error.html#method.from_os_error is marked with "unclear whether this function is necessary" - I would argue it is necessary for the following reasons:
Arguments against:
|
This comment has been minimized.
This comment has been minimized.
|
I had to do a change because type_name is exported into std, but not marked stable. It's not that I absolutely need it, but I have a usecase for something with it's guarantees: a stable identifier for a specific type between versions. I'd prefer using it. |
This comment has been minimized.
This comment has been minimized.
Great, that it will be added again. Hyper used it for both HTTP status codes and quality values, it was removed to make hyper run on beta. But Hyper also needs |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Something stabilizing Also the value field of UnsafeCell. This is necessary to create a static initializer. Constant expressions would also be able to solve this though |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
mhristache
commented
Apr 4, 2015
|
I also need |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
jedisct1
commented
Apr 4, 2015
|
Also, what prevents |
This comment has been minimized.
This comment has been minimized.
dnaq
commented
Apr 4, 2015
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
ghost
commented
Apr 4, 2015
|
|
This comment has been minimized.
This comment has been minimized.
I think we should just remove this one. It’s unclear what "a word" is or should be. Unicode has an entire document (UAX #29 Text Segmentation) with a non-trivial algorithm to standardize this, but I think an implementation of it belongs more on crates.io than in Instead, we could have "split a string on whitespace" in |
This comment has been minimized.
This comment has been minimized.
|
I agree with @SimonSapin there. I think a good crates.io library is what we need. rust-lang/rfcs#797 (comment) |
This comment has been minimized.
This comment has been minimized.
anonova
commented
Apr 4, 2015
|
|
This comment has been minimized.
This comment has been minimized.
|
@anonova This is quite well expressed by
|
This comment has been minimized.
This comment has been minimized.
|
@skade that requires a copy of all the contents, which is often not desirable. |
This comment has been minimized.
This comment has been minimized.
jedisct1
commented
Apr 4, 2015
|
I would really love to see |
This comment has been minimized.
This comment has been minimized.
|
Vote for collections::VecMap, it's really useful one of my projects. |
This comment has been minimized.
This comment has been minimized.
|
Another vote for VecMap. |
This comment has been minimized.
This comment has been minimized.
|
It is a while since I looked last time into this issue, but is the current plan really to remove |
This comment has been minimized.
This comment has been minimized.
|
There's an RFC to make |
bors
added a commit
that referenced
this issue
May 21, 2015
bors
added a commit
that referenced
this issue
May 21, 2015
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
May 22, 2015
bors
added a commit
that referenced
this issue
May 23, 2015
This comment has been minimized.
This comment has been minimized.
|
I'd propose these as APIs with problems:
They have unclear performance impact and utility. Possible candidates for moving to a third party crate. As noted on the forum thread, on my wishlist for (not far) future stabilization:
|
This comment has been minimized.
This comment has been minimized.
|
I can't build |
This comment has been minimized.
This comment has been minimized.
|
Also need |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I'd also really like |
This comment has been minimized.
This comment has been minimized.
|
@bluss and others, the |
This comment has been minimized.
This comment has been minimized.
|
Could we add |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton @reem The adjustments to new llvm in issue #26025 might affect the codegen for Edit: Seems fine, though |
This comment has been minimized.
This comment has been minimized.
|
@GBGamer |
This comment has been minimized.
This comment has been minimized.
|
@eddyb It would be nice to at least re-export from std, if possible, even if it is unstable. Having to Also, what kind of API could we design around NonZero? Serious question, I can't think of anything besides |
This comment has been minimized.
This comment has been minimized.
|
@GBGamer first off, the And then, there's the following constructor: impl<T: Zeroable> NonZero<T> {
fn new(x: T) -> Option<NonZero<T>> {
if x.is_zero() {
None
} else {
Some(NonZero(x))
}
}
}Completely safe, should compile down to nothing, and the panic behaviour you describe could be achieved by just calling It could be used like this: extern {
fn malloc(NonZero<usize>) -> *mut u8;
}
fn oom() -> ! { print_oom_message(); abort() }
const EMPTY: *mut u8 = 1 as *mut u8;
fn alloc(size: usize) -> NonZero<*mut u8> {
NonZero::new(size).map_or(EMPTY, |size| {
NonZero::new(malloc(size)).or_else(oom)
})
} |
This comment has been minimized.
This comment has been minimized.
|
@eddyb alright, makes total sense. I would like to start working on that On Tue, Jun 16, 2015 at 11:26 PM, Eduard Burtescu notifications@github.com
"Unjust laws exist; shall we be content to obey them, or shall we endeavor |
This comment has been minimized.
This comment has been minimized.
|
Is there anything blocking the new static methods on |
This comment has been minimized.
This comment has been minimized.
|
Same with |
This comment has been minimized.
This comment has been minimized.
|
@cybergeek94 For |
This comment has been minimized.
This comment has been minimized.
|
Not sure if this is the right place to bring it up, but |
This comment has been minimized.
This comment has been minimized.
|
That's what it used to do! But yeah, it should probably be moved (maybe to |
This comment has been minimized.
This comment has been minimized.
|
Discussion of |
This comment has been minimized.
This comment has been minimized.
|
I'm going to close this issue out in favor of per-feature tracking issues, which have now been created for the bulk of unstable std APIs. Please comment on the individual issues with your use cases, stabilization desire, and feedback! |
alexcrichton commentedApr 3, 2015
We will eventually need a process for API stabilization planning and discussion, but while we're first getting used to the 6 week cadence, we'll use this issue for tracking.
Planned for 1.0 stable
str::Utf8Error(switch from enum to opaque struct, with accessor for "last valid byte position")io::Error::from_raw_os_errorClone::clone_from(likely)Planned for 1.1 beta
str_words-- see #15628Planned for 1.1 stable
thread::catch_panictime::Durationcollections::BoundOne/Zero+ .sum / .productiter::StepBy-- decide what to do on a negative stepBox::from_raw,boxed::into_rawchar::encode_utf{8,16}APIs with known problems/requiring more thought
iter::order-- would prefer to use comparison operatorsalloc::heap-- huge risks for future tracing support etc.IteratorExt::{min,max}_by-- #15311<[_]>::position_elem#[bench]-- want more pluggable frameworkstd::slice::bytes-- wants more design workchar::widthRead::chars-- has problematic error type; should this even be provided given how slow it is?iter::range_inclusive-- replace with adapterscollections::{BitVec, VecMap}-- need clearer policy on what ships in collectionsmem::copy{,_mut}_lifetime,ptr::Unique-- wants more general design for "safer unsafe patterns"Slated for eventual deprecation/removal (if unstable)
Vec::push_allVec::from_raw_bufFromPrimitive/ToPrimitive/NumCast(will be replaced with more general failable cast)Far-future
raw::TraitObjectintrinsics::volatile_set_memoryintrinsics::type_name