Clément Renault
7952ea5a04
Fix the fmt issues
2020-12-10 19:44:37 +01:00
Clément Renault
45693b43a5
Mute the file-length error
2020-12-10 18:36:07 +01:00
Clément Renault
5190fe4979
Mark the Iterator last self parameter as mut
2020-12-10 11:58:52 +01:00
Clément Renault
6a5a60048d
Indicate the anonymous lifetime of the GroupBy and GroupByMut
2020-12-10 11:47:15 +01:00
bors
39b841dfe3
Auto merge of #79621 - usbalbin:constier_maybe_uninit, r=RalfJung
...
Constier maybe uninit
I was playing around trying to make `[T; N]::zip()` in #79451 be `const fn`. One of the things I bumped into was `MaybeUninit::assume_init`. Is there any reason for the intrinsic `assert_inhabited<T>()` and therefore `MaybeUninit::assume_init` not being `const`?
---
I have as best as I could tried to follow the instruction in [library/core/src/intrinsics.rs](https://github.com/rust-lang/rust/blob/master/library/core/src/intrinsics.rs#L11 ). I have no idea what I am doing but it seems to compile after some slight changes after the copy paste. Is this anywhere near how this should be done?
Also any ideas for name of the feature gate? I guess `const_maybe_assume_init` is quite misleading since I have added some more methods. Should I add test? If so what should be tested?
2020-12-10 10:46:38 +00:00
Clément Renault
0ebf8e13f0
Import the GroupBy and GroupByMut in the slice module
2020-12-10 11:41:43 +01:00
Clément Renault
1b406afe23
Use none as the issue instead of 0
2020-12-10 11:37:40 +01:00
Clément Renault
005912fce8
Implement last on the GroupBy and GroupByMut Iterators
2020-12-10 11:22:29 +01:00
Clément Renault
e16eaeaa11
Implement size_hint on the GroupBy and GroupByMut Iterators
2020-12-10 11:22:20 +01:00
Clément Renault
1c55a73b75
Implement it with only safe code
2020-12-10 11:20:15 +01:00
Clément Renault
a891f6edfe
Introduce the GroupBy and GroupByMut Iterators
2020-12-10 10:16:29 +01:00
Tomasz Miąsko
cf5bd26329
Describe why size_align have not been inlined so far
2020-12-10 00:00:00 +00:00
Pratyush Mishra
56d9784b5a
Fix typo in wrapping_shl documentation
2020-12-09 15:14:58 -08:00
Max Sharnoff
72a7f73610
Apply suggestions from code review
...
Co-authored-by: Camelid <camelidcamel@gmail.com >
2020-12-09 23:13:24 +00:00
sharnoff
1c36bb2f69
add docs note about Any::type_id on smart pointers
2020-12-09 22:43:59 +00:00
bors
1cc4107109
Auto merge of #79867 - tmandry:rollup-7mubs3b, r=tmandry
...
Rollup of 12 pull requests
Successful merges:
- #79732 (minor stylistic clippy cleanups)
- #79750 (Fix trimming of lint docs)
- #79777 (Remove `first_merge` from liveness debug logs)
- #79795 (Privatize some of libcore unicode_internals)
- #79803 (Update xsv to prevent random CI failures)
- #79810 (Account for gaps in def path table during decoding)
- #79818 (Fixes to Rust coverage)
- #79824 (Strip prefix instead of replacing it with empty string)
- #79826 (Simplify visit_{foreign,trait}_item)
- #79844 (Move RWUTable to a separate module)
- #79861 (Update LLVM submodule)
- #79862 (Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-09 22:21:55 +00:00
Tyler Mandry
26e4cf0fc7
Rollup merge of #79795 - matklad:unicode-private, r=cramertj
...
Privatize some of libcore unicode_internals
My understanding is that these API are perma unstable, so it doesn't
make sense to pollute docs & IDE completion[1] with them.
[1]: https://github.com/rust-analyzer/rust-analyzer/issues/6738
2020-12-09 13:38:22 -08:00
bors
f0f68778f7
Auto merge of #77611 - oli-obk:atomic_miri_leakage, r=nagisa
...
Directly use raw pointers in `AtomicPtr` store/load
I was unable to find any reason for this limitation in the latest source of LLVM or in the documentation [here](http://llvm.org/docs/Atomics.html#libcalls-atomic ).
fixes https://github.com/rust-lang/miri/issues/1574
2020-12-09 19:53:23 +00:00
Albin Hedman
077527170b
Make write and slice_as_[mut_]_ptr const
2020-12-08 00:07:34 +01:00
Albin Hedman
174935988f
Make assume_init_{ref,mut} const
2020-12-08 00:05:26 +01:00
bors
b5ff9c3d05
Auto merge of #79773 - lcnr:type-visitor, r=oli-obk
...
small `TypeVisitor` refactor
cc `@LeSeulArtichaut` `@scottmcm`
adds `ControlFlow::map_break`
2020-12-07 15:07:09 +00:00
Bastian Kauschke
e3e4870bce
small TypeVisitor refactor
2020-12-07 15:52:59 +01:00
Aleksey Kladov
88da5682c3
Privatize some of libcore unicode_internals
...
My understanding is that these API are perma unstable, so it doesn't
make sense to pollute docs & IDE completion[1] with them.
[1]: https://github.com/rust-analyzer/rust-analyzer/issues/6738
2020-12-07 16:16:42 +03:00
bors
e5721a5283
Auto merge of #79641 - sourcefrog:split-example, r=dtolnay
...
Add a doctest example of str::split on a slice of chars
This is mentioned as supported, but the semantics are not described.
2020-12-07 06:05:34 +00:00
Albin Hedman
d0a1e40eae
Remove unused feature gate
2020-12-06 22:29:13 +01:00
Albin Hedman
4255a5afd5
Moved failing test to src/test/ui/
...
Still have not figured out how to make it work
2020-12-06 19:01:03 +01:00
Albin Hedman
94762417e8
Still unable to get the tests working
2020-12-05 19:41:02 +01:00
Albin Hedman
7bd754cf8c
Fix tests (hopefully)
2020-12-05 18:39:10 +01:00
oli
fda4c8d5c1
Update documentation to review comments
2020-12-04 17:28:22 +00:00
Tim Diekmann
9274b37d99
Rename AllocRef to Allocator and (de)alloc to (de)allocate
2020-12-04 14:47:15 +01:00
Dylan DPC
88f0c72dc6
Rollup merge of #79611 - poliorcetics:use-std-in-docs, r=jyn514
...
Use more std:: instead of core:: in docs for consistency
``@rustbot`` label T-doc
Some cleanup work to use `std::` instead of `core::` in docs as much as possible. This helps with terminology and consistency, especially for newcomers from other languages that have often heard of `std` to describe the standard library but not of `core`.
Edit: I also added more intra doc links when I saw the opportunity.
2020-12-04 03:30:27 +01:00
bors
d015f0d921
Auto merge of #79594 - vn-ki:const-eval-intrinsic, r=oli-obk
...
add const_allocate intrinsic
r? `@oli-obk`
fixes #75390
2020-12-03 09:44:07 +00:00
Albin Hedman
4f9fd2a5d4
Undo fn -> const fn for all intrinsics but assert_inhabited
2020-12-02 21:07:40 +01:00
Albin Hedman
f311db100b
Added tests for assume_init
2020-12-02 19:14:10 +01:00
Martin Pool
0273f6f849
Add a doctest example of str::split on a slice of chars
...
This is mentioned as supported, but the semantics are not described.
2020-12-02 08:54:42 -08:00
Albin Hedman
1ef5dbe716
Resolved some of the comments
...
* Undo fn -> const fn for some fns.
* Split feature gate.
* Made all three intrinsics const
2020-12-02 16:17:37 +01:00
Albin Hedman
91772c35c8
Even more const
2020-12-02 03:22:47 +01:00
Albin Hedman
8bd80e25f0
Make some of MaybeUninit's methods const
2020-12-02 03:22:47 +01:00
Alexis Bourget
4eb76fcc8e
Use more std:: instead of core:: in docs for consistency, add more intra doc links
2020-12-02 00:41:53 +01:00
Vishnunarayan K I
b5b811aab4
review comments
2020-12-01 19:48:09 +05:30
Mara Bos
b565fe241e
Rollup merge of #79038 - CDirkx:move-ui-tests, r=dtolnay
...
Change ui test that are run-pass and that do not test the compiler to library tests
Part of #76268 , these are some of the relevant ui tests I found that can be replaced by library tests.
Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is `env_home_dir`, where I added code to restore the old home dir after testing.
All moved tests:
| ui test | library test file | test |
| --- | --- | --- |
| `const\ascii_ctype.rs` | `core\tests\ascii.rs` | `ascii_ctype_const` |
| `const\const-str-ptr.rs` | `alloc\tests\str.rs` | `const_str_ptr` |
| `assert-eq-trailing-comma.rs` | `core\tests\macros.rs` | `assert_eq_trailing_comma` |
| `assert-escape.rs` | `core\tests\macros.rs` | `assert_escape` |
| `assert-ne-trailing-comma.rs` | `core\tests\macros.rs` | `assert_ne_trailing_comma` |
| `atomic-access-bool.rs` | `core\tests\atomic.rs` | `atomic_access_bool` |
| `atomic-alignment.rs` | `core\tests\atomic.rs` | `atomic_alignment` |
| `atomic-compare_exchange.rs` | `core\tests\atomic.rs` | `atomic_compare_exchange` |
| ~~`atomic-print.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`atomic_print`~~ |
| `bool.rs` | `core\tests\bool.rs` | `test_bool` |
| `bool_not.rs` | `core\tests\bool.rs` | `test_bool_not` |
| `char_unicode.rs` | `core\tests\unicode.rs` | `version` |
| `cmp-default.rs` | `core\tests\cmp.rs` | `cmp_default` |
| `deref-mut-on-ref.rs` | `core\tests\ops.rs` | `deref_mut_on_ref` |
| `deref-on-ref.rs` | `core\tests\ops.rs` | `deref_on_ref` |
| `env-home-dir.rs` | `std\tests\env.rs` | `env_home_dir` |
| ~~`env-vars.rs`~~ | ~~`std\tests\env.rs`~~ | ~~`env_vars`~~ |
| `extend-for-unit.rs` | `core\tests\iter.rs` | `extend_for_unit` |
| `offset_from.rs` | `core\tests\ptr.rs` | `offset_from` |
| `option-ext.rs` | `core\tests\option.rs` | `option_ext` |
| `result-opt-conversions.rs` | `core\tests\result.rs` | `result_opt_conversions` |
| `sleep.rs` | `std\tests\thread.rs` | `sleep` |
| ~~`try-wait.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`try_wait`~~ |
| `utf8.rs` | `alloc\tests\str.rs` | `utf8` |
| `utf8_chars.rs` | `alloc\tests\str.rs` | `utf8_chars` |
| `wrapping-int-api.rs` | `core\tests\num\wrapping.rs` | `wrapping_int_api` |
2020-12-01 10:50:02 +00:00
Vishnunarayan K I
528355c541
add const_allocate intrisic
2020-12-01 15:39:25 +05:30
Alexis Bourget
5bdd640913
Fix several broken links in doc that used the wrong qualifier or Self::
2020-11-30 21:21:15 +01:00
Alexis Bourget
c0560c2755
Back to #method for links on char
2020-11-30 21:18:56 +01:00
Alexis Bourget
af40c04301
ptr links
2020-11-30 21:18:56 +01:00
Alexis Bourget
ac8d1173b5
Use core::primitive module instead of prim@
2020-11-30 21:18:56 +01:00
Alexis Bourget
a5726eb28d
Use Self:: in links
2020-11-30 21:18:56 +01:00
Alexis Bourget
b702060865
Intra doc links for iterator adapters
2020-11-30 21:18:55 +01:00
Alexis Bourget
b3b1e0c224
Intra doc links for f32/f64
2020-11-30 21:18:55 +01:00
Alexis Bourget
4e54b4c3e6
Intra doc links for the pointer primitive
2020-11-30 21:18:55 +01:00