summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
blob: 2295a822fa48b7be4b4680ba1ae38dc576f687f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
error[E0277]: can't drop `NonTrivialDrop` in const contexts
  --> $DIR/const-drop-fail.rs:43:5
   |
LL |         const _: () = check($exp);
   |                       ----- required by a bound introduced by this call
...
LL |     NonTrivialDrop,
   |     ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
   |
   = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
note: required by a bound in `check`
  --> $DIR/const-drop-fail.rs:34:19
   |
LL | const fn check<T: ~const Destruct>(_: T) {}
   |                   ^^^^^^^^^^^^^^^ required by this bound in `check`
help: consider borrowing here
   |
LL |     &NonTrivialDrop,
   |     +
LL |     &mut NonTrivialDrop,
   |     ++++

error[E0277]: can't drop `NonTrivialDrop` in const contexts
  --> $DIR/const-drop-fail.rs:45:5
   |
LL |         const _: () = check($exp);
   |                       ----- required by a bound introduced by this call
...
LL |     ConstImplWithDropGlue(NonTrivialDrop),
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
   |
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
  --> $DIR/const-drop-fail.rs:45:5
   |
LL |     ConstImplWithDropGlue(NonTrivialDrop),
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `ConstImplWithDropGlue`
  --> $DIR/const-drop-fail.rs:16:8
   |
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
   |        ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `check`
  --> $DIR/const-drop-fail.rs:34:19
   |
LL | const fn check<T: ~const Destruct>(_: T) {}
   |                   ^^^^^^^^^^^^^^^ required by this bound in `check`

error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied
  --> $DIR/const-drop-fail.rs:47:5
   |
LL |         const _: () = check($exp);
   |                       ----- required by a bound introduced by this call
...
LL |     ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `ConstDropImplWithBounds<NonTrivialDrop>`
   |
note: required for `ConstDropImplWithBounds<NonTrivialDrop>` to implement `~const Destruct`
  --> $DIR/const-drop-fail.rs:28:25
   |
LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
   |                         ^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: 1 redundant requirement hidden
   = note: required for `ConstDropImplWithBounds<NonTrivialDrop>` to implement `~const Destruct`
note: required by a bound in `check`
  --> $DIR/const-drop-fail.rs:34:19
   |
LL | const fn check<T: ~const Destruct>(_: T) {}
   |                   ^^^^^^^^^^^^^^^ required by this bound in `check`
help: consider borrowing here
   |
LL |     &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
   |     +
LL |     &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
   |     ++++

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.