Skip to content

PhysicalMapping cannot be dereferenced. #311

Description

I'm using the acpi crate to parse MADT but it looks like the PhysicalMapping cannot be dereferenced?

use ::acpi::sdt::madt::Madt;
use ::acpi::AcpiTables;

let tables = unsafe { AcpiTables::from_rsdp(AcpiHandler, rsdp.as_ptr().addr()) }
        .unwrap_or_else(|x| panic!("Failed to parse RSDP table: {:?}", x));

let mut madt = tables.find_table::<Madt>().expect("Failed to find MADT");

madt.entries().for_each(|entry| {}); // no method named `entries` found for struct `PhysicalMapping<H, T>` in the current scope

When I try to use .deref() manually, this is the error:

use ::acpi::sdt::madt::Madt;
use ::acpi::AcpiTables;

madt.deref().entries().for_each(|entry| {});

// the method `deref` exists for struct `PhysicalMapping<AcpiHandler, Madt>`, but its trait bounds were not satisfied [E0599]
// method cannot be called on `PhysicalMapping<AcpiHandler, Madt>` due to unsatisfied trait bounds
// Note: the following trait bounds were not satisfied:
// `Madt: Unpin`
// which is required by `PhysicalMapping<AcpiHandler, Madt>: Deref`

I tried using pin! to pin the madt since entries take reference to self via Pin. And result is still same.
It doesn't work for other fields as well.

Could it be because I disabled default features? By the way, crate still requires a global allocator even though all default features are disabled. And yes, my project requires me to not use any dynamic allocations. So currently there's a null allocator as a global allocator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions