]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
fix a suggestion message
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / const-drop-fail.stock.stderr
1 error[E0277]: the trait bound `NonTrivialDrop: ~const Drop` is not satisfied
2   --> $DIR/const-drop-fail.rs:44:5
3    |
4 LL |         const _: () = check($exp);
5    |                       ----- required by a bound introduced by this call
6 ...
7 LL |     NonTrivialDrop,
8    |     ^^^^^^^^^^^^^^ expected an implementor of trait `~const Drop`
9    |
10 note: required by a bound in `check`
11   --> $DIR/const-drop-fail.rs:35:19
12    |
13 LL | const fn check<T: ~const Drop>(_: T) {}
14    |                   ^^^^^^^^^^^ required by this bound in `check`
15 help: consider borrowing here
16    |
17 LL |     &NonTrivialDrop,
18    |     +
19 LL |     &mut NonTrivialDrop,
20    |     ++++
21
22 error[E0277]: the trait bound `NonTrivialDrop: ~const Drop` is not satisfied in `ConstImplWithDropGlue`
23   --> $DIR/const-drop-fail.rs:46:5
24    |
25 LL |         const _: () = check($exp);
26    |                       ----- required by a bound introduced by this call
27 ...
28 LL |     ConstImplWithDropGlue(NonTrivialDrop),
29    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Drop` is not implemented for `NonTrivialDrop`
30    |
31 note: the trait `Drop` is implemented for `NonTrivialDrop`, but that implementation is not `const`
32   --> $DIR/const-drop-fail.rs:46:5
33    |
34 LL |     ConstImplWithDropGlue(NonTrivialDrop),
35    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 note: required because it appears within the type `ConstImplWithDropGlue`
37   --> $DIR/const-drop-fail.rs:17:8
38    |
39 LL | struct ConstImplWithDropGlue(NonTrivialDrop);
40    |        ^^^^^^^^^^^^^^^^^^^^^
41 note: required by a bound in `check`
42   --> $DIR/const-drop-fail.rs:35:19
43    |
44 LL | const fn check<T: ~const Drop>(_: T) {}
45    |                   ^^^^^^^^^^^ required by this bound in `check`
46
47 error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Drop` is not satisfied
48   --> $DIR/const-drop-fail.rs:48:5
49    |
50 LL |         const _: () = check($exp);
51    |                       ----- required by a bound introduced by this call
52 ...
53 LL |     ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
54    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Drop`
55    |
56 note: required because of the requirements on the impl of `~const Drop` for `ConstDropImplWithBounds<NonTrivialDrop>`
57   --> $DIR/const-drop-fail.rs:29:25
58    |
59 LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
60    |                         ^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^
61 note: required by a bound in `check`
62   --> $DIR/const-drop-fail.rs:35:19
63    |
64 LL | const fn check<T: ~const Drop>(_: T) {}
65    |                   ^^^^^^^^^^^ required by this bound in `check`
66 help: consider borrowing here
67    |
68 LL |     &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
69    |     +
70 LL |     &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
71    |     ++++
72
73 error: aborting due to 3 previous errors
74
75 For more information about this error, try `rustc --explain E0277`.