2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
#![allow(non_upper_case_globals)]
|
|
|
|
|
2013-09-02 13:33:17 +00:00
|
|
|
/*
|
|
|
|
# Comparison of static arrays
|
|
|
|
|
2019-02-09 21:23:30 +00:00
|
|
|
The expected behaviour would be that `test == test1`, therefore 'true'
|
2013-09-02 13:33:17 +00:00
|
|
|
would be printed, however the below prints false.
|
|
|
|
*/
|
|
|
|
|
2013-12-10 07:16:18 +00:00
|
|
|
struct signature<'a> { pattern : &'a [u32] }
|
2013-09-02 13:33:17 +00:00
|
|
|
|
|
|
|
static test1: signature<'static> = signature {
|
2015-03-03 08:42:26 +00:00
|
|
|
pattern: &[0x243f6a88,0x85a308d3,0x13198a2e,0x03707344,0xa4093822,0x299f31d0]
|
2013-09-02 13:33:17 +00:00
|
|
|
};
|
|
|
|
|
2013-09-25 07:43:37 +00:00
|
|
|
pub fn main() {
|
2015-03-03 08:42:26 +00:00
|
|
|
let test: &[u32] = &[0x243f6a88,0x85a308d3,0x13198a2e,
|
|
|
|
0x03707344,0xa4093822,0x299f31d0];
|
2014-01-09 10:06:55 +00:00
|
|
|
println!("{}",test==test1.pattern);
|
2013-09-02 13:33:17 +00:00
|
|
|
}
|