Commit graph

20 commits

Author SHA1 Message Date
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00
David Tolnay
c737169fe5
Format libcore with rustfmt (including tests and benches) 2019-12-06 20:20:51 -08:00
Brad Gibson
d1aca3aea5 renamed inner_deref feature's deref*() methods as_deref*() as per discussion https://github.com/rust-lang/rust/issues/50264 2019-07-18 15:17:30 +09:00
Ralf Jung
4888b1fb99 we can now skip should_panic tests with the libtest harness 2019-03-10 17:47:42 +01:00
Ralf Jung
26ade1cfaa mark failures expected due to panics 2019-02-13 17:56:43 +01:00
Ralf Jung
81613ad7cf disable tests in Miri 2019-02-07 18:24:10 +01:00
bors
a7be40c65a Auto merge of #56534 - xfix:copied, r=@SimonSapin
Add unstable Iterator::copied()

Initially suggested at https://github.com/bluss/rust-itertools/pull/289, however the maintainers of itertools suggested this may be better of in a standard library.

The intent of `copied` is to avoid accidentally cloning iterator elements after doing a code refactoring which causes a structure to be no longer `Copy`. This is a relatively common pattern, as it can be seen by calling `rg --pcre2 '[.]map[(][|](?:(\w+)[|] [*]\1|&(\w+)[|] \2)[)]'` on Rust main repository. Additionally, many uses of `cloned` actually want to simply `Copy`, and changing something to be no longer copyable may introduce unnoticeable performance penalty.

Also, this makes sense because the standard library includes `[T].copy_from_slice` to pair with `[T].clone_from_slice`.

This also adds `Option::copied`, because it makes sense to pair it with `Iterator::copied`. I don't think this feature is particularly important, but it makes sense to update `Option` along with `Iterator` for consistency.
2018-12-26 19:39:19 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Konrad Borowski
fcc46040a9 Add tests for Option::copied() 2018-12-05 15:40:14 +01:00
Brad Gibson
56016cb1e0 resolved upstream merge conflicts 2018-07-29 22:13:12 -07:00
Tatsuyuki Ishi
66c4dc9769 Add missing dyn 2018-07-25 10:24:31 +09:00
Clément RENAULT
af87a3594a
Add a basic test to Option::replace 2018-07-09 14:50:54 +02:00
Brad Gibson
c025fdebba fixed some and added more tests 2018-04-30 13:56:52 -07:00
Brad Gibson
17124488c7 fixed inner_deref test case for None 2018-04-27 07:07:26 -07:00
Brad Gibson
4c2e3144a9 added DerefOption and DerefResult + tests to std 2018-04-26 18:14:23 -07:00
Hunter Praska
28996db803 Rename option::Missing to NoneError 2017-09-27 17:57:07 -04:00
Hunter Praska
8f63e8de46 Add docs for Missing, correct Option's Try test 2017-09-27 17:56:54 -04:00
Hunter Praska
f098d7be29 Add tests for Option and Result Try impl 2017-09-27 17:56:40 -04:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Stjepan Glavina
13c744f30d Move libXtest into libX/tests
This change moves:

1. `libcoretest` into `libcore/tests`
2. `libcollectionstest` into `libcollections/tests`

This is a follow-up to #39561.
2017-04-03 20:49:39 +02:00
Renamed from src/libcoretest/option.rs (Browse further)