about summary refs log tree commit diff
path: root/tests/ui/contracts/contract-captures-via-closure-noncopy.stderr
blob: b6f2e014e0a86eadfc325af28253492baf52b61c (plain)
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
warning: the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/contract-captures-via-closure-noncopy.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[E0277]: the trait bound `Baz: std::marker::Copy` is not satisfied in `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`
  --> $DIR/contract-captures-via-closure-noncopy.rs:12:1
   |
LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^^
   | |                                        |
   | |                                        within this `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`
   | |                                        this tail expression is of type `{closure@contract-captures-via-closure-noncopy.rs:12:42}`
   | unsatisfied trait bound
   | required by a bound introduced by this call
   |
   = help: within `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`, the trait `std::marker::Copy` is not implemented for `Baz`
note: required because it's used within this closure
  --> $DIR/contract-captures-via-closure-noncopy.rs:12:42
   |
LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })]
   |                                          ^^^^^^^^^^^^^^^
note: required by a bound in `build_check_ensures`
  --> $SRC_DIR/core/src/contracts.rs:LL:COL
help: consider annotating `Baz` with `#[derive(Copy)]`
   |
LL + #[derive(Copy)]
LL | struct Baz {
   |

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.