Commit graph

172 commits

Author SHA1 Message Date
Josh Stone
9ce8930da6 Update version placeholders 2025-07-01 10:54:33 -07:00
xizheyin
b8066f94fd
Tracking the old name of renamed unstable library attribute
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-12 19:24:11 +08:00
Jacob Pratt
241ec137fb
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhpratt
Stabilize feature `result_flattening`

Stabilizes the `Result::flatten` method

## Implementations

- [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140
- [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692
- [x] Update stabilization attribute macros (this PR)

## Stabilization process

- [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung``
- [x] FCP (haven't found any, is it applicable here?)
- [ ] Close issue rust-lang/rust#70142
2025-06-01 00:35:50 +02:00
tk
eed065958b feat: map_or_default for result and option 2025-05-27 19:47:14 +02:00
Ryan van Polen
7e3e8bdec4 Updated feature and stable flags 2025-05-16 11:59:08 +02:00
Hegui Dai
cdc7298392 Solved suggestions 2025-04-25 11:06:53 +08:00
Hegui Dai
1fd928ef89 fix doc error 2025-04-24 12:23:53 +08:00
Hegui Dai
3a14991e77 fix example 2025-04-24 10:31:53 +08:00
Hegui Dai
56d5efc68c add examples using .as_ref() for is_err_and and is_ok_and 2025-04-24 10:10:30 +08:00
Hegui Dai
f86cd705cb keep original text for is_ok and is_err 2025-04-24 09:56:42 +08:00
Hegui Dai
f8f23309ca Solved suggestions 2025-04-21 10:14:35 +08:00
Hegui Dai
13303a5b8e Update the index of Result to make the summary more comprehensive 2025-03-26 14:37:06 +08:00
许杰友 Jieyou Xu (Joe)
e0846806db
Rollup merge of #138082 - thaliaarchi:slice-cfg-not-test, r=thomcc
Remove `#[cfg(not(test))]` gates in `core`

These gates are unnecessary now that unit tests for `core` are in a separate package, `coretests`, instead of in the same files as the source code. They previously prevented the two `core` versions from conflicting with each other.
2025-03-16 09:40:05 +08:00
Thalia Archibald
638b226a6a Remove #[cfg(not(test))] gates in core
These gates are unnecessary now that unit tests for `core` are in a
separate package, `coretests`, instead of in the same files as the
source code. They previously prevented the two `core` versions from
conflicting with each other.
2025-03-06 13:21:59 -08:00
Santiago Pastorino
dcdfd551f0
Add UseCloned trait related code 2025-03-06 17:58:32 -03:00
Kornel
7b42bc0c79
Less unwrap() in documentation 2024-12-21 01:26:47 +00:00
Boxy
22998f0785 update cfgs 2024-11-27 15:14:54 +00:00
Michael Howell
12dc24f460 rustdoc-search: simplify rules for generics and type params
This commit is a response to feedback on the displayed type
signatures results, by making generics act stricter.

Generics are tightened by making order significant. This means
`Vec<Allocator>` now matches only with a true vector of allocators,
instead of matching the second type param. It also makes unboxing
within generics stricter, so `Result<A, B>` only matches if `B`
is in the error type and `A` is in the success type. The top level
of the function search is unaffected.

Find the discussion on:

* <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149>
* <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265>
* <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search/near/476841363>
2024-10-30 12:27:48 -07:00
Josh Stone
acb09bf741 update bootstrap configs 2024-10-15 20:30:23 -07:00
Josh Stone
f204e2c23b replace placeholder version
(cherry picked from commit 567fd9610c)
2024-10-15 20:13:55 -07:00
Ralf Jung
92f65684a8 stabilize const_result 2024-10-11 18:34:28 +02:00
Ralf Jung
89c3cbafb8 make unstable Result::flatten a const fn 2024-09-22 08:40:25 +02:00
GnomedDev
3ebff28f80
[Clippy] Swap lines_filter_map_ok to use a diagnostic item instead of path 2024-09-19 08:26:41 +01:00
Ralf Jung
f7b4f4a73b Option, Result: put the &mut variants of 'copied' under the same feature as the '&' variants 2024-09-08 16:52:40 +02:00
Ralf Jung
3de6838238 add some FIXME(const-hack) 2024-09-08 08:30:28 +02:00
Ralf Jung
03e0c8edb2 make Result::copied unstably const 2024-09-07 22:23:12 +02:00
Ben Kimock
7f5d282185 Add a precondition check for Layout::from_size_align_unchecked 2024-08-19 17:18:17 -04:00
Georg Semmler
00da9fc961
Start using #[diagnostic::do_not_recommend] in the standard library
This commit starts using `#[diagnostic::do_not_recommend]` in the
standard library to improve some error messages. In this case we just
hide a certain nightly only impl as suggested in #121521
2024-07-22 07:29:59 +02:00
Guillaume Gomez
6dddc888fc
Rollup merge of #124870 - Lokathor:update-result-docs, r=dtolnay
Update Result docs to the new guarantees

The `Option` docs already explain the guarantees given in [RFC 3391](https://github.com/rust-lang/rfcs/blob/master/text/3391-result_ffi_guarantees.md), so all that we need is a paragraph saying that some `Result` type combinations will also qualify.

Part of https://github.com/rust-lang/rust/issues/110503
2024-05-27 13:10:33 +02:00
Lokathor
2b2f83e5ff github showed that weird. 2024-05-25 16:05:22 -06:00
Lokathor
2e8f14fb37 correct for copy paste errors when fixing wrapping. 2024-05-25 16:04:26 -06:00
Lokathor
939f2671a0 revert to the inconsistent paragraph wrapping. 2024-05-25 15:41:18 -06:00
Renato A
e1611aa690
Update library/core/src/result.rs
Co-authored-by: joboet <jonasboettiger@icloud.com>
2024-05-15 08:07:16 -03:00
Lokathor
b468f21051 Don't use T with both Result and Option, improve explanation. 2024-05-13 10:36:42 -06:00
Renato Alves
4a953dc5ff Fix assert 2024-05-10 08:10:30 -03:00
Renato Alves
336dd16d05 Refactor examples and enhance documentation in result.rs 2024-05-10 01:03:00 -03:00
Lokathor
10f8d1ffef use teletype on the attribute name 2024-05-07 18:35:00 -06:00
Lokathor
f94fa6bee3 Some Result combinations work like an Option. 2024-05-07 18:08:36 -06:00
Daniel Paoliello
d261647c93 Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00
Esteban Küber
f566867ace Add flatmap/flat_map -> and_then suggestions 2024-02-22 18:05:28 +00:00
Cameron Steffen
e9059cb8aa Improve Option::inspect docs 2024-02-09 09:53:30 -06:00
Scott McMurray
b858c591dd Tune the inlinability of Result::unwrap 2024-01-12 10:57:58 -08:00
Pietro Albini
c00486c9bb
update version placeholders 2023-12-22 11:01:42 +01:00
Slanterns
10e6372a83
Stabilize result_option_inspect 2023-10-18 07:35:23 +08:00
ravenclaw900
ba0b7f0f01
Add track_caller attribute to Result::unwrap_or_else 2023-10-01 09:42:37 -05:00
Matthias Krüger
e3bf088fb5
Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
Mark `map_or` as `#[must_use]`

I don't know what else to say.

r? libs
2023-07-30 14:25:08 +02:00
Maybe Waffle
90f9640528 Mark map_or as #[must_use] 2023-07-30 10:22:23 +00:00
Alex Povel
d4184dde6a
Fix typo 2023-07-16 19:55:03 +02:00
Pietro Albini
4e04da6183 replace version placeholders 2023-04-28 08:47:55 -07:00
Deadbeef
63e0ddbf1d core is now compilable 2023-04-16 07:20:26 +00:00