Taiki Endo
93b6d9e086
libstd => 2018
2019-02-28 04:06:15 +09:00
kennytm
e3a8f7db47
Rollup merge of #58553 - scottmcm:more-ihle, r=Centril
...
Use more impl header lifetime elision
Inspired by seeing explicit lifetimes on these two:
- https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator
- https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not
And a follow-up to https://github.com/rust-lang/rust/pull/54687 , that started using IHLE in libcore.
Most of the changes in here fall into two big categories:
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm ).
I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-20 11:59:10 +08:00
Scott McMurray
3bea2ca49d
Use more impl header lifetime elision
...
There are two big categories of changes in here
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-17 19:42:36 -08:00
Alexander Regueiro
99ed06eb88
libs: doc comments
2019-02-10 23:57:25 +00:00
Alexander Regueiro
b87363e763
tests: doc comments
2019-02-10 23:42:32 +00:00
Ryan Hunt
6c60662b26
Use correct tracking issue for c_variadic
...
Fixes #57306
2019-01-07 09:46:19 -06:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Pietro Albini
3af0cf89fa
Rollup merge of #56731 - GuillaumeGomez:ffi-doc-urls, r=Centril
...
Add missing urls in ffi module docs
r? @QuietMisdreavus
2018-12-15 10:17:30 +01:00
bors
664ede88fa
Auto merge of #56536 - alexcrichton:update-master, r=Mark-Simulacrum
...
Bump to 1.33.0
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations
2018-12-14 06:52:19 +00:00
Lyndon Brown
0008e0d502
use actual invalid string in OsStr::to_string_lossy example
2018-12-12 18:13:40 +00:00
Alex Crichton
cf47a19305
Bump to 1.33.0
...
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations
Actually updating the version number is blocked on updating Cargo
2018-12-12 08:09:26 -08:00
Guillaume Gomez
b96186b8a7
Add missing urls in ffi module docs
2018-12-11 23:54:41 +01:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
ljedrz
8c4129cd9a
cleanup: remove static lifetimes from consts in libstd
2018-12-04 10:21:42 +01:00
kennytm
52a4fc8130
Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centril
...
Update issue number of `shrink_to` methods to point the tracking issue
Tracking issue: #56431
2018-12-03 18:07:16 +08:00
kennytm
e9a805522c
Rollup merge of #56141 - jnqnfe:osstr_len_clarity, r=nagisa
...
[std] Osstr len clarity
2018-12-03 18:07:06 +08:00
Hidehito Yabuuchi
1e18cc916f
Update issue number of shrink_to methods to point the tracking issue
2018-12-02 16:08:08 +09:00
bors
3e90a12a8a
Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb
...
libcore: Add VaList and variadic arg handling intrinsics
## Summary
- Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`.
- Add `core::va_list::VaList` to `libcore`.
Part 1 of (at least) 3 for #44930
Comments and critiques are very much welcomed 😄
2018-11-29 19:28:21 +00:00
polyfloyd
e63bd91895
Fix a typo in the documentation of std::ffi
2018-11-27 22:33:46 +01:00
Dan Robertson
08140878fe
libcore: Add va_list lang item and intrinsics
...
- Add the llvm intrinsics used to manipulate a va_list.
- Add the va_list lang item in order to allow implementing
VaList in libcore.
2018-11-26 22:56:19 +00:00
Lyndon Brown
a1e9c7fc2e
OsStr: clarify len() method documentation
2018-11-21 18:30:46 +00:00
Lyndon Brown
0591ff7525
OsString: mention storage form in discussion
...
Helps users to understand capacity related values, which may surpise on
Windows.
Also is a step towards clarifying understanding of `OsStr`'s len() return
value.
2018-11-21 18:30:45 +00:00
bors
65204a97d4
Auto merge of #55278 - Centril:constification-1, r=alexcrichton
...
Minor standard library constification
This PR makes some bits of the standard library into `const fn`s.
I've tried to be as aggressive as I possibly could in the constification.
The list is rather small due to how restrictive `const fn` is at the moment.
r? @oli-obk cc @rust-lang/libs
Stable public APIs affected:
+ [x] `Cell::as_ptr`
+ [x] `UnsafeCell::get`
+ [x] `char::is_ascii`
+ [x] `iter::empty`
+ [x] `ManuallyDrop::{new, into_inner}`
+ [x] `RangeInclusive::{start, end}`
+ [x] `NonNull::as_ptr`
+ [x] `{[T], str}::as_ptr`
+ [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}`
+ [x] `CStr::as_ptr`
+ [x] `Ipv4Addr::is_unspecified`
+ [x] `Ipv6Addr::new`
+ [x] `Ipv6Addr::octets`
Unstable public APIs affected:
+ [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}`
+ [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}`
+ [x] `core::convert::identity`
--------------------------
## Removed from list in first pass:
Stable public APIs affected:
+ [ ] `BTree{Map, Set}::{len, is_empty}`
+ [ ] `VecDeque::is_empty`
+ [ ] `String::{is_empty, len}`
+ [ ] `FromUtf8Error::utf8_error`
+ [ ] `Vec<T>::{is_empty, len}`
+ [ ] `Layout::size`
+ [ ] `DecodeUtf16Error::unpaired_surrogate`
+ [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}`
+ [ ] `panic::Location::{file, line, column}`
+ [ ] `{ChunksExact, RChunksExact}::remainder`
+ [ ] `Utf8Error::valid_up_to`
+ [ ] `VacantEntry::key`
+ [ ] `NulError::nul_position`
+ [ ] `IntoStringError::utf8_error`
+ [ ] `IntoInnerError::error`
+ [ ] `io::Chain::get_ref`
+ [ ] `io::Take::{limit, get_ref}`
+ [ ] `SocketAddrV6::{flowinfo, scope_id}`
+ [ ] `PrefixComponent::{kind, as_os_str}`
+ [ ] `Path::{ancestors, display}`
+ [ ] `WaitTimeoutResult::timed_out`
+ [ ] `Receiver::{iter, try_iter}`
+ [ ] `thread::JoinHandle::thread`
+ [ ] `SystemTimeError::duration`
Unstable public APIs affected:
+ [ ] `core::fmt::Arguments::new_v1`
+ [ ] `core::fmt::Arguments::new_v1_formatted`
+ [ ] `Pin::{get_ref, into_ref}`
+ [ ] `Utf8Lossy::chunks`
+ [ ] `LocalWaker::as_waker`
+ [ ] `panic::PanicInfo::{internal_constructor, message, location}`
+ [ ] `panic::Location::{internal_constructor }`
## Removed from list in 2nd pass:
Stable public APIs affected:
+ [ ] `LinkedList::{new, iter, is_empty, len}`
+ [ ] `mem::forget`
+ [ ] `Cursor::{new, get_ref, position}`
+ [ ] `io::{empty, repeat, sink}`
+ [ ] `PoisonError::new`
+ [ ] `thread::Builder::new`
+ [ ] `process::Stdio::{piped, inherit, null}`
Unstable public APIs affected:
+ [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12 18:54:11 +00:00
Bruce Mitchener
9b4d68e53b
Fix documentation typos.
2018-11-10 19:31:49 +07:00
Mazdak Farrokhzad
e15c62d61f
revert making internal APIs const fn.
2018-11-10 01:10:07 +01:00
Mazdak Farrokhzad
d1d2aa22c0
reduce list to functions callable in const ctx.
2018-11-10 01:10:07 +01:00
Mazdak Farrokhzad
f65b630d33
constify parts of libstd.
2018-11-10 01:10:07 +01:00
Austin Bonander
092bf2b500
make CStr::from_bytes_with_nul_unchecked() a const fn
...
closes #54678
2018-10-02 04:25:40 -07:00
Colin Walters
993d02283e
OsStr: Document that it's not NUL terminated
...
I somehow got confused into thinking this was the case, but
it's definitely not. Let's help the common case of people who
have an `OsStr` and need to call e.g. Unix APIs.
2018-09-17 21:10:36 -04:00
Isaac Woods
23e345bc0c
Move std::os::raw::c_void into libcore and re-export in libstd
2018-09-14 16:19:59 +01:00
kennytm
ae8410bf29
Rollup merge of #54203 - cuviper:stable-os_str_str_ref_eq, r=estebank
...
Fix the stable release of os_str_str_ref_eq
This was added and stabilized in commit 02503029b8 , but while that
claimed to be for 1.28.0, it didn't actually make it until 1.29.0.
Fixes #54195 .
2018-09-14 14:50:15 +08:00
Josh Stone
2e75b07eee
Fix the stable release of os_str_str_ref_eq
...
This was added and stabilized in commit 02503029b8 , but while that
claimed to be for 1.28.0, it didn't actually make it until 1.29.0.
2018-09-13 14:25:43 -07:00
kennytm
2882119feb
Rollup merge of #53976 - GuillaumeGomez:expect-world, r=steveklabnik
...
Replace unwrap calls in example by expect
Part of #51668 .
r? @steveklabnik
2018-09-14 00:41:34 +08:00
Simonas Kazlauskas
0ec351d528
&CStr, not CStr, is the counterpart of &str
2018-09-08 20:01:41 +03:00
Guillaume Gomez
d5409141d6
Fix link
2018-09-06 23:32:30 +02:00
Guillaume Gomez
72ba0ba3d7
Replace unwrap calls in example by expect
2018-09-05 23:54:07 +02:00
Corey Farwell
ec18991492
Add links to std::char::REPLACEMENT_CHARACTER from docs.
...
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
2018-08-11 15:42:35 -04:00
Pietro Albini
b7ee110ea2
Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnik
...
Document From trait implementations for OsStr, OsString, CString, and CStr
As part of issue #51430 (cc @skade).
The allocation and copy claims should be double-checked.
r? @steveklabnik
2018-08-01 10:12:32 +02:00
Tatsuyuki Ishi
4f1d4e4db6
Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and 'ljedrz/dyn_libterm' into dyn-rollup
2018-07-25 10:25:02 +09:00
Markus Wein
ed5edcb318
Seperate summaries from rest of the comment
2018-07-23 15:38:15 +02:00
Markus Wein
b81ee0b370
Document From conversions for CString and CStr
2018-07-16 20:37:28 +02:00
Markus Wein
acdafa0fb1
Document From conversions for OsString and OsStr
2018-07-16 20:37:15 +02:00
kennytm
b317ab1bc5
Rollup merge of #51912 - mbrubeck:more_box_slice_clone, r=alexcrichton
...
impl Clone for Box<CStr>, Box<OsStr>, Box<Path>
Implements #51908 .
2018-07-12 20:25:25 +08:00
ljedrz
560d8079ec
Deny bare trait objects in src/libstd.
2018-07-10 20:35:36 +02:00
Matt Brubeck
cdff2f3b30
impl Clone for Box<CStr>, Box<OsStr>, Box<Path>
...
Implements #51908 .
2018-07-06 12:57:47 -07:00
Gabriel Majeri
fdcee4da79
Fix stability attributes
2018-06-29 14:50:00 +03:00
Gabriel Majeri
02503029b8
Implement PartialEq between &str and OsString
...
Allows for example `os_string == "something"`
2018-06-29 14:50:00 +03:00
kennytm
8366780164
Rollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton
...
Implement From for more types on Cow
This is basically https://github.com/rust-lang/rust/pull/48191 , except that it should be implemented in a way that doesn't break third party crates.
2018-05-17 05:22:07 +08:00
George Burton
7c0f664f15
Fix typo
2018-05-09 07:32:50 +01:00
George Burton
17e262880c
Update features to 1.28.0
2018-05-09 07:23:02 +01:00