From 642ee63c228ad8d8c988cb3c68089776ddc97980 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 22 Apr 2026 16:59:44 +0200 Subject: [PATCH] Add regression test --- .../consts/drop-impl-nonconst-drop-field.rs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ui/consts/drop-impl-nonconst-drop-field.rs diff --git a/tests/ui/consts/drop-impl-nonconst-drop-field.rs b/tests/ui/consts/drop-impl-nonconst-drop-field.rs new file mode 100644 index 000000000000..a431c91bf2d9 --- /dev/null +++ b/tests/ui/consts/drop-impl-nonconst-drop-field.rs @@ -0,0 +1,31 @@ +#![feature(const_trait_impl)] +#![feature(const_destruct)] +//@ check-pass + +use std::marker::Destruct; + +struct NotConstDrop; + +impl Drop for NotConstDrop { + fn drop(&mut self) {} +} + +struct ConstDrop(NotConstDrop); + +impl const Drop for ConstDrop { + fn drop(&mut self) {} +} + +struct ConstDrop2(T); + +impl const Drop for ConstDrop2 { + fn drop(&mut self) {} +} + +struct ConstDrop3(T); + +impl const Drop for ConstDrop3 { + fn drop(&mut self) {} +} + +fn main() {}