Commit 64dbf1c
committed
Use generics in associated const CTFE timing example
This makes the example a bit bigger, but makes the reason why constants don't
immediately undergo CTFE more conspicuous. When there is computation in the
definition that use generic parameters, there is not enough information to
fully evaluate the definition eagerly.
I made it a `compile_fail` example so the run button on the page gives reader
useful outputs.1 parent 3e6b404 commit 64dbf1c
1 file changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
309 | 316 | | |
310 | | - | |
311 | 317 | | |
312 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
313 | 325 | | |
314 | 326 | | |
315 | 327 | | |
| |||
0 commit comments