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
58e901b6fd1163172149fd422565523b17eed5f0
rust/tests/ui/polymorphization/promoted-function-3.rs

15 lines
248 B
Rust
Raw Normal View History

polymorphize: constrain unevaluated const handling This commit constrains the support added for handling unevaluated consts in polymorphization (introduced in #75260) by: - Skipping associated constants as this causes cycle errors. - Skipping promoted constants when they contain `Self` as this ensures `T` is used in constants of the form `<Self as Foo<T>>`. Signed-off-by: David Wood <david@davidtw.co>
2020-08-09 11:22:50 +01:00
// run-pass
Bump mir-opt-level from 3 to 4 in tests
2021-03-04 10:21:13 -03:00
// compile-flags: -Zpolymorphize=on -Zmir-opt-level=4
polymorphize: constrain unevaluated const handling This commit constrains the support added for handling unevaluated consts in polymorphization (introduced in #75260) by: - Skipping associated constants as this causes cycle errors. - Skipping promoted constants when they contain `Self` as this ensures `T` is used in constants of the form `<Self as Foo<T>>`. Signed-off-by: David Wood <david@davidtw.co>
2020-08-09 11:22:50 +01:00
fn caller<T, U>() -> &'static usize {
callee::<U>()
}
fn callee<T>() -> &'static usize {
&std::mem::size_of::<T>()
}
fn main() {
assert_eq!(caller::<(), ()>(), &0);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1610ms Template: 3ms
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