blob: dd35501faecf157f66cb4ae1d00d376d97f90762 [file] [log] [blame]
Deadbeefb17e6682023-03-24 09:17:511error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
2 --> $DIR/const-drop-fail-2.rs:31:23
3 |
4LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(ConstDropImplWithBounds(PhantomData));
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
6 |
7note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
8 --> $DIR/const-drop-fail-2.rs:31:23
9 |
10LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(ConstDropImplWithBounds(PhantomData));
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12note: required by a bound in `ConstDropImplWithBounds`
13 --> $DIR/const-drop-fail-2.rs:21:35
14 |
15LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
16 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
17
18error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
19 --> $DIR/const-drop-fail-2.rs:31:64
20 |
21LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(ConstDropImplWithBounds(PhantomData));
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
23 |
24note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
25 --> $DIR/const-drop-fail-2.rs:31:64
26 |
27LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(ConstDropImplWithBounds(PhantomData));
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29note: required by a bound in `ConstDropImplWithBounds`
30 --> $DIR/const-drop-fail-2.rs:21:35
31 |
32LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
33 | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
34
35error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
36 --> $DIR/const-drop-fail-2.rs:37:9
37 |
38LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
39 | ^^^^^^^^
40 |
41note: the implementor must specify the same requirement
42 --> $DIR/const-drop-fail-2.rs:35:1
43 |
44LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46
47error: aborting due to 3 previous errors
48
49Some errors have detailed explanations: E0277, E0367.
50For more information about an error, try `rustc --explain E0277`.