]>
Commit | Line | Data |
---|---|---|
5e7ed085 | 1 | error[E0277]: can't drop `NonTrivialDrop` in const contexts |
2b03887a | 2 | --> $DIR/const-drop-fail.rs:44:5 |
c295e0f8 XL |
3 | | |
4 | LL | const _: () = check($exp); | |
5 | | ----- required by a bound introduced by this call | |
6 | ... | |
7 | LL | NonTrivialDrop, | |
f2b60f7d | 8 | | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop` |
c295e0f8 | 9 | | |
5e7ed085 | 10 | = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied |
c295e0f8 | 11 | note: required by a bound in `check` |
2b03887a | 12 | --> $DIR/const-drop-fail.rs:35:19 |
c295e0f8 | 13 | | |
5e7ed085 FG |
14 | LL | const fn check<T: ~const Destruct>(_: T) {} |
15 | | ^^^^^^^^^^^^^^^ required by this bound in `check` | |
5099ac24 FG |
16 | help: consider borrowing here |
17 | | | |
18 | LL | &NonTrivialDrop, | |
19 | | + | |
20 | LL | &mut NonTrivialDrop, | |
21 | | ++++ | |
c295e0f8 | 22 | |
5e7ed085 | 23 | error[E0277]: can't drop `NonTrivialDrop` in const contexts |
2b03887a | 24 | --> $DIR/const-drop-fail.rs:46:5 |
c295e0f8 XL |
25 | | |
26 | LL | const _: () = check($exp); | |
27 | | ----- required by a bound introduced by this call | |
28 | ... | |
29 | LL | ConstImplWithDropGlue(NonTrivialDrop), | |
5e7ed085 | 30 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop` |
c295e0f8 | 31 | | |
5e7ed085 | 32 | note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const` |
2b03887a | 33 | --> $DIR/const-drop-fail.rs:46:5 |
5099ac24 FG |
34 | | |
35 | LL | ConstImplWithDropGlue(NonTrivialDrop), | |
36 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
37 | note: required because it appears within the type `ConstImplWithDropGlue` | |
5e7ed085 | 38 | --> $DIR/const-drop-fail.rs:16:8 |
5099ac24 FG |
39 | | |
40 | LL | struct ConstImplWithDropGlue(NonTrivialDrop); | |
41 | | ^^^^^^^^^^^^^^^^^^^^^ | |
c295e0f8 | 42 | note: required by a bound in `check` |
2b03887a | 43 | --> $DIR/const-drop-fail.rs:35:19 |
c295e0f8 | 44 | | |
5e7ed085 FG |
45 | LL | const fn check<T: ~const Destruct>(_: T) {} |
46 | | ^^^^^^^^^^^^^^^ required by this bound in `check` | |
c295e0f8 | 47 | |
2b03887a FG |
48 | error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied |
49 | --> $DIR/const-drop-fail.rs:48:47 | |
c295e0f8 XL |
50 | | |
51 | LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), | |
2b03887a FG |
52 | | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop` |
53 | | | | |
54 | | required by a bound introduced by this call | |
c295e0f8 | 55 | | |
2b03887a FG |
56 | note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const` |
57 | --> $DIR/const-drop-fail.rs:48:47 | |
c295e0f8 | 58 | | |
2b03887a FG |
59 | LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), |
60 | | ^^^^^^^^^^^ | |
61 | note: required by a bound in `ConstDropImplWithBounds` | |
62 | --> $DIR/const-drop-fail.rs:27:35 | |
c295e0f8 | 63 | | |
2b03887a FG |
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 | |
c295e0f8 | 69 | | |
2b03887a FG |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
c295e0f8 | 95 | |
2b03887a | 96 | error: aborting due to 5 previous errors |
c295e0f8 | 97 | |
2b03887a FG |
98 | Some errors have detailed explanations: E0277, E0367. |
99 | For more information about an error, try `rustc --explain E0277`. |