Mazdak Farrokhzad
379c380a60
libstd: deny(elided_lifetimes_in_paths)
2019-03-31 12:56:51 +02:00
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
Matthias Einwag
d9a4b22d32
Update the future/task API
...
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592 .
Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait
2019-02-03 13:46:53 -08:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07: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
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
Simonas Kazlauskas
99f7dc451f
Do not Atomic{I,U}128 in stage0
2018-11-05 18:54:17 +02:00
Oliver Middleton
01674fbe06
Correct alignment of atomic types and (re)add Atomic{I,U}128
...
LLVM requires that atomic loads and stores be aligned to at least the size of the type.
2018-10-27 13:47:11 +03:00
Ralf Jung
54a3583da7
it's auto traits that make for automatic implementations
2018-10-08 17:44:33 +02:00
Taylor Cramer
1b00f0b9fa
Remove spawning from task::Context
2018-09-19 15:01:19 -07:00
Without Boats
974bdc80fe
Update to a new pinning API.
2018-09-01 06:57:58 +02:00
Niv Kaminer
13da951868
move PinMut into pin module and export through std
2018-08-23 01:37:03 +03:00
ljedrz
560d8079ec
Deny bare trait objects in src/libstd.
2018-07-10 20:35:36 +02:00
Josef Reinhard Brandl
3bcb85ee65
PinMut: Add safe get_mut and rename unsafe fns to get_mut_unchecked and map_unchecked
2018-06-23 18:29:56 +02:00
Esteban Küber
776544f011
Add message to rustc_on_unimplemented attributes in core
2018-06-19 15:19:13 -07:00
tinaun
fb507cadf3
add inherent methods to Poll
2018-06-09 00:38:11 -04:00
tinaun
49eb754cc0
addressed nits
2018-06-08 23:16:51 -04:00
tinaun
6e5c18e8dc
add a few blanket future impls to std
2018-06-08 17:56:59 -04:00
Pazzaz
368fe37c22
Add more links in panic docs
2018-04-29 13:45:33 +02:00
memoryleak47
64ddb390ef
typos
2018-04-05 13:04:00 +02:00
bors
1ad094d81c
Auto merge of #47687 - SimonSapin:panic-impl, r=sfackler
...
RFC 2070 part 1: PanicInfo and Location API changes
This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html
Tracking issue: https://github.com/rust-lang/rust/issues/44489
* Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`.
* Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`.
* Implement `Display` for `PanicInfo` and `Location`
2018-02-18 06:02:35 +00:00
Simon Sapin
2f98f4b12b
Move PanicInfo and Location to libcore
...
Per https://rust-lang.github.io/rfcs/2070-panic-implementation.html
2018-01-23 16:38:26 +01:00
Simon Sapin
3f557947ab
NonNull ended up landing in 1.25
2018-01-21 09:48:23 +01:00
Simon Sapin
55c50cd8ac
Stabilize std::ptr::NonNull
2018-01-20 11:09:23 +01:00
Simon Sapin
c97c1f7dc3
Mark Unique as perma-unstable, with the feature renamed to ptr_internals.
2018-01-20 11:09:23 +01:00
Simon Sapin
f19baf0977
Rename std::ptr::Shared to NonNull
...
`Shared` is now a deprecated `type` alias.
CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-20 10:55:16 +01:00
leonardo.yvens
02b5fee732
Adjust tests for removal of impl Foo for .. {}
2018-01-13 18:48:00 +03:00
leonardo.yvens
f93183adb4
Remove impl Foo for .. in favor of auto trait Foo
...
No longer parse it.
Remove AutoTrait variant from AST and HIR.
Remove backwards compatibility lint.
Remove coherence checks, they make no sense for the new syntax.
Remove from rustdoc.
2018-01-13 18:48:00 +03:00
Marco A L Barbosa
941852eef3
Fix some docs summary nits
2017-11-20 14:46:31 -02:00
leonardo.yvens
8b586e68b5
auto trait future compatibility lint
2017-11-03 16:13:21 -02:00
Bastien Orivel
3ab86fbab2
Fix some typos
2017-08-12 14:01:11 +02:00
Bastien Orivel
47cb3c5bc2
Fix some typos
2017-08-11 00:16:18 +02:00
gaurikholkar
bc7eb3bd3a
Changing error message for interior mutability, adding ui test
2017-06-07 01:38:05 +05:30
Alex Crichton
347e1af66b
std: Relax UnwindSafe impl for Unique
...
Add the `?Sized` bound as we don't require the type to be sized.
Closes #40011
2017-02-21 14:36:24 -08:00
Oliver Middleton
9128f6100c
Fix a few impl stability attributes
...
The versions show up in rustdoc.
2017-01-29 13:31:47 +00:00
Corey Farwell
86fc63e62d
Implement fmt::Debug for all structures in libstd.
...
Part of https://github.com/rust-lang/rust/issues/31869 .
Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-18 14:55:14 -08:00
Andrew Paseltiner
f8322035eb
Implement RefUnwindSafe for atomic types
...
Closes #37136
2016-10-16 19:48:59 -04:00
Oliver Middleton
06a7dcd355
std: Correct stability attributes for some implementations
...
These are displayed by rustdoc so should be correct.
2016-10-01 23:58:14 +01:00
Jeffrey Seyfried
9a2c8783d9
Use #[prelude_import] in libstd.
2016-08-24 22:12:48 +00:00
Nikhil Shagrithaya
00b1e88680
Added a shim around rust_panic to update panic counter
2016-08-10 22:04:41 +05:30
Aaron Gallagher
fbec232df1
Set unwind_safe_lock_refs stability to 1.12.0.
...
This is the first (and presumably only) use of this feature.
2016-07-11 07:34:20 -07:00
Aaron Gallagher
c11540587f
Mutex and RwLock need RefUnwindSafe too.
2016-07-10 15:22:15 -07:00
Alex Crichton
b64c9d5670
std: Clean out old unstable + deprecated APIs
...
These should all have been deprecated for at least one cycle, so this commit
cleans them all out.
2016-05-30 20:46:32 -07:00
Manish Goregaokar
0a6bf3744b
Rollup merge of #33831 - diwic:patch-1, r=aturon
...
panic.rs: fix docs (recover -> catch_unwind)
The current docs are a bit inconsistent. First, change all references of "recover" to "catch_unwind" because the function was renamed. Second, consistently use the term "unwind safe" instead of "panic safe", "exception safe" and "recover safe" (all these terms were used previously).
2016-05-28 19:52:16 +05:30
bors
d5759a3417
Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturon
...
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 #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
2016-05-25 20:36:09 -07:00
Alex Crichton
cae91d7c8c
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 #27717
Closes #27720
cc #27784 (but encode methods still exist)
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-24 09:00:39 -07:00
diwic
86a6256270
panic.rs: fix docs (recover -> catch_unwind)
...
The current docs are a bit inconsistent. First, change all references of "recover" to "catch_unwind" because the function was renamed. Second, consistently use the term "unwind safe" instead of "panic safe", "exception safe" and "recover safe" (all these terms were used previously).
2016-05-24 07:28:32 +02:00
Steven Fackler
78e06adca7
Mention that the panic hook will always run
2016-05-19 22:35:09 -07:00