@@ -45,34 +45,55 @@ note: required by a bound in `check`
4545LL | const fn check<T: ~const Destruct>(_: T) {}
4646 | ^^^^^^^^^^^^^^^ required by this bound in `check`
4747
48- error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied
48+ error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
49+ --> $DIR/const-drop-fail.rs:48:47
50+ |
51+ LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
52+ | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
53+ | |
54+ | required by a bound introduced by this call
55+ |
56+ note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
57+ --> $DIR/const-drop-fail.rs:48:47
58+ |
59+ LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
60+ | ^^^^^^^^^^^
61+ note: required by a bound in `ConstDropImplWithBounds`
62+ --> $DIR/const-drop-fail.rs:27:35
63+ |
64+ LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
65+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
66+
67+ error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
68+ --> $DIR/const-drop-fail.rs:48:5
69+ |
70+ LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
71+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
72+ |
73+ note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
4974 --> $DIR/const-drop-fail.rs:48:5
5075 |
51- LL | const _: () = check($exp);
52- | ----- required by a bound introduced by this call
53- ...
5476LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
55- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `ConstDropImplWithBounds<NonTrivialDrop>`
77+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78+ note: required by a bound in `ConstDropImplWithBounds`
79+ --> $DIR/const-drop-fail.rs:27:35
5680 |
57- note: required for `ConstDropImplWithBounds<NonTrivialDrop>` to implement `~const Destruct`
58- --> $DIR/const-drop-fail.rs:29:25
81+ LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
82+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
83+
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
5986 |
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:35:19
87+ LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
88+ | ^^^^^^^^
6689 |
67- LL | const fn check<T: ~const Destruct>(_: T) {}
68- | ^^^^^^^^^^^^^^^ required by this bound in `check`
69- help: consider borrowing here
90+ note: the implementor must specify the same requirement
91+ --> $DIR/const-drop-fail.rs:53:1
7092 |
71- LL | &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
72- | +
73- LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
74- | ++++
93+ LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
94+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7595
76- error: aborting due to 3 previous errors
96+ error: aborting due to 5 previous errors
7797
78- For more information about this error, try `rustc --explain E0277`.
98+ Some errors have detailed explanations: E0277, E0367.
99+ For more information about an error, try `rustc --explain E0277`.
0 commit comments