Commit Graph

17 Commits

Author SHA1 Message Date
Soni L 8d5a4963df Implement Default for AssertUnwindSafe
Trait impls are still insta-stable yeah...?
2022-04-11 17:56:27 -03:00
bjorn3 6a7ff98a99 Revert "Mark Location::caller() as #[inline]"
This reverts commit 6d0b61e2f5.
2022-04-06 18:45:11 +02:00
bjorn3 6d0b61e2f5 Mark Location::caller() as #[inline]
This function gets compiled to a single register move as it actually
gets it's return value passed in as argument.
2022-04-03 20:32:39 +02:00
T-O-R-U-S 72a25d05bf Use implicit capture syntax in format_args
This updates the standard library's documentation to use the new syntax. The
documentation is worthwhile to update as it should be more idiomatic
(particularly for features like this, which are nice for users to get acquainted
with). The general codebase is likely more hassle than benefit to update: it'll
hurt git blame, and generally updates can be done by folks updating the code if
(and when) that makes things more readable with the new format.

A few places in the compiler and library code are updated (mostly just due to
already having been done when this commit was first authored).
2022-03-10 10:23:40 -05:00
Matthias Krüger f1c918f1f3 Rollup merge of #93613 - crlf0710:rename_to_async_iter, r=yaahc
Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`

Following amendments in https://github.com/rust-lang/rfcs/pull/3208/.

cc #79024
cc ``@yoshuawuyts`` ``@joshtriplett``
2022-02-18 16:23:32 +01:00
Charles Lew 18130a21dc Move {core,std}::stream::Stream to {core,std}::async_iter::AsyncIterator. 2022-02-03 21:03:06 +08:00
Amanieu d'Antras f738669b63 Clarify safety of PanicInfo::can_unwind 2022-01-30 21:33:51 +01:00
Amanieu d'Antras 528c4f9158 Add PanicInfo::can_unwind which indicates whether a panic handler is
allowed to trigger unwinding.
2022-01-17 00:39:28 +00:00
Matthias Krüger 95750ae439 Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett
Add #[must_use] to remaining core functions

I've run out of compelling reasons to group functions together across crates so I'm just going to go module-by-module. This is everything remaining from the `core` crate.

Ignored by clippy for reasons unknown:

```rust
core::alloc::Layout   unsafe fn for_value_raw<T: ?Sized>(t: *const T) -> Self;
core::any             const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str;
```

Ignored by clippy because of `mut`:

```rust
str   fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str);
```

<del>
Ignored by clippy presumably because a caller might want `f` called for side effects. That seems like a bad usage of `map` to me.

```rust
core::cell::Ref<'b, T>   fn map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, T>;
core::cell::Ref<'b, T>   fn map_split<U: ?Sized, V: ?Sized, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>);
```
</del>

Parent issue: #89692

r? ```@joshtriplett```
2021-10-31 09:20:26 +01:00
John Kugelman 68b0d86294 Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
Gary Guo 9370156957 Deduplicate panic_fmt
std's begin_panic_fmt and core's panic_fmt are duplicates.
Merge them to declutter code and remove a lang item.
2021-10-19 15:02:21 +01:00
David Tolnay d1586fc6bb Fix unused sync::atomic import on targets without atomics 2021-07-31 17:27:29 -07:00
David Tolnay 60fa568c31 Fix some broken rustdoc links in core::panic documentation 2021-07-30 10:42:20 -07:00
David Tolnay 6d988dc1e3 Fix undocumented unsafe in AssertUnwindSafe impls 2021-07-30 10:42:18 -07:00
David Tolnay 4e17994b2c Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core 2021-07-30 10:42:15 -07:00
David Tolnay 76e73b74a6 Fix separation of public vs internal parts of Location 2021-07-30 10:40:02 -07:00
David Tolnay d7c82ba4a1 Split core::panic module to subdirectory 2021-07-30 10:39:56 -07:00