diff options
Diffstat (limited to 'tests/ui/polymorphization/promoted-function-3.rs')
| -rw-r--r-- | tests/ui/polymorphization/promoted-function-3.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/polymorphization/promoted-function-3.rs b/tests/ui/polymorphization/promoted-function-3.rs new file mode 100644 index 00000000000..bbd991e36cc --- /dev/null +++ b/tests/ui/polymorphization/promoted-function-3.rs @@ -0,0 +1,14 @@ +// run-pass +// compile-flags: -Zpolymorphize=on -Zmir-opt-level=4 + +fn caller<T, U>() -> &'static usize { + callee::<U>() +} + +fn callee<T>() -> &'static usize { + &std::mem::size_of::<T>() +} + +fn main() { + assert_eq!(caller::<(), ()>(), &0); +} |
