<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libcore/tests/lib.rs, branch 1.46.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.46.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.46.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2020-07-11T06:26:28+00:00</updated>
<entry>
<title>Rollup merge of #73887 - DutchGhost:master, r=oli-obk</title>
<updated>2020-07-11T06:26:28+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2020-07-11T06:26:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=efda2b58b095306d068a3a165de62acd1e94911b'/>
<id>urn:sha1:efda2b58b095306d068a3a165de62acd1e94911b</id>
<content type='text'>
stabilize const mem::forget

Stabilizes const `mem::forget` as implemented in https://github.com/rust-lang/rust/pull/69617 and tracked in https://github.com/rust-lang/rust/issues/69616.

Closes https://github.com/rust-lang/rust/issues/69616
</content>
</entry>
<entry>
<title>Deny unsafe ops in unsafe fns, part 3</title>
<updated>2020-06-30T15:06:16+00:00</updated>
<author>
<name>LeSeulArtichaut</name>
<email>leseulartichaut@gmail.com</email>
</author>
<published>2020-06-24T11:15:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac7539c6d1036e42e84d388a57a656c420cb9eee'/>
<id>urn:sha1:ac7539c6d1036e42e84d388a57a656c420cb9eee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stabilize const mem::forget</title>
<updated>2020-06-30T09:34:27+00:00</updated>
<author>
<name>Dodo</name>
<email>kasper199914@gmail.com</email>
</author>
<published>2020-06-30T08:53:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a065096ff40f7910fd58aa36a76be6cb1c5f1d4d'/>
<id>urn:sha1:a065096ff40f7910fd58aa36a76be6cb1c5f1d4d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #73032 - yoshuawuyts:stabilize-leading_trailing_ones, r=Amanieu</title>
<updated>2020-06-29T00:43:19+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-06-29T00:43:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c86039b33343de264d8b3b1a9e3591b10d5615e8'/>
<id>urn:sha1:c86039b33343de264d8b3b1a9e3591b10d5615e8</id>
<content type='text'>
stabilize leading_trailing_ones

This PR stabilizes the `leading_trailing_ones` feature. It's been available on nightly since the start of the year, and hasn't had any issues since. It seems unlikely we'll want to change this, so following up on @djc's suggestion in https://github.com/rust-lang/rust/issues/57969#issuecomment-638405264 I'd like to put forward this PR to stabilize the feature and make it part of `1.46.0`. Thanks!

cc/ @djc @rust-lang/libs
</content>
</entry>
<entry>
<title>Rollup merge of #73577 - VillSnow:master, r=Amanieu</title>
<updated>2020-06-28T15:30:22+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2020-06-28T15:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ec4898977a849fc73c8d3198e45c6f17c2bf177a'/>
<id>urn:sha1:ec4898977a849fc73c8d3198e45c6f17c2bf177a</id>
<content type='text'>
Add partition_point

Add partition_point in C++.
Although existing binary_search in rust does not suitable when the slice has multiple hits,
this function returns exact point of partition.
The definition of this function is very clear and able to accept general matter, therefore you can easily get index which you want like lower/upper_bound.

https://github.com/rust-lang/rfcs/issues/2184
</content>
</entry>
<entry>
<title>add: tests</title>
<updated>2020-06-22T12:36:35+00:00</updated>
<author>
<name>VillSnow</name>
<email>vill.snow@gmail.com</email>
</author>
<published>2020-06-22T12:36:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8cc6998cd460f8534b3cf643a7620354bd007856'/>
<id>urn:sha1:8cc6998cd460f8534b3cf643a7620354bd007856</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libcore tests: use min_specialization</title>
<updated>2020-06-16T11:07:15+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2020-06-16T11:07:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d1265e7679b748c3014b878c0e32178084a282ff'/>
<id>urn:sha1:d1265e7679b748c3014b878c0e32178084a282ff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stabilize leading_trailing_ones</title>
<updated>2020-06-05T14:37:27+00:00</updated>
<author>
<name>Yoshua Wuyts</name>
<email>yoshuawuyts@gmail.com</email>
</author>
<published>2020-06-05T14:37:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8bc6b5b45c9f9710852e2b9c57eb3d44d08ad245'/>
<id>urn:sha1:8bc6b5b45c9f9710852e2b9c57eb3d44d08ad245</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #72310 - jyn514:peekable-next-if, r=dtolnay</title>
<updated>2020-05-29T18:21:11+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2020-05-29T18:21:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cbcc4c4f05cef62d283d7205bd00ce7d7adcfec6'/>
<id>urn:sha1:cbcc4c4f05cef62d283d7205bd00ce7d7adcfec6</id>
<content type='text'>
Add Peekable::next_if

Prior art:

`rust_analyzer` uses [`Parser::eat`](https://github.com/rust-analyzer/rust-analyzer/blob/50f4ae798b7c54d417ee88455b87fd0477473150/crates/ra_parser/src/parser.rs#L94), which is `next_if` specialized to `|y| self.next_if(|x| x == y)`.

Basically every other parser I've run into in Rust has an equivalent of `Parser::eat`; see for example

- [cranelift](https://github.com/bytecodealliance/wasmtime/blob/94190d57244b26baf36629c88104b0ba516510cf/cranelift/reader/src/parser.rs#L498)
- [rcc](https://github.com/jyn514/rcc/blob/a8159c3904a0c950fbba817bf9109023fad69033/src/parse/mod.rs#L231)
- [crunch](https://github.com/Kixiron/crunch-lang/blob/8521874fab8a7d62bfa7dea8bd1da94b63e31be8/crates/crunch-parser/src/parser/mod.rs#L213-L241)

Possible extensions: A specialization of `next_if` to using `Eq::eq`. The only difficulty here is the naming - maybe `next_if_eq`?

Alternatives:
- Instead of `func: impl FnOnce(&amp;I::Item) -&gt; bool`, use `func: impl FnOnce(I::Item) -&gt; Option&lt;I::Item&gt;`. This has the advantage that `func` can move the value if necessary, but means that there is no guarantee `func` will return the same value it was given.
- Instead of `fn next_if(...) -&gt; Option&lt;I::Item&gt;`, use `fn next_if(...) -&gt; bool`. This makes the common case of `iter.next_if(f).is_some()` easier, but makes the unusual case impossible.

Bikeshedding on naming:
- `next_if` could be renamed to `consume_if` (to match `eat`, but a little more formally)
- `next_if_eq` could be renamed to `consume`. This is more concise but less self-explanatory if you haven't written a lot of parsers.
- Both of the above, but with `consume` replaced by `eat`.
</content>
</entry>
<entry>
<title>Add Peekable::next_if</title>
<updated>2020-05-27T01:55:18+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2020-05-18T00:15:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=822ad87325d6436a6aea5ae61ca34d9ad45dd839'/>
<id>urn:sha1:822ad87325d6436a6aea5ae61ca34d9ad45dd839</id>
<content type='text'>
Prior art:

`rust_analyzer` uses
[`Parser::eat`](https://github.com/rust-analyzer/rust-analyzer/blob/50f4ae798b7c54d417ee88455b87fd0477473150/crates/ra_parser/src/parser.rs#L94), which is `next_if` specialized to
`|y| next_if(|x| x == y)`.

Basically every other parser I've run into in Rust has an equivalent of
Parser::eat; see for example

- [cranelift](https://github.com/bytecodealliance/wasmtime/blob/94190d57244b26baf36629c88104b0ba516510cf/cranelift/reader/src/parser.rs#L498)
- [rcc](https://github.com/jyn514/rcc/blob/a8159c3904a0c950fbba817bf9109023fad69033/src/parse/mod.rs#L231)
- [crunch](https://github.com/Kixiron/crunch-lang/blob/8521874fab8a7d62bfa7dea8bd1da94b63e31be8/crates/crunch-parser/src/parser/mod.rs#L213-L241)
</content>
</entry>
</feed>
