diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-24 17:08:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-24 17:08:16 +0100 |
| commit | 702261dce66c6376beba8727563bc2e0b631c9be (patch) | |
| tree | 1aea4aca1a9f046c99beef6aaf0df1a4b222d791 | |
| parent | 04eedb24c95c181e360a795c573806dc26670aa0 (diff) | |
| parent | fc5085d5709df1cc6e409d60216c6a1f5380aa48 (diff) | |
| download | rust-702261dce66c6376beba8727563bc2e0b631c9be.tar.gz rust-702261dce66c6376beba8727563bc2e0b631c9be.zip | |
Rollup merge of #122886 - matthiaskrgr:issue90192, r=fee1-dead
add test for #90192 Fixes #90192
| -rw-r--r-- | tests/ui/polymorphization/ice-poly-with-mir-opts-90192.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/polymorphization/ice-poly-with-mir-opts-90192.rs b/tests/ui/polymorphization/ice-poly-with-mir-opts-90192.rs new file mode 100644 index 00000000000..4557c7e517c --- /dev/null +++ b/tests/ui/polymorphization/ice-poly-with-mir-opts-90192.rs @@ -0,0 +1,20 @@ +// issue: rust-lang/rust#90192 +// ICE assertion failed: matches!(ty.kind(), ty :: Param(_)) +//@ compile-flags:-Zpolymorphize=on -Zmir-opt-level=3 +//@ build-pass + +fn test<T>() { + std::mem::size_of::<T>(); +} + +pub fn foo<T>(_: T) -> &'static fn() { + &(test::<T> as fn()) +} + +fn outer<T>() { + foo(|| ()); +} + +fn main() { + outer::<u8>(); +} |
