+
Skip to content

Portable trait does not consider indirect types #598

@tv42

Description

@tv42

I was chasing an error from miri until I stumbled on #436 (comment) and with that flag it still panicked, but differently. Take out miri and it still panics. Huh.

thread 'tests::huh' panicked at /home/tv/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rancor-0.1.0/src/lib.rs:648:9:
created a new `Panic` from: unaligned pointer: ptr 0x00007ffff00015f7 unaligned for alignment 8
#[cfg(test)]
mod tests {
    use indexmap::IndexSet;

    #[test]
    fn huh() {
        let mut orig: IndexSet<u64> = IndexSet::new();
        orig.insert(1);
        let bytes = rkyv::to_bytes::<rkyv::rancor::Panic>(&orig).unwrap();
        let _archived = rkyv::access::<
            rkyv::collections::swiss_table::index_set::ArchivedIndexSet<u64>,
            rkyv::rancor::Panic,
        >(&bytes)
        .unwrap();
    }
}
[package]
name = "huh"
version = "0.1.0"
edition = "2024"

[dependencies]
indexmap = "2.7.1"
rkyv = { version = "0.8.10", features = ["indexmap-2", "unaligned"] }

Panics the same way with IndexMap too.

This should not be happening, for two reasons:

  1. I'm getting an AlignedVec from rkyv::to_bytes, so alignment problems aren't my fault.
  2. I'm asking for unaligned feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    known issueAn issue which can't be fixed right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载