Skip to content

Comparison of static arrays #7012

Closed
Closed
@ghost

Description

Hello,

Just posting this to see if it is a bug. The expected behaviour would be that test==test1, therefore 'true' would be printed, however the below prints false. This was tested on windows running 0.6 release.

struct signature<'self> {   
  pattern   : &'self [u32] 
}

static test1: signature<'static> =  signature {
  pattern: &[0x243f6a88u32,0x85a308d3u32,0x13198a2eu32,0x03707344u32,0xa4093822u32,0x299f31d0u32]
};

fn main() {
  let test = &[0x243f6a88u32,0x85a308d3u32,0x13198a2eu32,0x03707344u32,0xa4093822u32,0x299f31d0u32];
  println(fmt!("%b",test==test1.pattern));

}

Edit: changed code, made sure types are correct, retested, returns false on 0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions