oxidecomputer / oxidecomputer/hubris
use const generics in DICE cert trait
Open
@flihp is already working on this.
Since Sep 14, 2022.
trust quorum
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
This interface would ideally return sized arrays for the generic 'get_range' function. This isn't yet possible w/o using unstable features:
trait Foo {
const BAR: usize;
fn baz(self) -> [u8; Self::BAR];
}
Currently this produces an error:
error: generic parameters may not be used in const operations
--> src/lib.rs:6:26
|
6 | fn baz(self) -> [u8; Self::BAR];
| ^^^^^^^^^ cannot perform const operation using `Self`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.