1
- error: `~const` is not allowed here
2
- --> $DIR/const-drop-fail.rs:27:35
3
- |
4
- LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
5
- | ^^^^^^^^
6
- |
7
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
8
-
9
1
error[E0277]: the trait bound `NonTrivialDrop: Drop` is not satisfied
10
- --> $DIR/const-drop-fail.rs:45 :5
2
+ --> $DIR/const-drop-fail.rs:44 :5
11
3
|
12
4
LL | const _: () = check($exp);
13
5
| ----- required by a bound introduced by this call
@@ -16,50 +8,51 @@ LL | NonTrivialDrop,
16
8
| ^^^^^^^^^^^^^^ the trait `Drop` is not implemented for `NonTrivialDrop`
17
9
|
18
10
note: required by a bound in `check`
19
- --> $DIR/const-drop-fail.rs:36 :19
11
+ --> $DIR/const-drop-fail.rs:35 :19
20
12
|
21
13
LL | const fn check<T: ~const Drop>(_: T) {}
22
14
| ^^^^^^^^^^^ required by this bound in `check`
23
15
24
- error[E0277]: the trait bound `ConstImplWithDropGlue : Drop` is not satisfied
25
- --> $DIR/const-drop-fail.rs:47 :5
16
+ error[E0277]: the trait bound `NonTrivialDrop : Drop` is not satisfied in `ConstImplWithDropGlue`
17
+ --> $DIR/const-drop-fail.rs:46 :5
26
18
|
27
19
LL | const _: () = check($exp);
28
20
| ----- required by a bound introduced by this call
29
21
...
30
22
LL | ConstImplWithDropGlue(NonTrivialDrop),
31
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Drop` is not implemented for `ConstImplWithDropGlue `
23
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `Drop` is not implemented for `NonTrivialDrop `
32
24
|
25
+ note: required because it appears within the type `ConstImplWithDropGlue`
26
+ --> $DIR/const-drop-fail.rs:17:8
27
+ |
28
+ LL | struct ConstImplWithDropGlue(NonTrivialDrop);
29
+ | ^^^^^^^^^^^^^^^^^^^^^
33
30
note: required by a bound in `check`
34
- --> $DIR/const-drop-fail.rs:36 :19
31
+ --> $DIR/const-drop-fail.rs:35 :19
35
32
|
36
33
LL | const fn check<T: ~const Drop>(_: T) {}
37
34
| ^^^^^^^^^^^ required by this bound in `check`
38
35
39
36
error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied
40
- --> $DIR/const-drop-fail.rs:49:5
41
- |
42
- LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
43
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `A` is not implemented for `NonTrivialDrop`
44
- |
45
- note: required by a bound in `ConstDropImplWithBounds`
46
- --> $DIR/const-drop-fail.rs:27:35
47
- |
48
- LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
49
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
50
-
51
- error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied
52
- --> $DIR/const-drop-fail.rs:49:5
37
+ --> $DIR/const-drop-fail.rs:48:5
53
38
|
39
+ LL | const _: () = check($exp);
40
+ | ----- required by a bound introduced by this call
41
+ ...
54
42
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
55
43
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `A` is not implemented for `NonTrivialDrop`
56
44
|
57
- note: required by a bound in ` ConstDropImplWithBounds`
58
- --> $DIR/const-drop-fail.rs:27:35
45
+ note: required because of the requirements on the impl of `Drop` for ` ConstDropImplWithBounds<NonTrivialDrop> `
46
+ --> $DIR/const-drop-fail.rs:29:25
59
47
|
60
- LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
61
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
48
+ LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
49
+ | ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
50
+ note: required by a bound in `check`
51
+ --> $DIR/const-drop-fail.rs:35:19
52
+ |
53
+ LL | const fn check<T: ~const Drop>(_: T) {}
54
+ | ^^^^^^^^^^^ required by this bound in `check`
62
55
63
- error: aborting due to 5 previous errors
56
+ error: aborting due to 3 previous errors
64
57
65
58
For more information about this error, try `rustc --explain E0277`.
0 commit comments