1
Fork 0
rust/compiler/rustc_passes
许杰友 Jieyou Xu (Joe) 75b8f433e3
Rollup merge of #133237 - fee1-dead-contrib:constadd, r=compiler-errors
Minimally constify `Add`

* This PR removes the requirement for `impl const` to have a const stability attribute. cc ``@RalfJung`` I believe you mentioned that it would make much more sense to require `const_trait`s to have const stability instead. I agree with that sentiment but I don't think that is _required_ for a small scale experimentation like this PR. https://github.com/rust-lang/project-const-traits/issues/16 should definitely be prioritized in the future, but removing the impl check should be good for now as all callers need `const_trait_impl` enabled for any const impl to work.
* This PR is intentionally minimal as constifying other traits can become more complicated (`PartialEq`, for example, would run into requiring implementing it for `str` as that is used in matches, which runs into the implementation for slice equality which uses specialization)

Per the reasons above, anyone who is interested in making traits `const` in the standard library are **strongly encouraged** to reach out to us on the [Zulip channel](https://rust-lang.zulipchat.com/#narrow/channel/419616-t-compiler.2Fproject-const-traits) before proceeding with the work.

cc ``@rust-lang/project-const-traits``

I believe there is prior approval from libs that we can experiment, so

r? project-const-traits
2024-11-23 20:50:15 +08:00
..
src Rollup merge of #133237 - fee1-dead-contrib:constadd, r=compiler-errors 2024-11-23 20:50:15 +08:00
Cargo.toml compiler: Add rustc_abi dependence to the compiler 2024-10-27 21:10:58 -07:00
messages.ftl Auto merge of #127589 - notriddle:notriddle/search-sem-3, r=GuillaumeGomez 2024-11-11 12:26:00 +00:00