Skip to content

Commit 5d134c6

Browse files
celinvalgitbot
authored and
gitbot
committed
Rename rustc_contract to contract
This has now been approved as a language feature and no longer needs a `rustc_` prefix. Also change the `contracts` feature to be marked as incomplete and `contracts_internals` as internal.
1 parent b7bb312 commit 5d134c6

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Diff for: core/src/contracts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub use crate::macros::builtin::{contracts_ensures as ensures, contracts_require
66
/// Emitted by rustc as a desugaring of `#[ensures(PRED)] fn foo() -> R { ... [return R;] ... }`
77
/// into: `fn foo() { let _check = build_check_ensures(|ret| PRED) ... [return _check(R);] ... }`
88
/// (including the implicit return of the tail expression, if any).
9-
#[unstable(feature = "rustc_contracts_internals", issue = "133866" /* compiler-team#759 */)]
9+
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
1010
#[lang = "contract_build_check_ensures"]
1111
#[track_caller]
1212
pub fn build_check_ensures<Ret, C>(cond: C) -> impl (Fn(Ret) -> Ret) + Copy

Diff for: core/src/intrinsics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4051,8 +4051,8 @@ pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize)
40514051
/// checking is turned on, so that we can specify contracts in libstd
40524052
/// and let an end user opt into turning them on.
40534053
#[cfg(not(bootstrap))]
4054-
#[rustc_const_unstable(feature = "rustc_contracts_internals", issue = "133866" /* compiler-team#759 */)]
4055-
#[unstable(feature = "rustc_contracts_internals", issue = "133866" /* compiler-team#759 */)]
4054+
#[rustc_const_unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
4055+
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40564056
#[inline(always)]
40574057
#[rustc_intrinsic]
40584058
pub const fn contract_checks() -> bool {
@@ -4067,7 +4067,7 @@ pub const fn contract_checks() -> bool {
40674067
/// By default, if `contract_checks` is enabled, this will panic with no unwind if the condition
40684068
/// returns false.
40694069
#[cfg(not(bootstrap))]
4070-
#[unstable(feature = "rustc_contracts_internals", issue = "133866" /* compiler-team#759 */)]
4070+
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40714071
#[lang = "contract_check_requires"]
40724072
#[rustc_intrinsic]
40734073
pub fn contract_check_requires<C: Fn() -> bool>(cond: C) {
@@ -4082,7 +4082,7 @@ pub fn contract_check_requires<C: Fn() -> bool>(cond: C) {
40824082
/// By default, if `contract_checks` is enabled, this will panic with no unwind if the condition
40834083
/// returns false.
40844084
#[cfg(not(bootstrap))]
4085-
#[unstable(feature = "rustc_contracts_internals", issue = "133866" /* compiler-team#759 */)]
4085+
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40864086
#[rustc_intrinsic]
40874087
pub fn contract_check_ensures<'a, Ret, C: Fn(&'a Ret) -> bool>(ret: &'a Ret, cond: C) {
40884088
if contract_checks() && !cond(ret) {

Diff for: core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub mod autodiff {
248248
}
249249

250250
#[cfg(not(bootstrap))]
251-
#[unstable(feature = "rustc_contracts", issue = "133866")]
251+
#[unstable(feature = "contracts", issue = "128044")]
252252
pub mod contracts;
253253

254254
#[unstable(feature = "cfg_match", issue = "115585")]

Diff for: core/src/macros/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1783,8 +1783,8 @@ pub(crate) mod builtin {
17831783
/// eventually parsed as a unary closure expression that is
17841784
/// invoked on a reference to the return value.
17851785
#[cfg(not(bootstrap))]
1786-
#[unstable(feature = "rustc_contracts", issue = "133866")]
1787-
#[allow_internal_unstable(rustc_contracts_internals)]
1786+
#[unstable(feature = "contracts", issue = "128044")]
1787+
#[allow_internal_unstable(contracts_internals)]
17881788
#[rustc_builtin_macro]
17891789
pub macro contracts_ensures($item:item) {
17901790
/* compiler built-in */
@@ -1796,8 +1796,8 @@ pub(crate) mod builtin {
17961796
/// eventually parsed as an boolean expression with access to the
17971797
/// function's formal parameters
17981798
#[cfg(not(bootstrap))]
1799-
#[unstable(feature = "rustc_contracts", issue = "133866")]
1800-
#[allow_internal_unstable(rustc_contracts_internals)]
1799+
#[unstable(feature = "contracts", issue = "128044")]
1800+
#[allow_internal_unstable(contracts_internals)]
18011801
#[rustc_builtin_macro]
18021802
pub macro contracts_requires($item:item) {
18031803
/* compiler built-in */

0 commit comments

Comments
 (0)