-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
APIs stabilization metabug #24028
Comments
triage: P-high (1.1) |
|
|
|
I second @bstrie's suggestion of Some nice-to-haves:
|
Any chance that |
|
I'd like to stabilize the debug builders. |
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:
|
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. |
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 |
|
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 |
|
I also need |
|
Also, what prevents |
|
|
|
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 |
I agree with @SimonSapin there. I think a good crates.io library is what we need. rust-lang/rfcs#797 (comment) |
|
@anonova This is quite well expressed by
|
@skade that requires a copy of all the contents, which is often not desirable. |
I would really love to see |
Vote for collections::VecMap, it's really useful one of my projects. |
Another vote for VecMap. |
It is a while since I looked last time into this issue, but is the current plan really to remove |
There's an RFC to make |
…r=aturon The `debug_builders` feature is up for 1.1 stabilization in rust-lang#24028. This commit stabilizes the API as-is with no changes. Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares: * Should `debug_tuple_struct` and `DebugTupleStruct` be used instead of `debug_tuple` and `DebugTuple`? It's more typing but is a technically more correct name. * `DebugStruct` and `DebugTuple` have `field` methods while `DebugSet`, `DebugMap` and `DebugList` have `entry` methods. Should we switch those to something else for consistency? cc @alexcrichton @aturon
The `debug_builders` feature is up for 1.1 stabilization in #24028. This commit stabilizes the API as-is with no changes. Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares: * Should `debug_tuple_struct` and `DebugTupleStruct` be used instead of `debug_tuple` and `DebugTuple`? It's more typing but is a technically more correct name. * `DebugStruct` and `DebugTuple` have `field` methods while `DebugSet`, `DebugMap` and `DebugList` have `entry` methods. Should we switch those to something else for consistency? cc @alexcrichton @aturon
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:
|
I can't build |
Also need |
I'd also really like |
@bluss and others, the |
Could we add |
@alexcrichton @reem The adjustments to new llvm in issue #26025 might affect the codegen for Edit: Seems fine, though |
@GBGamer |
@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 |
@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)
})
} |
@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 |
Is there anything blocking the new static methods on |
Same with |
@cybergeek94 For |
Not sure if this is the right place to bring it up, but |
That's what it used to do! But yeah, it should probably be moved (maybe to |
Discussion of |
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! |
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_error
Clone::clone_from
(likely)Planned for 1.1 beta
str_words
-- see &str.words should be using the unicode word boundary algorithm #15628Planned for 1.1 stable
thread::catch_panic
time::Duration
collections::Bound
One/Zero
+ .sum / .productiter::StepBy
-- decide what to do on a negative stepBox::from_raw
,boxed::into_raw
char::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
--sort_by
takes a comparison fn, butmin_by
/max_by
take a "scoring" fn #15311<[_]>::position_elem
#[bench]
-- want more pluggable frameworkstd::slice::bytes
-- wants more design workchar::width
Read::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_all
Vec::from_raw_buf
FromPrimitive
/ToPrimitive
/NumCast
(will be replaced with more general failable cast)Far-future
raw::TraitObject
intrinsics::volatile_set_memory
intrinsics::type_name
The text was updated successfully, but these errors were encountered: