rust/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr

76 lines
2.9 KiB
Plaintext
Raw Normal View History

error[E0277]: the trait bound `NonTrivialDrop: ~const Drop` is not satisfied
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:44:5
|
2021-09-16 09:01:37 -05:00
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
...
LL | NonTrivialDrop,
| ^^^^^^^^^^^^^^ expected an implementor of trait `~const Drop`
|
note: required by a bound in `check`
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:35:19
|
LL | const fn check<T: ~const Drop>(_: T) {}
| ^^^^^^^^^^^ required by this bound in `check`
help: consider borrowing here
|
LL | &NonTrivialDrop,
| +
LL | &mut NonTrivialDrop,
| ++++
error[E0277]: the trait bound `NonTrivialDrop: ~const Drop` is not satisfied in `ConstImplWithDropGlue`
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:46:5
|
2021-09-16 09:01:37 -05:00
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
...
LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Drop` is not implemented for `NonTrivialDrop`
|
note: the trait `Drop` is implemented for `NonTrivialDrop`, but that implementation is not `const`
--> $DIR/const-drop-fail.rs:46:5
|
LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-01-18 03:42:35 -06:00
note: required because it appears within the type `ConstImplWithDropGlue`
--> $DIR/const-drop-fail.rs:17:8
|
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `check`
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:35:19
|
LL | const fn check<T: ~const Drop>(_: T) {}
| ^^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Drop` is not satisfied
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:48:5
2021-09-03 05:04:43 -05:00
|
2022-01-18 03:42:35 -06:00
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
...
2021-09-03 05:04:43 -05:00
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Drop`
2021-09-03 05:04:43 -05:00
|
note: required because of the requirements on the impl of `~const Drop` for `ConstDropImplWithBounds<NonTrivialDrop>`
2022-01-18 03:42:35 -06:00
--> $DIR/const-drop-fail.rs:29:25
2021-09-03 05:04:43 -05:00
|
2022-01-18 03:42:35 -06:00
LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
| ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `check`
--> $DIR/const-drop-fail.rs:35:19
|
LL | const fn check<T: ~const Drop>(_: T) {}
| ^^^^^^^^^^^ required by this bound in `check`
help: consider borrowing here
|
LL | &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
| +
LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
| ++++
2021-09-03 05:04:43 -05:00
2022-01-18 03:42:35 -06:00
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.