1 error[E0277]: can't drop `NonTrivialDrop` in const contexts
2 --> $DIR/const-drop-fail.rs:43:5
4 LL | const _: () = check($exp);
5 | ----- required by a bound introduced by this call
8 | ^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
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:34: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:45: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:45: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:34:19
45 LL | const fn check<T: ~const Destruct>(_: T) {}
46 | ^^^^^^^^^^^^^^^ required by this bound in `check`
48 error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied
49 --> $DIR/const-drop-fail.rs:47:5
51 LL | const _: () = check($exp);
52 | ----- required by a bound introduced by this call
54 LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
57 note: required for `ConstDropImplWithBounds<NonTrivialDrop>` to implement `~const Destruct`
58 --> $DIR/const-drop-fail.rs:28:25
60 LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
61 | ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
62 = note: 1 redundant requirement hidden
63 = note: required for `ConstDropImplWithBounds<NonTrivialDrop>` to implement `~const Destruct`
64 note: required by a bound in `check`
65 --> $DIR/const-drop-fail.rs:34:19
67 LL | const fn check<T: ~const Destruct>(_: T) {}
68 | ^^^^^^^^^^^^^^^ required by this bound in `check`
69 help: consider borrowing here
71 LL | &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
73 LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
76 error: aborting due to 3 previous errors
78 For more information about this error, try `rustc --explain E0277`.