2025-01-15 13:54:04 -08:00
|
|
|
error: contract annotations can only be used on functions
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:7:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::requires(true)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations can only be used on functions
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:11:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::ensures(|v| v == 100)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations is only supported in functions with bodies
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:16:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::ensures(|v| v == 100)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations is only supported in functions with bodies
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:20:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::ensures(|v| v == 100)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations can only be used on functions
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:24:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::requires(true)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations can only be used on functions
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:35:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::ensures(|dummy| dummy.0 > 0)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
error: contract annotations can only be used on functions
|
2025-01-30 17:06:09 -08:00
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:46:1
|
2025-01-15 13:54:04 -08:00
|
|
|
|
|
|
|
|
|
LL | #[core::contracts::requires(true)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2025-01-30 17:06:09 -08:00
|
|
|
warning: the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
|
|
|
--> $DIR/disallow-contract-annotation-on-non-fn.rs:3:12
|
|
|
|
|
|
|
|
|
|
|
LL | #![feature(contracts)]
|
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
|
= note: see issue #128044 <https://github.com/rust-lang/rust/issues/128044> for more information
|
|
|
|
|
= note: `#[warn(incomplete_features)]` on by default
|
|
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors; 1 warning emitted
|
2025-01-15 13:54:04 -08:00
|
|
|
|