diff options
| author | bors <bors@rust-lang.org> | 2020-08-11 12:31:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-11 12:31:56 +0000 |
| commit | 4b9ac5161781ca6a376daab3d3b2f2623d8f3789 (patch) | |
| tree | 9c0ef96cc28d572f230886ce0b8f66e529aa2e3e /src/test/ui/polymorphization | |
| parent | 441fd2255763c2aeea616aeac61b2c795a4c5330 (diff) | |
| parent | 532002853d88a7c9f875dc8c401b8b7e019fe10b (diff) | |
| download | rust-4b9ac5161781ca6a376daab3d3b2f2623d8f3789.tar.gz rust-4b9ac5161781ca6a376daab3d3b2f2623d8f3789.zip | |
Auto merge of #75388 - JohnTitor:rollup-9tgkxnl, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #74744 (Update RELEASES.md for 1.46.0) - #75085 (Transmute big endian `s6_addr` and `[u16; 8]`) - #75226 (Miri: Renamed "undef" to "uninit") - #75333 (polymorphize: constrain unevaluated const handling) - #75338 (move stack size check to const_eval machine) - #75347 (Rustdoc: Fix natural ordering to look at all numbers.) - #75352 (Tweak conditions for E0026 and E0769) - #75353 (Tiny cleanup, remove unnecessary `unwrap`) - #75359 (unused_delims: trim expr) - #75360 (Add sample fix for E0749) Failed merges: r? @ghost
Diffstat (limited to 'src/test/ui/polymorphization')
| -rw-r--r-- | src/test/ui/polymorphization/promoted-function-3.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/polymorphization/promoted-function-3.rs b/src/test/ui/polymorphization/promoted-function-3.rs new file mode 100644 index 00000000000..1c84df13e10 --- /dev/null +++ b/src/test/ui/polymorphization/promoted-function-3.rs @@ -0,0 +1,14 @@ +// run-pass +// compile-flags: -Zpolymorphize=on -Zmir-opt-level=3 + +fn caller<T, U>() -> &'static usize { + callee::<U>() +} + +fn callee<T>() -> &'static usize { + &std::mem::size_of::<T>() +} + +fn main() { + assert_eq!(caller::<(), ()>(), &0); +} |
