<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/core/src/ops, branch stable</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=stable</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=stable'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-07-29T10:19:48+00:00</updated>
<entry>
<title>Rollup merge of #144167 - zachs18:rangebounds-not-unsized-reason, r=tgross35</title>
<updated>2025-07-29T10:19:48+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-07-29T10:19:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9cba49896c2a7d491c92b7c2e6159adfec369af9'/>
<id>urn:sha1:9cba49896c2a7d491c92b7c2e6159adfec369af9</id>
<content type='text'>
Document why `Range*&lt;&amp;T&gt; as RangeBounds&lt;T&gt;` impls are not `T: ?Sized`, and give an alternative.

`Range*&lt;&amp;T&gt; as RangeBounds&lt;T&gt;` impls have been tried to be relaxed to `T: ?Sized` at least twice:

* https://github.com/rust-lang/rust/pull/61584
* https://github.com/rust-lang/rust/pull/64327

I also was just about to make another PR to do it again until I `./x.py test library/alloc` and rediscovered the type inference regression, then searched around and found the previous PRs. Hence this PR instead so hopefully that doesn't keep happening :stuck_out_tongue:.

These impls cannot be relaxed for two reasons:

1. Type inference regressions: See ``@SimonSapin's`` explanation from a previous PR: https://github.com/rust-lang/rust/pull/61584#issuecomment-499601046
2. It's a breaking change: `impl RangeBounds&lt;MyUnsizedType&gt; for std::ops::Range&lt;&amp;MyUnsizedType&gt;` is allowed after the coherence rebalance ([playground link](https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2024&amp;gist=f704a6fe53bfc33e55b2fc246d895ec2)), and relaxing these impls would conflict with that downstream impl.

This PR adds doc-comments explaining that not having `T: ?Sized` is intentional[^1], and gives an explicit alternative: `(Bound&lt;&amp;T&gt;, Bound&lt;&amp;T&gt;)`.

Technically, the impls for the unstable new `std::range` types could be relaxed, as they are still unstable so the change would not be breaking, but having them be different in this regard seems worse (and the non-iterable `RangeTo/RangeToInclusive` range types are shared between the "new" and "old" so cannot be changed anyway), and then the type inference regression would pop up in whatever edition the new range types stabilize in.

The "see \&lt;link\&gt; for discussion of those issues" is intentionally left as a non-doc comment just for whoever may try to relax these impls again in the future, but if it is preferred to have the link in the docs I can add that.

Closes https://github.com/rust-lang/rust/issues/107196 (as wontfix)
CC https://github.com/rust-lang/rust/issues/64027

[^1]: "intentional" is maybe a bit of strong wording, should it instead say something like "was stabilized without it and it would be breaking to change it now"?
</content>
</entry>
<entry>
<title>Rollup merge of #143424 - hkBst:auto-deref, r=jhpratt</title>
<updated>2025-07-25T09:16:34+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-07-25T09:16:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dd159ee24e06badc4289bb510f75949908d1a422'/>
<id>urn:sha1:dd159ee24e06badc4289bb510f75949908d1a422</id>
<content type='text'>
clippy fix: rely on autoderef

Changes instances of `&amp;**self` to `self`.
</content>
</entry>
<entry>
<title>Document (internally) that `Range*&lt;&amp;T&gt; as RangeBounds&lt;T&gt;` impls are intentionally not `T: ?Sized`, and document (publically) an alternative.</title>
<updated>2025-07-23T20:39:03+00:00</updated>
<author>
<name>Zachary S</name>
<email>zasample18+github@gmail.com</email>
</author>
<published>2025-07-19T06:09:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=477814a3e4e33993a2f37c906747a0c2b1e4102e'/>
<id>urn:sha1:477814a3e4e33993a2f37c906747a0c2b1e4102e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Constify Try, From, TryFrom</title>
<updated>2025-07-21T09:49:45+00:00</updated>
<author>
<name>Evgenii Zheltonozhskii</name>
<email>zheltonozhskiy@gmail.com</email>
</author>
<published>2025-07-21T09:49:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c76e3d0026ea9904358b1614bbd9c4f8b7cedf5'/>
<id>urn:sha1:3c76e3d0026ea9904358b1614bbd9c4f8b7cedf5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>constify `Index` trait and its slice impls</title>
<updated>2025-07-15T08:27:15+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-07-11T09:24:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2b4ede7e3d37de731821b5b04a6f1fce269c1afb'/>
<id>urn:sha1:2b4ede7e3d37de731821b5b04a6f1fce269c1afb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>update issue number for `const_trait_impl`</title>
<updated>2025-07-13T15:55:06+00:00</updated>
<author>
<name>Deadbeef</name>
<email>ent3rm4n@gmail.com</email>
</author>
<published>2025-07-13T08:21:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6b02597ed3dc7a7c3581960ca6afae575f6c691e'/>
<id>urn:sha1:6b02597ed3dc7a7c3581960ca6afae575f6c691e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix const_ops tracking issue</title>
<updated>2025-07-11T15:57:50+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-11T15:57:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b94083e87fcbacaf9d76176742d2fe984b5aaae4'/>
<id>urn:sha1:b94083e87fcbacaf9d76176742d2fe984b5aaae4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #143640 - oli-obk:const-fn-traits, r=compiler-errors</title>
<updated>2025-07-10T18:28:49+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-07-10T18:28:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b4089bf4178bc88ef7dc66e8e68e7d23f33dc85a'/>
<id>urn:sha1:b4089bf4178bc88ef7dc66e8e68e7d23f33dc85a</id>
<content type='text'>
Constify `Fn*` traits

r? `@compiler-errors` `@fee1-dead`

this should unlock a few things. A few `const_closures` tests have broken even more than before, but that feature is marked as incomplete anyway

cc rust-lang/rust#67792
</content>
</entry>
<entry>
<title>Rollup merge of #143426 - hkBst:clippy-fix-indent-1, r=jhpratt</title>
<updated>2025-07-09T03:50:27+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>t.gross35@gmail.com</email>
</author>
<published>2025-07-09T03:50:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0d99b5585b5f0d69f162472a83134e277a6c3839'/>
<id>urn:sha1:0d99b5585b5f0d69f162472a83134e277a6c3839</id>
<content type='text'>
clippy fix: indentation

Fixes indentation of markdown comments.
</content>
</entry>
<entry>
<title>Constify `Fn*` traits</title>
<updated>2025-07-08T14:36:43+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-07-03T09:14:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=543c860ea6c78e77b0a12685e066a74fe26dc301'/>
<id>urn:sha1:543c860ea6c78e77b0a12685e066a74fe26dc301</id>
<content type='text'>
</content>
</entry>
</feed>
