summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/const-drop.precise.stderr
blob: ed90b234761ad8ee50bcfd6e84cc1961cc4b4ed0 (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
79
80
81
82
83
84
85
86
87
88
89
90
error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
  --> $DIR/const-drop.rs:12:16
   |
LL | impl<'a> const Drop for S<'a> {
   |                ^^^^
   |
   = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
   = note: adding a non-const method body in the future would be a breaking change

error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
  --> $DIR/const-drop.rs:46:16
   |
LL |     impl const Drop for ConstDrop {
   |                ^^^^
   |
   = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
   = note: adding a non-const method body in the future would be a breaking change

error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
  --> $DIR/const-drop.rs:67:37
   |
LL |     impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> {
   |                                     ^^^^
   |
   = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
   = note: adding a non-const method body in the future would be a breaking change

error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
  --> $DIR/const-drop.rs:75:30
   |
LL |     impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> {
   |                              ^^^^
   |
   = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
   = note: adding a non-const method body in the future would be a breaking change

error: `~const` can only be applied to `#[const_trait]` traits
  --> $DIR/const-drop.rs:18:15
   |
LL | const fn a<T: ~const Destruct>(_: T) {}
   |               ^^^^^^

error: `~const` can only be applied to `#[const_trait]` traits
  --> $DIR/const-drop.rs:18:15
   |
LL | const fn a<T: ~const Destruct>(_: T) {}
   |               ^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0277]: the trait bound `T: const SomeTrait` is not satisfied
  --> $DIR/const-drop.rs:67:46
   |
LL |     impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> {
   |                                              ^^^^^^^^^^^^^^^^^^^^^
   |
note: required by a bound in `t::ConstDropWithBound`
  --> $DIR/const-drop.rs:65:38
   |
LL |     pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>);
   |                                      ^^^^^ required by this bound in `ConstDropWithBound`

error[E0277]: the trait bound `T: const SomeTrait` is not satisfied
  --> $DIR/const-drop.rs:68:22
   |
LL |         fn drop(&mut self) {
   |                      ^^^^
   |
note: required by a bound in `t::ConstDropWithBound`
  --> $DIR/const-drop.rs:65:38
   |
LL |     pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>);
   |                                      ^^^^^ required by this bound in `ConstDropWithBound`

error[E0493]: destructor of `T` cannot be evaluated at compile-time
  --> $DIR/const-drop.rs:18:32
   |
LL | const fn a<T: ~const Destruct>(_: T) {}
   |                                ^ the destructor for this type cannot be evaluated in constant functions

error[E0277]: the trait bound `T: ~const SomeTrait` is not satisfied
  --> $DIR/const-drop.rs:69:13
   |
LL |             T::foo();
   |             ^^^^^^^^

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0277, E0493.
For more information about an error, try `rustc --explain E0277`.