diff options
Diffstat (limited to 'tests/ui/lint/unused/must-use-box-from-raw.rs')
-rw-r--r-- | tests/ui/lint/unused/must-use-box-from-raw.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/lint/unused/must-use-box-from-raw.rs b/tests/ui/lint/unused/must-use-box-from-raw.rs new file mode 100644 index 000000000..9ea772689 --- /dev/null +++ b/tests/ui/lint/unused/must-use-box-from-raw.rs @@ -0,0 +1,11 @@ +// #99269 + +// check-pass + +#![warn(unused_must_use)] + +unsafe fn free<T>(ptr: *mut T) { + Box::from_raw(ptr); //~ WARNING unused return value +} + +fn main() {} |