mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-27 02:53:43 +00:00
Instead of parsing the different components of a function signature, eagerly look for either the `where` keyword or the function body. - Also address feedback to use `From` instead of `TryFrom` in cranelift contract and ubcheck codegen.
15 lines
602 B
Plaintext
15 lines
602 B
Plaintext
error: contract annotations is only supported in functions with bodies
|
|
--> $DIR/contract-annotation-limitations.rs:17:5
|
|
|
|
|
LL | #[core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: contract annotations is only supported in functions with bodies
|
|
--> $DIR/contract-annotation-limitations.rs:21:5
|
|
|
|
|
LL | #[core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 2 previous errors
|
|
|