Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
e0e7a432db38ac26355e7c60219c27720b9ec42f
rust/tests/ui/polymorphization/issue-74614.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
235 B
Rust
Raw Normal View History

interp: needs_subst -> ensure_monomorphic_enough This commit adds a `ensure_monomorphic_enough` utility function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. `ensure_monomorphic_enough` is then used throughout interpret where `needs_subst` checks previously existed (in particular, for some pointer casts and for reflection intrinsics more precise). Signed-off-by: David Wood <david@davidtw.co>
2020-07-24 13:16:54 +01:00
//@ compile-flags:-Zpolymorphize=on
tests: add regression test for #74614 This commit adds a regression test for #74614 so that it is fixed before polymorphisation is re-enabled. Signed-off-by: David Wood <david@davidtw.co>
2020-07-22 15:35:52 +01:00
//@ 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>();
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2980ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API