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() {}