mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00

While provenance cannot be captured through these arguments, the address / object identity can.
16 lines
402 B
Rust
16 lines
402 B
Rust
// Regression test for issue #137668 where an indirect argument have been marked as nocapture
|
|
// despite the fact that callee did in fact capture the address.
|
|
//
|
|
//@ run-pass
|
|
//@ compile-flags: -Copt-level=2
|
|
|
|
#[inline(never)]
|
|
pub fn f(a: [u32; 64], b: [u32; 64]) -> bool {
|
|
&a as *const _ as usize != &b as *const _ as usize
|
|
}
|
|
|
|
fn main() {
|
|
static S: [u32; 64] = [0; 64];
|
|
assert!(f(S, S));
|
|
}
|