virtee / snpguest

A CLI tool for interacting with SEV-SNP guest environment
Apache License 2.0
42 stars 24 forks source link

Compilation fails when the hyperv feature is enabled #35

Closed srcman closed 8 months ago

srcman commented 10 months ago

Building with cargo build -r --features hyperv currently results in the error below (apparently since the hv variable is set to the hyperv::present function and not its return value).

error[E0308]: mismatched types
   --> src/main.rs:72:63
    |
72  |         SnpGuestCmd::Report(args) => report::get_report(args, hv),
    |                                      ------------------       ^^ expected `bool`, found fn item
    |                                      |
    |                                      arguments to this function are incorrect
    |
   ::: src/hyperv/mod.rs:24:1
    |
24  | pub fn present() -> bool {
    | ------------------------ function `present` defined here
    |
    = note: expected type `bool`
            found fn item `fn() -> bool {present}`
note: function defined here
   --> src/report.rs:103:8
    |
103 | pub fn get_report(args: ReportArgs, hv: bool) -> Result<()> {
    |        ^^^^^^^^^^                   --------
help: use parentheses to call this function
    |
72  |         SnpGuestCmd::Report(args) => report::get_report(args, hv()),
    |                                                                 ++