File: disallow-contract-annotation-on-non-fn.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (53 lines) | stat: -rw-r--r-- 1,953 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
error: contract annotations can only be used on functions
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:7:1
   |
LL | #[core::contracts::requires(true)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations can only be used on functions
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:11:1
   |
LL | #[core::contracts::ensures(|v| v == 100)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations is only supported in functions with bodies
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:16:1
   |
LL | #[core::contracts::ensures(|v| v == 100)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations is only supported in functions with bodies
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:20:1
   |
LL | #[core::contracts::ensures(|v| v == 100)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations can only be used on functions
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:24:1
   |
LL | #[core::contracts::requires(true)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations can only be used on functions
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:35:1
   |
LL | #[core::contracts::ensures(|dummy| dummy.0 > 0)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: contract annotations can only be used on functions
  --> $DIR/disallow-contract-annotation-on-non-fn.rs:46:1
   |
LL | #[core::contracts::requires(true)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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