rust/tests/ui/offset-of/offset-of-must-use.rs
George Bateman ca79086c87
Fix #124478 - offset_of! returns a temporary
This was due to the must_use() call. Adding HIR's OffsetOf to the must_use
checking within the compiler avoids this issue.
2024-04-28 18:36:08 +01:00

9 lines
145 B
Rust

//@ check-pass
#![warn(unused)]
fn main() {
core::mem::offset_of!((String,), 0);
//~^ WARN unused `offset_of` call that must be used
}