@@ -45,34 +45,55 @@ note: required by a bound in `check`
45
45
LL | const fn check<T: ~const Destruct>(_: T) {}
46
46
| ^^^^^^^^^^^^^^^ required by this bound in `check`
47
47
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`
49
74
--> $DIR/const-drop-fail.rs:48:5
50
75
|
51
- LL | const _: () = check($exp);
52
- | ----- required by a bound introduced by this call
53
- ...
54
76
LL | 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
56
80
|
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
59
86
|
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
+ | ^^^^^^^^
66
89
|
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
70
92
|
71
- LL | &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
72
- | +
73
- LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
74
- | ++++
93
+ LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
94
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
95
76
- error: aborting due to 3 previous errors
96
+ error: aborting due to 5 previous errors
77
97
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