rust/compiler/rustc_passes/src
许杰友 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
..
liveness Reformat use declarations. 2024-07-29 08:26:52 +10:00
abi_test.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
check_attr.rs Rollup merge of #132732 - gavincrawford:as_ptr_attribute, r=Urgau 2024-11-20 01:54:24 -05:00
check_const.rs nightly feature tracking: get rid of the per-feature bool fields 2024-10-23 09:14:41 +01:00
dead.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
debugger_visualizer.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
diagnostic_items.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
entry.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
errors.rs Auto merge of #127589 - notriddle:notriddle/search-sem-3, r=GuillaumeGomez 2024-11-11 12:26:00 +00:00
hir_id_validator.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
input_stats.rs Merge -Zhir-stats into -Zinput-stats 2024-11-15 12:46:40 -05:00
lang_items.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
layout_test.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
lib.rs Merge -Zhir-stats into -Zinput-stats 2024-11-15 12:46:40 -05:00
lib_features.rs nightly feature tracking: get rid of the per-feature bool fields 2024-10-23 09:14:41 +01:00
liveness.rs liveness checking, yeet TypingEnv::from_param_env 2024-11-19 18:06:20 +01:00
loops.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
naked_functions.rs various fixes for naked_asm! implementation 2024-10-06 19:00:09 +02:00
reachable.rs Rollup merge of #131049 - compiler-errors:more-validation, r=spastorino 2024-10-22 15:28:38 +02:00
stability.rs don't require const stability for const impls 2024-11-20 17:04:05 +08:00
upvars.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
weak_lang_items.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00