diff options
| author | David Wood <david@davidtw.co> | 2020-08-09 14:53:33 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-08-09 14:53:33 +0100 |
| commit | fd41bdeff0ff56ad2e46b00ca55daafb68a8ea08 (patch) | |
| tree | 52d247f9a12cccdb995f4fcd4ea20d77ae79617b /src/test/codegen-units | |
| parent | 8e738539be23a62120059b5b4443f6c235f932b4 (diff) | |
| download | rust-fd41bdeff0ff56ad2e46b00ca55daafb68a8ea08.tar.gz rust-fd41bdeff0ff56ad2e46b00ca55daafb68a8ea08.zip | |
instance: only polymorphize upvar substs
This commit restricts the substitution polymorphization added in #75255 to only apply to the tupled upvar substitution, rather than all substitutions, fixing a bunch of regressions when polymorphization is enabled. Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'src/test/codegen-units')
| -rw-r--r-- | src/test/codegen-units/polymorphization/pr-75255.rs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/test/codegen-units/polymorphization/pr-75255.rs b/src/test/codegen-units/polymorphization/pr-75255.rs deleted file mode 100644 index af47b440640..00000000000 --- a/src/test/codegen-units/polymorphization/pr-75255.rs +++ /dev/null @@ -1,52 +0,0 @@ -// compile-flags:-Zpolymorphize=on -Zprint-mono-items=lazy -Copt-level=1 -// ignore-tidy-linelength - -#![crate_type = "rlib"] - -// Test that only one copy of `Iter::map` and `iter::repeat` are generated. - -fn unused<T>() -> u64 { - 42 -} - -fn foo<T>() { - let x = [1, 2, 3, std::mem::size_of::<T>()]; - x.iter().map(|_| ()); -} - -//~ MONO_ITEM fn core::iter[0]::adapters[0]::{{impl}}[29]::new[0]<core::slice[0]::Iter[0]<usize>, pr_75255::foo[0]::{{closure}}[0]<T>> @@ pr_75255-cgu.0[External] -//~ MONO_ITEM fn core::iter[0]::traits[0]::iterator[0]::Iterator[0]::map[0]<core::slice[0]::Iter[0]<usize>, (), pr_75255::foo[0]::{{closure}}[0]<T>> @@ pr_75255-cgu.1[Internal] - -fn bar<T>() { - std::iter::repeat(unused::<T>); -} - -//~ MONO_ITEM fn core::iter[0]::sources[0]::repeat[0]<fn() -> u64> @@ pr_75255-cgu.1[Internal] - -pub fn dispatch() { - foo::<String>(); - foo::<Vec<String>>(); - - bar::<String>(); - bar::<Vec<String>>(); -} - -// These are all the items that aren't relevant to the test. -//~ MONO_ITEM fn core::mem[0]::size_of[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::mem[0]::size_of[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::mem[0]::size_of[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::add[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::is_null[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::offset[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::wrapping_add[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::wrapping_offset[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::non_null[0]::{{impl}}[3]::new_unchecked[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::null[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::as_ptr[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::iter[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::len[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::dispatch[0] @@ pr_75255-cgu.1[External] -//~ MONO_ITEM fn pr_75255::foo[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::foo[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::bar[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::bar[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] |
