]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / rfc-2632-const-trait-impl / const-drop-fail.stock.stderr
1 error[E0277]: can't drop `NonTrivialDrop` in const contexts
2 --> $DIR/const-drop-fail.rs:44:5
3 |
4 LL | const _: () = check($exp);
5 | ----- required by a bound introduced by this call
6 ...
7 LL | NonTrivialDrop,
8 | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
9 |
10 = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
11 note: required by a bound in `check`
12 --> $DIR/const-drop-fail.rs:35:19
13 |
14 LL | const fn check<T: ~const Destruct>(_: T) {}
15 | ^^^^^^^^^^^^^^^ required by this bound in `check`
16 help: consider borrowing here
17 |
18 LL | &NonTrivialDrop,
19 | +
20 LL | &mut NonTrivialDrop,
21 | ++++
22
23 error[E0277]: can't drop `NonTrivialDrop` in const contexts
24 --> $DIR/const-drop-fail.rs:46:5
25 |
26 LL | const _: () = check($exp);
27 | ----- required by a bound introduced by this call
28 ...
29 LL | ConstImplWithDropGlue(NonTrivialDrop),
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
31 |
32 note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
33 --> $DIR/const-drop-fail.rs:46:5
34 |
35 LL | ConstImplWithDropGlue(NonTrivialDrop),
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 note: required because it appears within the type `ConstImplWithDropGlue`
38 --> $DIR/const-drop-fail.rs:16:8
39 |
40 LL | struct ConstImplWithDropGlue(NonTrivialDrop);
41 | ^^^^^^^^^^^^^^^^^^^^^
42 note: required by a bound in `check`
43 --> $DIR/const-drop-fail.rs:35:19
44 |
45 LL | const fn check<T: ~const Destruct>(_: T) {}
46 | ^^^^^^^^^^^^^^^ required by this bound in `check`
47
48 error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
49 --> $DIR/const-drop-fail.rs:48:47
50 |
51 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
52 | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
53 | |
54 | required by a bound introduced by this call
55 |
56 note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
57 --> $DIR/const-drop-fail.rs:48:47
58 |
59 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
60 | ^^^^^^^^^^^
61 note: required by a bound in `ConstDropImplWithBounds`
62 --> $DIR/const-drop-fail.rs:27:35
63 |
64 LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
65 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
66
67 error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
68 --> $DIR/const-drop-fail.rs:48:5
69 |
70 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
72 |
73 note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
74 --> $DIR/const-drop-fail.rs:48:5
75 |
76 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 note: required by a bound in `ConstDropImplWithBounds`
79 --> $DIR/const-drop-fail.rs:27:35
80 |
81 LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
82 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
83
84 error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
85 --> $DIR/const-drop-fail.rs:55:9
86 |
87 LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
88 | ^^^^^^^^
89 |
90 note: the implementor must specify the same requirement
91 --> $DIR/const-drop-fail.rs:53:1
92 |
93 LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95
96 error: aborting due to 5 previous errors
97
98 Some errors have detailed explanations: E0277, E0367.
99 For more information about an error, try `rustc --explain E0277`.