From 107d468c766ce26fb280f677e43122415fd4b51f Mon Sep 17 00:00:00 2001 From: zakrad <49591476+zakrad@users.noreply.github.com> Date: Fri, 14 Aug 2026 01:19:21 +0330 Subject: [PATCH] Add regression test for test_case attribute on a use item --- .../test-case-on-use-item-129765.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/custom_test_frameworks/test-case-on-use-item-129765.rs diff --git a/tests/ui/custom_test_frameworks/test-case-on-use-item-129765.rs b/tests/ui/custom_test_frameworks/test-case-on-use-item-129765.rs new file mode 100644 index 0000000000000..af107cfacfe55 --- /dev/null +++ b/tests/ui/custom_test_frameworks/test-case-on-use-item-129765.rs @@ -0,0 +1,20 @@ +// Regression test for . +// A `#[test_case]` attribute on a `use` item used to ICE with +// "TyKind::Error constructed but no error reported". +//@ check-pass +//@ compile-flags: --test + +#![feature(custom_test_frameworks)] +#![test_runner(crate::test_runner)] +#![allow(unused_imports)] + +pub fn test_runner(tests: &[&dyn Fn()]) { + for test in tests { + test(); + } +} + +#[test_case] +use std::mem; + +fn main() {}