2022-03-21 16:52:41 +11:00
|
|
|
error[E0277]: can't drop `NonTrivialDrop` in const contexts
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:44:5
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2021-09-16 14:01:37 +00:00
|
|
|
LL | const _: () = check($exp);
|
|
|
|
| ----- required by a bound introduced by this call
|
|
|
|
...
|
2021-09-02 10:59:53 +00:00
|
|
|
LL | NonTrivialDrop,
|
2022-08-18 12:16:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
= note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
|
2021-09-02 10:59:53 +00:00
|
|
|
note: required by a bound in `check`
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:35:19
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
LL | const fn check<T: ~const Destruct>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^ required by this bound in `check`
|
2021-12-24 22:50:44 +08:00
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | &NonTrivialDrop,
|
|
|
|
| +
|
|
|
|
LL | &mut NonTrivialDrop,
|
|
|
|
| ++++
|
2021-09-02 10:59:53 +00:00
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
error[E0277]: can't drop `NonTrivialDrop` in const contexts
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:46:5
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2021-09-16 14:01:37 +00:00
|
|
|
LL | const _: () = check($exp);
|
|
|
|
| ----- required by a bound introduced by this call
|
|
|
|
...
|
2021-09-02 10:59:53 +00:00
|
|
|
LL | ConstImplWithDropGlue(NonTrivialDrop),
|
2022-03-21 16:52:41 +11:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:46:5
|
2022-01-26 19:09:44 -08:00
|
|
|
|
|
|
|
|
LL | ConstImplWithDropGlue(NonTrivialDrop),
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-01-18 01:42:35 -08:00
|
|
|
note: required because it appears within the type `ConstImplWithDropGlue`
|
2022-02-09 10:53:40 -08:00
|
|
|
--> $DIR/const-drop-fail.rs:16:8
|
2022-01-18 01:42:35 -08:00
|
|
|
|
|
|
|
|
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-09-02 10:59:53 +00:00
|
|
|
note: required by a bound in `check`
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:35:19
|
2021-09-02 10:59:53 +00:00
|
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
LL | const fn check<T: ~const Destruct>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^ required by this bound in `check`
|
2021-09-02 10:59:53 +00:00
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
|
|
|
|
--> $DIR/const-drop-fail.rs:48:47
|
|
|
|
|
|
|
|
|
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
|
|
|
|
| ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
|
|
|
note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
|
|
|
|
--> $DIR/const-drop-fail.rs:48:47
|
|
|
|
|
|
|
|
|
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
note: required by a bound in `ConstDropImplWithBounds`
|
|
|
|
--> $DIR/const-drop-fail.rs:27:35
|
|
|
|
|
|
|
|
|
LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
|
|
|
|
| ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
|
|
|
|
--> $DIR/const-drop-fail.rs:48:5
|
|
|
|
|
|
|
|
|
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
|
|
|
|
|
|
|
|
|
note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/const-drop-fail.rs:48:5
|
2021-09-03 10:04:43 +00:00
|
|
|
|
|
|
|
|
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
|
2022-10-21 13:49:11 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: required by a bound in `ConstDropImplWithBounds`
|
|
|
|
--> $DIR/const-drop-fail.rs:27:35
|
2021-09-03 10:04:43 +00:00
|
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
|
|
|
|
| ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
|
|
|
|
|
|
|
|
error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
|
|
|
|
--> $DIR/const-drop-fail.rs:55:9
|
2021-10-13 13:58:41 +00:00
|
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
|
|
|
|
| ^^^^^^^^
|
2022-01-18 01:42:35 -08:00
|
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
note: the implementor must specify the same requirement
|
|
|
|
--> $DIR/const-drop-fail.rs:53:1
|
2021-12-24 22:50:44 +08:00
|
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-09-03 10:04:43 +00:00
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2021-09-02 10:59:53 +00:00
|
|
|
|
2022-10-21 13:49:11 +00:00
|
|
|
Some errors have detailed explanations: E0277, E0367.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|