about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-11-23 20:50:15 +0800
committerGitHub <noreply@github.com>2024-11-23 20:50:15 +0800
commit75b8f433e38dfed6aa16a42137bf048d8e668d27 (patch)
treec99066c6f99b6df10b438a81575603a3a75ba6cd /compiler/rustc_codegen_llvm/src
parent92f5144c9c30804384be66b3fc54e61d358d0114 (diff)
parent514ef180fd631b01c0f119991baaf217735ca849 (diff)
downloadrust-75b8f433e38dfed6aa16a42137bf048d8e668d27.tar.gz
rust-75b8f433e38dfed6aa16a42137bf048d8e668d27.zip
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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions