Commit 4f52fb7
committed
introduce
We will want to start boxing our errors to avoid generic error types
(and to reduce the size of error types, by collapsing multiple variants
into one). In order to do this, we need a trait that we can box which
expresses fmt::Debug and fmt::Display.
(Ideally we would also bound on std::error::Error but we can't express
this bound without std until Rust 1.81, and we can't have a std-only
bound since it would make the std feature non-additive.)
This IS A BREAKING CHANGE because it now requires all key parsing errors
to have a 'static bound. But the alternatives are pretty bad:
* We could continue dropping parsing errors and replacing them with
Strings (or not replacing them at all..); or
* We could add a <Pk> bound to all of our error typesStaticDebugAndDisplay blanket trait, use it for all errors1 parent b11cdc2 commit 4f52fb7
1 file changed
+15
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | | - | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | | - | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | | - | |
| 74 | + | |
70 | 75 | | |
71 | | - | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
0 commit comments