1 error[E0277]: can't drop `NonTrivialDrop` in const contexts
2 --> $DIR/const-drop-fail.rs:44:5
4 LL | const _: () = check($exp);
5 | ----- required by a bound introduced by this call
8 | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
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
14 LL | const fn check<T: ~const Destruct>(_: T) {}
15 | ^^^^^^^^^^^^^^^ required by this bound in `check`
16 help: consider borrowing here
20 LL | &mut NonTrivialDrop,
23 error[E0277]: can't drop `NonTrivialDrop` in const contexts
24 --> $DIR/const-drop-fail.rs:46:5
26 LL | const _: () = check($exp);
27 | ----- required by a bound introduced by this call
29 LL | ConstImplWithDropGlue(NonTrivialDrop),
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
32 note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
33 --> $DIR/const-drop-fail.rs:46:5
35 LL | ConstImplWithDropGlue(NonTrivialDrop),
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 note: required because it appears within the type `ConstImplWithDropGlue`
38 --> $DIR/const-drop-fail.rs:16:8
40 LL | struct ConstImplWithDropGlue(NonTrivialDrop);
41 | ^^^^^^^^^^^^^^^^^^^^^
42 note: required by a bound in `check`
43 --> $DIR/const-drop-fail.rs:35:19
45 LL | const fn check<T: ~const Destruct>(_: T) {}
46 | ^^^^^^^^^^^^^^^ required by this bound in `check`
48 error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
49 --> $DIR/const-drop-fail.rs:48:47
51 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
52 | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
54 | required by a bound introduced by this call
56 note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
57 --> $DIR/const-drop-fail.rs:48:47
59 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
61 note: required by a bound in `ConstDropImplWithBounds`
62 --> $DIR/const-drop-fail.rs:27:35
64 LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
65 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
67 error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
68 --> $DIR/const-drop-fail.rs:48:5
70 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
73 note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
74 --> $DIR/const-drop-fail.rs:48:5
76 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 note: required by a bound in `ConstDropImplWithBounds`
79 --> $DIR/const-drop-fail.rs:27:35
81 LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
82 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
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
87 LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
90 note: the implementor must specify the same requirement
91 --> $DIR/const-drop-fail.rs:53:1
93 LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96 error: aborting due to 5 previous errors
98 Some errors have detailed explanations: E0277, E0367.
99 For more information about an error, try `rustc --explain E0277`.