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>
14 lines
248 B
Rust
14 lines
248 B
Rust
// 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);
|
|
}
|